CLI
Getting started
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.
Installation
Install with npm:
Authentication
Set your API key as an environment variable:
Or pass it directly with the --api-key flag. Get your key from the AgentMail Console.
Usage
Commands follow the pattern:
Resources can also use colon syntax for subresources:
Use --help on any command for details.
Examples
Features
The CLI provides commands for:
- Inbox management: Create, list, update, and delete inboxes
- Message operations: Send, reply, forward, and retrieve emails
- Thread management: List and manage email threads
- Drafts: Create, update, send, and delete drafts
- Webhooks: Create and manage webhook endpoints
- Domains: Add and verify custom domains
- Pods: Manage pod resources and their inboxes
- API keys: Create and manage API keys
Global flags
Output formats
Control how results are displayed with the --format flag:
json— JSON output (default)yaml— YAML outputpretty— Human-readable formatted outputraw— Raw API responseexplore— Interactive explorer
You can also use --transform with GJSON syntax to query and filter output data.
AI skill
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.
