agentmail-cli
/install agentmail-cli
CLI for AgentMail — create inboxes, send messages, and read email.
API Key Setup
The API key MUST be configured before any command will work. Two methods:
- Config file (preferred for persistent agents):
agentmail config set-key YOUR_API_KEY
This stores the key at ~/.agentmail/config.json and persists across sessions.
- Environment variable:
export AGENTMAIL_API_KEY=YOUR_API_KEY
Verify configuration:
agentmail config show
If commands fail with auth errors, re-run agentmail config set-key — the env var alone may not persist between shell sessions.
Always Use --json
Always pass --json to every command for machine-readable output. Parse with jq when needed.
Inbox Commands
Create an inbox:
agentmail inbox create --json
agentmail inbox create --domain example.com --json
agentmail inbox create --username support --domain example.com --display-name "Support Team" --json
List inboxes:
agentmail inbox list --json
agentmail inbox list --limit 10 --json
Get inbox details:
agentmail inbox get \x3Cinbox-id> --json
Delete an inbox:
agentmail inbox delete \x3Cinbox-id>
Message Commands
Send a message:
agentmail message send --from \x3Cinbox-id> --to [email protected] --subject "Subject" --text "Body text" --json
Send with HTML:
agentmail message send --from \x3Cinbox-id> --to [email protected] --subject "Subject" --html "\x3Ch1>Hello\x3C/h1>" --json
Multiple recipients, CC, BCC:
agentmail message send --from \x3Cinbox-id> --to "[email protected],[email protected]" --cc "[email protected]" --bcc "[email protected]" --subject "Subject" --text "Body" --json
List messages in an inbox:
agentmail message list \x3Cinbox-id> --json
agentmail message list \x3Cinbox-id> --limit 20 --json
Get a specific message:
agentmail message get \x3Cinbox-id> \x3Cmessage-id> --json
Delete a message (deletes entire thread):
agentmail message delete \x3Cinbox-id> \x3Cmessage-id>
Common Workflow
# 1. Create inbox, capture ID
INBOX_ID=$(agentmail inbox create --json | jq -r '.inboxId')
# 2. Send email
agentmail message send --from "$INBOX_ID" --to [email protected] --subject "Hello" --text "Message body" --json
# 3. Check for replies
agentmail message list "$INBOX_ID" --json
Notes
- Get an API key at https://agentmail.to
- Config file location:
~/.agentmail/config.json - Env var
AGENTMAIL_API_KEYtakes precedence over config file - Deleting a message deletes the entire thread containing it
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install agentmail-cli - After installation, invoke the skill by name or use
/agentmail-cli - Provide required inputs per the skill's parameter spec and get structured output
What is agentmail-cli?
Manage email inboxes and messages via AgentMail API. Create disposable inboxes, send/receive emails, and list messages. Use when the agent needs to send or receive email, create temporary inboxes, or check for incoming messages. It is an AI Agent Skill for Claude Code / OpenClaw, with 1973 downloads so far.
How do I install agentmail-cli?
Run "/install agentmail-cli" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is agentmail-cli free?
Yes, agentmail-cli is completely free (open-source). You can download, install and use it at no cost.
Which platforms does agentmail-cli support?
agentmail-cli is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created agentmail-cli?
It is built and maintained by Stepan Arsentjev (@stepandel); the current version is v1.0.0.