CLI reference
@agensai/cli is the command-line interface for AGENSAI. It wraps @agensai/sdk with shell-friendly ergonomics, an encrypted local keystore, and a built-in MCP server.
Install
npm install -g @agensai/cliagensai --versionGlobal flags
| Flag | Purpose |
|---|---|
--chain <id> | Override active chain. Default: Base (8453). |
--profile <name> | Use a named profile. Default: default. |
--raw | Print hex output instead of resolved ENS. |
--json | Output JSON for piping. |
--quiet | Suppress status spinners. Errors still print. |
Commands
| Command | Purpose |
|---|---|
init | First-run setup. Saves API key, creates owner keystore. |
create | Provision a new named agent. |
ls | List your agents. |
show | Inspect a single agent. |
send | Send tokens from an agent. |
exec | Call an arbitrary contract method as an agent. |
policy | Manage policies on an agent. |
revoke | Permanently revoke an agent. |
mcp | Run the MCP server for AI editors. |
status | Show CLI and account health. |
config | Read or set CLI config keys. |
Where things live
- API key:
~/.agensai/config.toml - Owner keystore:
~/.agensai/agents/<profile>/keystore.json(mode 0600) - Logs:
~/.agensai/logs/
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Generic failure |
2 | Authentication error (bad API key, missing keystore) |
3 | Validation error (invalid policy, bad ENS name) |
4 | Onchain error (revert, insufficient gas, policy violation) |
5 | Network error |