Skip to main content

What is the Mandate CLI?

The Mandate CLI (@mandate.md/cli) is a command-line tool for managing agent wallets, validating transactions against your policies, and scanning codebases for unprotected financial calls. It wraps the Mandate API into 9 commands that cover the full agent lifecycle: registration, activation, validation, broadcasting, and monitoring.

Install

Run any command directly with npx:
npx @mandate.md/cli <command>
Or install globally:
bun add -g @mandate.md/cli
After global install, use mandate directly:
mandate validate --action transfer --amount 10 --to 0xRecipientAddress --token USDC --reason "Invoice #42"

Commands

CommandAuth RequiredDescription
loginNoRegister a new agent, get a runtime key
activateYesSet wallet address after registration
whoamiYesShow current agent info and credentials
validateYesValidate a transaction against your policy
transferYesValidate an ERC20 transfer
eventYesPost a txHash after broadcast
statusYesCheck an intent’s current state
approveYesWait for human approval on a pending intent
scanNoScan codebase for unprotected wallet calls

Credential storage

The login command saves your runtime key and agent metadata to ~/.mandate/credentials.json. All authenticated commands read from this file automatically.
{
  "runtimeKey": "mndt_test_abc123...",
  "agentId": "a1b2c3d4-...",
  "claimUrl": "https://app.mandate.md/claim/...",
  "evmAddress": "0x...",
  "chainId": 84532,
  "baseUrl": "https://app.mandate.md"
}
The file is created with 0600 permissions (owner-only read/write). If you need to switch agents, delete the file and run login again.
Never commit ~/.mandate/credentials.json to version control. The runtime key grants full agent access to the Mandate API.

Agent discovery

AI agents can discover CLI commands programmatically using two flags:
npx @mandate.md/cli --llms          # Machine-readable command manifest
npx @mandate.md/cli --llms-full     # Full manifest with option schemas
Each response includes a next field pointing to the logical next step, so agents can chain commands without hardcoded workflows.

MCP server mode

Start the CLI as an MCP stdio server for integration with tools like Claude Code:
npx @mandate.md/cli --mcp
This exposes all CLI commands as MCP tools over standard input/output.

Next Steps

Register an Agent

Create your first agent and get a runtime key.

Validate a Transaction

Run your first policy check from the command line.

Scan Your Codebase

Find unprotected wallet calls before they reach production.