Agent Wallet
Self-custodial crypto wallet CLI for AI agents. Your keys, your coins — the agent never sees your mnemonic after init.
- - Open source: github.com/donald-jackson/agent-wallet-cli — audit before use
- npm package: npmjs.com/package/agent-wallet-cli
- Self-custodial: Keys encrypted locally with Argon2id + AES-256-GCM. No server, no third party.
- Session-based access: Agents use time-limited tokens, never your password directly.
- Multi-chain: Ethereum, Solana, Polygon, Arbitrum, Base — native coins and tokens.
Security Model
- 1. You create or import a wallet with a password → encrypted on disk in INLINECODE0
- You (or the agent) unlock with the password → get a time-limited session token (
wlt_...) - The agent uses only the session token — it expires automatically (default 1hr, max 24hr)
- No telemetry, no analytics, no server calls — only public blockchain RPCs for queries and transactions
Important: If you give the agent your WALLET_PASSWORD, it can perform any password-level operation (init, import, unlock, and export). For maximum security, unlock the wallet yourself and only give the agent the session token. Session tokens cannot export mnemonics or change passwords — they can only sign transactions and read balances.
Before trusting this skill with real funds:
- - Audit the source: github.com/donald-jackson/agent-wallet-cli
- Verify the npm package matches the repo: INLINECODE2
- Test with small amounts first
- Use short session durations (1hr default)
- Run in an isolated environment if possible
Setup
CODEBLOCK0
Verify installation: INLINECODE3
Workflow
- 1. Init (first time): INLINECODE4
- Displays mnemonic ONCE — save it securely
- 2. Import (existing wallet): INLINECODE5
- Unlock: INLINECODE6
- Returns session token (
wlt_...) valid for specified duration
- 4. Use: Pass
--token wlt_... to all commands (no password needed) - Lock:
agent-wallet-cli lock when done
Note: --password and --mnemonic can be omitted to be prompted securely via stdin (recommended for interactive use). When using in automation, --password is accepted but will show a warning about shell history visibility.
Global Options
All commands accept:
- -
--format json|text (default: json) - INLINECODE14 (default: ~/.agent-wallet-cli)
- INLINECODE15 — suppress output
- INLINECODE16 — wallet name (default: "default")
Commands
Wallet Management
CODEBLOCK1
Addresses & Balances
CODEBLOCK2
Important: --chain is required for balance/send/history. --token is the session token (wlt_...), --token-address is the coin/token contract or alias.
L2 networks: For Base, Polygon, Arbitrum use --chain ethereum --network base (etc). Default network is mainnet.
Transfers
CODEBLOCK3
- -
--yes: Skip confirmation prompt (required for non-TTY/agent use) --dry-run: Simulate transaction without sending--no-relay: Disable gasless relay fallback--network <network>: Target network (default: mainnet)
x402 Payments
CODEBLOCK4
Make HTTP requests with automatic x402 payment. The CLI detects 402 Payment Required responses, pays the requested amount in stablecoins, and retries.
- -
--max-amount <amount>: Maximum willing to pay (human-readable, e.g. "0.10") --dry-run: Show payment requirements without paying--yes: Skip payment confirmation--header: Repeatable for multiple headers--body: Request body, or @filepath to read from file
Approvals (ERC-20/SPL)
CODEBLOCK5
Signing
CODEBLOCK6
Transaction History
CODEBLOCK7
Network Configuration
CODEBLOCK8
Chains & Networks
| Chain | Networks |
|---|
| ethereum | mainnet, sepolia, polygon, arbitrum, base, base-sepolia |
| solana |
mainnet, devnet |
EVM L2s (Base, Polygon, Arbitrum) use --chain ethereum --network <l2name>.
--chain is required for balance, send, history, approve, allowance, transfer-from, approvals, and sign.
Token Aliases
Use shorthand instead of contract addresses: usdc, usdt, dai, weth, INLINECODE38
Security Notes
- - Self-custodial — keys never leave your machine, encrypted at rest
- No analytics, no telemetry, no network calls except to public RPCs for blockchain queries
- Session tokens grant temporary fund access — treat as passwords
- Always
--dry-run before large transfers - Lock wallet when done
- Never log or share session tokens or mnemonics
- Audit the source: github.com/donald-jackson/agent-wallet-cli
Agent Wallet
面向AI代理的自托管加密钱包命令行工具。你的密钥,你的币——初始化后代理永远不会看到你的助记词。
安全模型
- 1. 你使用密码创建或导入钱包 → 加密存储在 ~/.agent-wallet-cli/ 磁盘上
- 你(或代理)使用密码解锁 → 获取限时会话令牌(wlt_...)
- 代理仅使用会话令牌 — 它会自动过期(默认1小时,最长24小时)
- 无遥测、无分析、无服务器调用 — 仅用于查询和交易的公共区块链RPC
重要提示:如果你将钱包密码交给代理,它可以执行任何密码级别的操作(初始化、导入、解锁和导出)。为获得最大安全性,请自行解锁钱包,仅将会话令牌交给代理。会话令牌无法导出助记词或更改密码 — 它们只能签署交易和查询余额。
在信任此技能处理真实资金之前:
安装
bash
npm install -g agent-wallet-cli
验证安装:agent-wallet-cli --version
工作流程
- 1. 初始化(首次):agent-wallet-cli init --password $WALLET_PASSWORD
- 仅显示一次助记词 — 请安全保存
- 2. 导入(已有钱包):agent-wallet-cli import --password $WALLETPASSWORD --mnemonic word1 word2 ...
- 解锁:agent-wallet-cli unlock --password $WALLETPASSWORD --duration 3600
- 返回指定时长内有效的会话令牌(wlt_...)
- 4. 使用:向所有命令传递 --token wlt_...(无需密码)
- 锁定:完成后执行 agent-wallet-cli lock
注意: --password 和 --mnemonic 可以省略,通过stdin安全提示输入(推荐交互式使用)。在自动化中使用时,接受 --password 但会显示关于shell历史可见性的警告。
全局选项
所有命令均接受:
- - --format json|text(默认:json)
- --wallet-dir (默认:~/.agent-wallet-cli)
- --quiet — 抑制输出
- --name — 钱包名称(默认:default)
命令
钱包管理
bash
agent-wallet-cli init [--password
] [--word-count 12|24] [--name ]
agent-wallet-cli import [--password ] [--mnemonic ] [--name ]
agent-wallet-cli unlock [--password ] [--duration ] [--name ]
agent-wallet-cli lock [--name ]
agent-wallet-cli export [--password ] --confirm [--name ]
地址与余额
bash
agent-wallet-cli address --token [--chain ethereum|solana] [--account-index 0]
agent-wallet-cli balance --token --chain [--network ] [--token-address usdc]
重要提示: 查询余额/发送/历史记录时 必须 指定 --chain。--token 是会话令牌(wlt_...),--token-address 是币种/代币合约地址或别名。
L2网络: 对于Base、Polygon、Arbitrum,使用 --chain ethereum --network base(等)。默认网络为 mainnet。
转账
bash
原生币(ETH/SOL)
agent-wallet-cli send --token --chain --to --amount --yes [--dry-run] [--no-relay]
ERC-20/SPL代币
agent-wallet-cli send --token --chain --to --amount --token-address --yes [--no-relay]
- - --yes:跳过确认提示(非TTY/代理使用时必需)
- --dry-run:模拟交易但不发送
- --no-relay:禁用无gas中继回退
- --network :目标网络(默认:mainnet)
x402支付
bash
agent-wallet-cli x402 --token [--method GET] [--header Key:Value] [--body ] [--max-amount ] [--dry-run] [--yes]
发起带有自动x402支付的HTTP请求。CLI检测到402 Payment Required响应后,会支付请求的稳定币金额并重试。
- - --max-amount :愿意支付的最大金额(人类可读格式,如0.10)
- --dry-run:显示支付要求但不实际支付
- --yes:跳过支付确认
- --header:可重复使用以添加多个请求头
- --body:请求体,或使用 @filepath 从文件读取
授权(ERC-20/SPL)
bash
agent-wallet-cli approve --token --chain --token-address --spender --amount --yes [--network ]
agent-wallet-cli allowance --chain --token-address --owner --spender [--network ]
agent-wallet-cli transfer-from --token --chain --token-address --from --to --amount --yes [--network ]
agent-wallet-cli approvals --token [--chain ethereum] [--network mainnet] [--limit 20]
签名
bash
agent-wallet-cli sign --token --chain --message text
agent-wallet-cli sign --token --chain --typed-data
agent-wallet-cli sign --token --chain --data
交易历史
bash
agent-wallet-cli history --token --chain [--network mainnet] [--limit 10]
网络配置
bash
agent-wallet-cli networks # 列出所有网络
agent-wallet-cli networks --set ethereum:mainnet --rpc-url # 自定义RPC
agent-wallet-cli networks --reset ethereum:mainnet # 重置为默认
链与网络
| 链 | 网络 |
|---|
| ethereum | mainnet, sepolia, polygon, arbitrum, base, base-sepolia |
| solana |
mainnet, devnet |
EVM L2(Base、Polygon、Arbitrum)使用 --chain ethereum --network 。
查询余额、发送、历史记录、授权、额度、转账、授权列表和签名时 必须 指定 --chain。
代币别名
使用简写代替合约地址:usdc、usdt、dai、weth、wbtc
安全说明
- - 自托管 — 密钥从不离开你的机器,静态加密存储
- 无分析、无遥测、