@lit-protocol/aw-cli v0.1.0-16
Agent Wallet CLI
The Agent Wallet CLI is a command-line interface (CLI) application designed to demonstrate the capabilities of agent wallets. It allows users to manage policies, delegate permissions, and execute tools within defined constraints. This tool is particularly useful for developers and administrators working with decentralized systems and Lit Protocol.
Table of Contents
Features
- Admin Role: Set policies and manage delegatees.
- Delegatee Role: Execute tools within policy constraints.
- Lit Action Tools: Deploy tools to IPFS for decentralized execution.
- Policy Management: Define and enforce tool usage policies for delegatees.
Prerequisites
Before you begin, ensure you have the following installed:
- Node.js (v16 or higher)
- pnpm (Package manager)
- A wallet (e.g., MetaMask) with a private key for authentication
- A Pinata API key for IPFS interactions
Installation
# Clone the repository
git clone https://github.com/your-username/agent-wallet-cli.git
cd agent-wallet-cli
# Install dependencies
pnpm install
# Build the project
pnpm build
Configuration
bash
CopyRename the .env.example file to .env
mv .env.example .envOpen the .env file and add your Pinata API key:
PINATA_API_KEY=your-pinata-api-keyUsage Starting the CLI bash Copy
pnpm start:cliThe CLI will deploy Lit Action tools to IPFS and display a wall of text confirming the deployment. Selecting a Lit Network
You will be prompted to select a Lit network:
? Select a Lit network: › - Use arrow-keys. Return to submit.
❯ Datil Dev - Development network
Datil Test
Datil
Datil Dev: For development purposes.
Datil Test: For testing environments.
Datil: For production use.If you're just getting started, choose Datil. You can obtain test tokens (tstLit) from the Chronicle Yellowstone Faucet. https://chronicle-yellowstone-faucet.getlit.dev/
Selecting Your Role
Next, select your role. If you are just gettig started, choose Admin: plaintext Copy
? Select your role: › - Use arrow-keys. Return to submit.
❯ Admin - Can set policies and manage delegatees
Delegatee - Can execute tools within policy constraintsAdmin Actions
If you choose the Admin role:
Enter your private key when prompted. This key remains local and is not shared.
Use the following actions:
Add Delegatee: Add a wallet address as a delegatee.
Permit Tool: Allow a tool to be used by delegatees.
Set Tool Policy: Define usage policies for delegatees.Delegatee Actions
If you choose the Delegatee role:
Restart the CLI by pressing ^C and running pnpm start:cli again.
Select Delegatee as your role.
Execute tools within the constraints set by the admin.