Skip to content

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/cli
agensai --version

Global flags

FlagPurpose
--chain <id>Override active chain. Default: Base (8453).
--profile <name>Use a named profile. Default: default.
--rawPrint hex output instead of resolved ENS.
--jsonOutput JSON for piping.
--quietSuppress status spinners. Errors still print.

Commands

CommandPurpose
initFirst-run setup. Saves API key, creates owner keystore.
createProvision a new named agent.
lsList your agents.
showInspect a single agent.
sendSend tokens from an agent.
execCall an arbitrary contract method as an agent.
policyManage policies on an agent.
revokePermanently revoke an agent.
mcpRun the MCP server for AI editors.
statusShow CLI and account health.
configRead 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

CodeMeaning
0Success
1Generic failure
2Authentication error (bad API key, missing keystore)
3Validation error (invalid policy, bad ENS name)
4Onchain error (revert, insufficient gas, policy violation)
5Network error