Agentmail Cli

by agentmail-tocde357ff31d4No license23 starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated 2 days ago

Operate AgentMail from a shell with the official CLI. Use when the user wants commands for listing or creating inboxes, reading or searching mail, sending or replying, managing drafts, or scripting JSON/YAML output; do not use for SDK code, MCP setup, or framework adapters.

Instructions onlyCommunication
AI-generated overview

Operate AgentMail from a shell using the official CLI for inboxes, messages, drafts, pods, webhooks and domains.

What it does
Provides command-line instructions for the official AgentMail CLI, covering installation, API key setup, and resource commands. It documents listing and creating inboxes, reading, searching, sending, replying to and forwarding messages, managing drafts, pods, webhooks and domains, plus global flags and output formats. It produces shell commands and structured JSON, JSONL, YAML or raw output rather than SDK code.
When to use it
Use it when the user wants shell commands for AgentMail inbox, message, draft, pod, webhook or domain operations, or wants scripted JSON/YAML output. It is not intended for SDK code, MCP setup or framework adapters.
Requirements
Requires the agentmail-cli package installed globally via npm, a Node.js/npm runtime, and an AgentMail API key supplied through the AGENTMAIL_API_KEY environment variable or the --api-key flag. Network access to the AgentMail API is needed. It ships no scripts; it is instructions only.

AgentMail CLI

Install the CLI and provide the API key through the environment.

bash
npm install -g agentmail-cliexport AGENTMAIL_API_KEY="am_..."

A resource nested under another is a nested subcommand, e.g. inboxes messages, inboxes threads, pods inboxes, pods threads (CLI 1.x; the colon form inboxes:messages is rejected). Run agentmail <resource> --help to list what a resource supports.

Inboxes

bash
agentmail inboxes listagentmail inboxes get --inbox-id <inbox_id>agentmail inboxes create --display-name "Support Agent" --username supportagentmail inboxes delete --inbox-id <inbox_id>

Confirm the exact inbox before running the destructive delete command.

Messages and threads

bash
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 "[email protected]" \  --subject "Hello" \  --text "Message body"
# HTML body instead of plain textagentmail inboxes messages send --inbox-id <inbox_id> \  --to "[email protected]" \  --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 "[email protected]"
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.

Drafts

bash
agentmail inboxes drafts create --inbox-id <inbox_id> \  --to "[email protected]" \  --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

Pods group inboxes together.

bash
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>

Webhooks

bash
agentmail webhooks create --url "https://example.com/webhook" --event-type message.receivedagentmail webhooks list

Domains

bash
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>

Global flags

FlagPurpose
--api-keyOverride AGENTMAIL_API_KEY for this call
--base-urlPoint at a non-default API host
--environmentSelect a named environment
--formatOutput format (see below)
--format-errorControl structured error output
--transformGJSON projection of a successful response
--transform-errorGJSON projection of an error response
--debugVerbose request/response logging

Output formats

--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.

Source and attribution

Source:agentmail-to/agentmail-skillsinagentmail-cliat commitcde357f

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal

Agentmail Cli Agent Skill | SourceWeft