CLI Tool
Command-line interface for AgnicPay wallet operations
CLI Tool
The agnic CLI lets you manage your AgnicPay wallet, make payments, and trade tokens directly from the terminal. It's designed for AI agents, scripts, and developers who prefer the command line.
Installation
Or install globally:
Authentication
The CLI supports three authentication methods (in priority order):
--tokenflag — passed directly on each commandAGNIC_TOKENenv var — set in your shell environment- Stored token — saved locally via
agnic auth login
Login with Email OTP
Using Environment Variable
Using Token Flag
Logout
Commands
agnic status
Check authentication and wallet status.
agnic balance
Check USDC balance across networks.
agnic address
Show your wallet address.
agnic send
Send USDC to a wallet address.
Options:
--network <network>— Network (default: base)--memo <text>— Transaction memo
agnic trade
Trade/swap tokens on Base.
Options:
--slippage <percent>— Max slippage percentage (default: 1.0)--dry-run— Show quote without executing
agnic x402 search
Search for X402-enabled APIs.
Options:
--category <cat>— Filter by category (AI, Crypto, Data, Trading, Finance, Weather)--limit <n>— Max results (default: 10)
agnic x402 pay
Make an x402 payment request to an API.
Options:
--method <METHOD>— HTTP method (default: GET)--body <json>— Request body as JSON string
JSON Output
All commands support --json for machine-readable output:
Configuration
The CLI stores configuration at ~/.agnic/config.json:
File permissions are set to 0600 (owner-only read/write).