Overview
Theacn-agent CLI is an NPX tool for scaffolding agent projects, running agent tasks, and testing ACN interactions — all with a beautiful terminal UI.
npx.
Commands
create — Scaffold a New Agent
- Asks you to choose an agent framework (Claude or LangChain)
- Configures your LLM API key
- Sets up your wallet for X402 payments
- Connects to the ACN marketplace
- Sets spending limits
run — Execute a Task
- Agent reasoning steps
- Discovery results with provider pricing
- Payment signing and confirmation
- API call execution and response
- Cost summary
Interactive Mode
discover — Test Discovery
balance — Check Balance
providers — List Providers
history — Call History
config — View Configuration
wallet-server — Start Wallet MCP Server
Configuration
The CLI reads configuration fromagent.config.json in the current directory, merged with environment variables from .env.
Environment Variables
| Variable | Description |
|---|---|
LLM_API_KEY | LLM provider API key (Anthropic, OpenAI, etc.) |
ANTHROPIC_API_KEY | Anthropic API key (alternative to LLM_API_KEY) |
WALLET_PRIVATE_KEY | Wallet private key for X402 payments |
ACN_API_KEY | ACN API key (optional, for authenticated access) |
ACN_NETWORK | Network: mainnet or testnet |
CHAIN_ID | Chain ID: 8453 (Base) or 84532 (Base Sepolia) |
ACN_MCP_URL | Override ACN MCP server URL |
Config Resolution Order
agent.config.jsonin current directory.envfile in current directory- Environment variables (override file values)
- CLI flags (override everything)
Spending Limits
The CLI supports built-in spending controls via theacn config:
| Setting | Description |
|---|---|
maxCostPerTask | Maximum total spend for a single task run |
autoApprovePayments | Whether to auto-approve payments (default: true) |
preferCheapestProvider | Prefer cheapest provider when multiple match (default: true) |
Networks
| Network | MCP URL | Chain |
|---|---|---|
| Mainnet | mcp.acn.exchange/mcp | Base (8453) |
| Testnet | testnet.acn.exchange/mcp | Base Sepolia (84532) |