The AgentMail CLI lets you interact with the AgentMail API directly from your terminal. Create inboxes, send messages, manage threads, and more — all without writing code.
Install with npm:
Set your API key as an environment variable:
Or pass it directly with the --api-key flag. Get your key from the AgentMail Console.
Commands follow the pattern:
Resources can also use colon syntax for subresources:
Use --help on any command for details.
The CLI provides commands for:
Control how results are displayed with the --format flag:
json — JSON output (default)yaml — YAML outputpretty — Human-readable formatted outputraw — Raw API responseexplore — Interactive explorerYou can also use --transform with GJSON syntax to query and filter output data.
The CLI is also available as an AgentSkills skill, allowing AI coding assistants to use it on your behalf. Install it with:
This works with any compatible tool, including OpenClaw, Claude Code, Cursor, and Codex. See the Skills page for more details.