
Agentmail Cli
Wire AgentMail inboxes and send/receive email from coding agents or automation scripts without building SMTP yourself.
Overview
Agentmail-cli is an agent skill for the Build phase that documents how to manage AgentMail inboxes, messages, threads, drafts, webhooks, and domains via the agentmail CLI.
Install
npx skills add https://github.com/agentmail-to/agentmail-skills --skill agentmail-cliWhat is this skill?
- Global npm install: agentmail-cli with AGENTMAIL_API_KEY required
- Inbox lifecycle: create, list, retrieve, delete with display name and optional custom domain
- Send plain-text or HTML; reply and forward by message id from any inbox
- Read path: list and retrieve messages; SKILL.md also covers threads, drafts, webhooks, and domains
- Command-line surface for agents that must operate email without a custom mail stack
- Install via npm install -g agentmail-cli
- Requires AGENTMAIL_API_KEY environment variable
- Core CLI areas include inboxes, send/reply/forward messages, and read/list message flows
Adoption & trust: 896 installs on skills.sh; 15 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need your agent or app to send and receive real email with inboxes and threads, but you do not want to wire raw SMTP or guess API endpoints from scratch.
Who is it for?
Indie builders adding agent-driven email (notifications, inbox agents, lightweight support) who already use Node/npm and are fine storing AGENTMAIL_API_KEY in the environment.
Skip if: Teams that only need a one-time manual email, want full marketing automation suites, or cannot allow network/API access from the agent shell.
When should I use this skill?
Agents need to manage inboxes, send or receive email, handle threads, drafts, webhooks, and domains via the AgentMail command line.
What do I get? / Deliverables
Your agent can create inboxes, send HTML or text, read and thread messages, and configure AgentMail resources using documented CLI commands with a single API key.
- Created or managed AgentMail inboxes
- Sent, replied, or forwarded messages with text or HTML bodies
- Retrieved message lists or single messages for downstream agent logic
Recommended Skills
Journey fit
Programmatic email is a product integration step—creating inboxes, sending messages, and hooking webhooks—typically done while building the app or agent backend. The skill documents CLI calls against the AgentMail HTTP API (inboxes, messages, threads, domains), which maps directly to third-party service integration work.
How it compares
Use as a focused AgentMail CLI integration guide—not a generic transactional-email MCP server or an email copywriting workflow.
Common Questions / FAQ
Who is agentmail-cli for?
Solo builders and small teams shipping AI agents or backends that must own inboxes and programmatic send/receive through AgentMail from the terminal.
When should I use agentmail-cli?
During Build integrations when wiring outbound alerts or inbound mail, and in Operate when agents poll inboxes or fire webhooks; also in Grow support flows where scripted replies matter.
Is agentmail-cli safe to install?
Review the Security Audits panel on this Prism page before installing; the skill expects a live API key and network calls, so scope secrets and agent permissions deliberately.
SKILL.md
READMESKILL.md - Agentmail Cli
# AgentMail CLI Use the `agentmail` CLI to send and receive emails programmatically. Requires `AGENTMAIL_API_KEY` environment variable. ## Install ```bash npm install -g agentmail-cli ``` ## Core Commands ### Inboxes ```bash # Create an inbox (defaults to @agentmail.to; # pass --domain only if you have verified a custom domain) agentmail inboxes create --display-name "My Agent" --username myagent # List inboxes agentmail inboxes list # Get an inbox agentmail inboxes retrieve --inbox-id <inbox_id> # Delete an inbox agentmail inboxes delete --inbox-id <inbox_id> ``` ### Send Email ```bash # Send a message from an inbox agentmail inboxes:messages send --inbox-id <inbox_id> \ --to "recipient@example.com" \ --subject "Hello" \ --text "Message body" # Send with HTML agentmail inboxes:messages send --inbox-id <inbox_id> \ --to "recipient@example.com" \ --subject "Hello" \ --html "<h1>Hello</h1>" # Reply to a message agentmail inboxes:messages reply --inbox-id <inbox_id> --message-id <message_id> \ --text "Reply body" # Forward a message agentmail inboxes:messages forward --inbox-id <inbox_id> --message-id <message_id> \ --to "someone@example.com" ``` ### Read Email ```bash # List messages in an inbox agentmail inboxes:messages list --inbox-id <inbox_id> # Get a specific message agentmail inboxes:messages retrieve --inbox-id <inbox_id> --message-id <message_id> # List threads agentmail inboxes:threads list --inbox-id <inbox_id> # Get a thread agentmail inboxes:threads retrieve --inbox-id <inbox_id> --thread-id <thread_id> ``` ### Drafts ```bash # Create a draft agentmail inboxes:drafts create --inbox-id <inbox_id> \ --to "recipient@example.com" \ --subject "Draft" \ --text "Draft body" # Send a draft agentmail inboxes:drafts send --inbox-id <inbox_id> --draft-id <draft_id> ``` ### Pods Pods group inboxes together. ```bash # Create a pod agentmail pods create --name "My Pod" # Create an inbox in a pod agentmail pods:inboxes create --pod-id <pod_id> --display-name "Pod Inbox" # List threads in a pod agentmail pods:threads list --pod-id <pod_id> ``` ### Webhooks ```bash # Create a webhook for new messages agentmail webhooks create --url "https://example.com/webhook" --event-type message.received # List webhooks agentmail webhooks list ``` ### Domains ```bash # Add a custom domain. --feedback-enabled is REQUIRED: # pass the flag to route bounce/complaint notifications to your inboxes. # The CLI has no way to create a domain without this flag. agentmail domains create --domain example.com --feedback-enabled # Verify domain DNS agentmail domains verify --domain-id <domain_id> # Get DNS records to configure agentmail domains get-zone-file --domain-id <domain_id> ``` ## Global Flags All commands support: `--api-key`, `--base-url`, `--environment`, `--format`, `--format-error`, `--transform`, `--transform-error`, `--debug`. ## Output Formats Use `--format` to control output: `auto` (default), `pretty`, `json`, `jsonl`, `yaml`, `raw`, `explore`.