Agentmail Cli

agentmail-to/agentmail-skills/agentmail-cli

作者 agentmail-tocde357ff31d4無授權條款23 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫2 天前更新

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.

僅含說明Communication
AI 產生的概覽

透過官方 CLI 在命令列中操作 AgentMail 的收件匣、郵件、草稿、Pod、Webhook 和網域。

功能
提供官方 AgentMail CLI 的命令列操作說明,涵蓋安裝、API 金鑰設定以及各類資源命令。內容包括列出和建立收件匣,讀取、搜尋、傳送、回覆和轉寄郵件,管理草稿、Pod、Webhook 和網域,以及全域旗標和輸出格式。產出的是 shell 命令和 JSON、JSONL、YAML 或原始格式的結構化輸出,而非 SDK 程式碼。
適用情境
當使用者需要針對 AgentMail 收件匣、郵件、草稿、Pod、Webhook 或網域操作的 shell 命令,或需要腳本化的 JSON/YAML 輸出時使用。不適用於 SDK 程式碼、MCP 設定或框架轉接器。
執行需求
需要透過 npm 全域安裝 agentmail-cli 套件,具備 Node.js/npm 執行環境,並透過 AGENTMAIL_API_KEY 環境變數或 --api-key 旗標提供 AgentMail API 金鑰。需要存取 AgentMail API 的網路連線。不附帶腳本,僅為說明文件。

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.

來源與署名

來源:agentmail-to/agentmail-skills位於agentmail-cli提交cde357f

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架