
This gives Claude command-line control over AgentMail's programmable email service. You get the full suite: create inboxes on the fly, send and receive messages, manage threads and drafts, set up webhooks for incoming mail, and even configure custom domains if you've verified them. The pod system lets you group related inboxes together, which is handy for multi-agent setups. It's built for agents that need real email addresses to interact with external services or users, not just API calls pretending to be email. Requires an API key and the npm package installed globally. Output formatting is flexible with JSON, YAML, or pretty-printed options.
npx -y skills add agentmail-to/agentmail-skills --skill agentmail-cli --agent claude-codeInstalls into .claude/skills of the current project.
Install the CLI and provide the API key through the environment.
npm install -g agentmail-cli
export AGENTMAIL_API_KEY="am_..."
Subcommands for a resource nested under another use a colon, e.g. inboxes:messages, inboxes:threads, pods:inboxes, pods:threads.
agentmail inboxes list
agentmail inboxes get --inbox-id <inbox_id>
agentmail inboxes create --display-name "Support Agent" --username support
agentmail inboxes delete --inbox-id <inbox_id>
Confirm the exact inbox before running the destructive delete command.
agentmail inboxes:messages list --inbox-id <inbox_id>
agentmail inboxes:messages get --inbox-id <inbox_id> --message-id <message_id>
agentmail inboxes:messages send --inbox-id <inbox_id> \
--to "recipient@example.com" \
--subject "Hello" \
--text "Message body"
# HTML body instead of plain text
agentmail inboxes:messages send --inbox-id <inbox_id> \
--to "recipient@example.com" \
--subject "Hello" \
--html "<h1>Hello</h1>"
agentmail inboxes:messages reply --inbox-id <inbox_id> \
--message-id <message_id> \
--text "Reply body"
agentmail inboxes:messages forward --inbox-id <inbox_id> \
--message-id <message_id> \
--to "someone@example.com"
agentmail inboxes:threads list --inbox-id <inbox_id>
agentmail inboxes:threads get --inbox-id <inbox_id> --thread-id <thread_id>
Use a message ID for replies. Fetch the full message before relying on body content.
agentmail inboxes:drafts create --inbox-id <inbox_id> \
--to "recipient@example.com" \
--subject "Pending approval" \
--text "Draft body"
agentmail inboxes:drafts list --inbox-id <inbox_id>
agentmail inboxes:drafts get --inbox-id <inbox_id> --draft-id <draft_id>
agentmail inboxes:drafts send --inbox-id <inbox_id> --draft-id <draft_id>
Pods group inboxes together.
agentmail pods create --name "My Pod"
agentmail pods list
agentmail pods:inboxes create --pod-id <pod_id> --display-name "Pod Inbox"
agentmail pods:inboxes list --pod-id <pod_id>
agentmail pods:threads list --pod-id <pod_id>
agentmail pods:threads get --pod-id <pod_id> --thread-id <thread_id>
agentmail webhooks create --url "https://example.com/webhook" --event-type message.received
agentmail webhooks list
agentmail domains create --domain example.com
# Optional: route bounce/complaint notifications to your inboxes.
agentmail domains create --domain example.com --feedback-enabled
agentmail domains verify --domain-id <domain_id>
agentmail domains get-zone-file --domain-id <domain_id>
| Flag | Purpose |
|---|---|
--api-key | Override AGENTMAIL_API_KEY for this call |
--base-url | Point at a non-default API host |
--environment | Select a named environment |
--format | Output format (see below) |
--format-error | Control structured error output |
--transform | GJSON projection of a successful response |
--transform-error | GJSON projection of an error response |
--debug | Verbose request/response logging |
--format accepts: auto (default), pretty, json, jsonl, yaml, raw, explore.
Run agentmail --help and the relevant resource's --help before using an administrative command not covered here.