@privy-io/agent-wallet-cli
v0.2.1
Published
CLI for AI agents to create Privy wallets and transact
Maintainers
Keywords
Readme
@privy-io/agent-wallet-cli
CLI for AI agents to create Privy wallets and transact.
Installation
pnpm add -g @privy-io/agent-wallet-cliUsage
privy-agent-wallet login # Log in and provision a wallet
privy-agent-wallet logout # Log out and clear local session
privy-agent-wallet list-wallets # List your wallets
privy-agent-wallet rpc --json '<body>' # Send a wallet RPC request
privy-agent-wallet fund # Fund a wallet via onrampAuthentication
The CLI authenticates via a browser-based Privy login flow. Run privy-agent-wallet login to open a browser window, sign in, and paste the credentials blob back into the CLI. The session is stored in the system keychain (macOS/Linux) or ~/.privy/session.json.
privy-agent-wallet login
# Opens browser → sign in → paste credentials → session savedWallet operations
After logging in, the CLI can manage wallets and send transactions:
# List your wallets
privy-agent-wallet list-wallets
# Send a transaction (Ethereum)
privy-agent-wallet rpc --json '{"method": "eth_sendTransaction", "params": {"transaction": {"to": "0x...", "value": 1000000000000000, "chainId": 8453}}}'
# Sign a message
privy-agent-wallet rpc --json '{"method": "personal_sign", "params": {"message": "hello"}}'
# Fund a wallet
privy-agent-wallet fundGlobal options
| Flag | Description |
| ----------------- | ----------------------------- |
| --api-url <url> | Override the agent server URL |
| -V, --version | Print version |
| -h, --help | Print help |
The agent server URL can also be set via the PRIVY_AGENT_URL environment variable.
Local development
Build the CLI
# From the repo root
pnpm turbo run build --filter=@privy-io/agent-wallet-cliRun against a local agent server
Start the agent server (see apps/agent-server/SETUP.md), then use the --local flag:
node dist/index.js --local login
node dist/index.js --local list-walletsOr use the convenience script:
pnpm dev:local -- list-walletsWatch mode
Rebuild on file changes during development:
pnpm devType checking
pnpm check-typesSession storage
The CLI stores its session in the system keychain (macOS/Linux) with a file fallback at ~/.privy/session.json (0600 permissions). The session contains the signing keypair, wallet IDs, and addresses.
Run privy-agent-wallet logout to clear the session from both keychain and file.
Agent detection
The CLI automatically detects the calling environment (Cursor, Claude Code, terminal, etc.) and sends a privy-cli-client header to the agent server for analytics. This is based on environment variable sniffing and requires no configuration.
