agentmail-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AgentMail CLI

AgentMail CLI

Use the
agentmail
CLI to send and receive emails programmatically. Requires
AGENTMAIL_API_KEY
environment variable.
使用
agentmail
CLI以编程方式发送和接收邮件。需要配置
AGENTMAIL_API_KEY
环境变量。

Install

安装

bash
npm install -g agentmail-cli
bash
npm install -g agentmail-cli

Core Commands

核心命令

Inboxes

收件箱

bash
undefined
bash
undefined

Create an inbox

Create an inbox

agentmail inboxes create --display-name "My Agent" --username myagent --domain example.com
agentmail inboxes create --display-name "My Agent" --username myagent --domain example.com

List inboxes

List inboxes

agentmail inboxes list
agentmail inboxes list

Get an inbox

Get an inbox

agentmail inboxes retrieve --inbox-id <inbox_id>
agentmail inboxes retrieve --inbox-id <inbox_id>

Delete an inbox

Delete an inbox

agentmail inboxes delete --inbox-id <inbox_id>
undefined
agentmail inboxes delete --inbox-id <inbox_id>
undefined

Send Email

发送邮件

bash
undefined
bash
undefined

Send a message from an inbox

Send a message from an inbox

agentmail inboxes:messages send --inbox-id <inbox_id>
--to "recipient@example.com"
--subject "Hello"
--text "Message body"
agentmail inboxes:messages send --inbox-id <inbox_id>
--to "recipient@example.com"
--subject "Hello"
--text "Message body"

Send with HTML

Send with HTML

agentmail inboxes:messages send --inbox-id <inbox_id>
--to "recipient@example.com"
--subject "Hello"
--html "<h1>Hello</h1>"
agentmail inboxes:messages send --inbox-id <inbox_id>
--to "recipient@example.com"
--subject "Hello"
--html "<h1>Hello</h1>"

Reply to a message

Reply to a message

agentmail inboxes:messages reply --inbox-id <inbox_id> --message-id <message_id>
--text "Reply body"
agentmail inboxes:messages reply --inbox-id <inbox_id> --message-id <message_id>
--text "Reply body"

Forward a message

Forward a message

agentmail inboxes:messages forward --inbox-id <inbox_id> --message-id <message_id>
--to "someone@example.com"
undefined
agentmail inboxes:messages forward --inbox-id <inbox_id> --message-id <message_id>
--to "someone@example.com"
undefined

Read Email

读取邮件

bash
undefined
bash
undefined

List messages in an inbox

List messages in an inbox

agentmail inboxes:messages list --inbox-id <inbox_id>
agentmail inboxes:messages list --inbox-id <inbox_id>

Get a specific message

Get a specific message

agentmail inboxes:messages retrieve --inbox-id <inbox_id> --message-id <message_id>
agentmail inboxes:messages retrieve --inbox-id <inbox_id> --message-id <message_id>

List threads

List threads

agentmail inboxes:threads list --inbox-id <inbox_id>
agentmail inboxes:threads list --inbox-id <inbox_id>

Get a thread

Get a thread

agentmail inboxes:threads retrieve --inbox-id <inbox_id> --thread-id <thread_id>
undefined
agentmail inboxes:threads retrieve --inbox-id <inbox_id> --thread-id <thread_id>
undefined

Drafts

草稿

bash
undefined
bash
undefined

Create a draft

Create a draft

agentmail inboxes:drafts create --inbox-id <inbox_id>
--to "recipient@example.com"
--subject "Draft"
--text "Draft body"
agentmail inboxes:drafts create --inbox-id <inbox_id>
--to "recipient@example.com"
--subject "Draft"
--text "Draft body"

Send a draft

Send a draft

agentmail inboxes:drafts send --inbox-id <inbox_id> --draft-id <draft_id>
undefined
agentmail inboxes:drafts send --inbox-id <inbox_id> --draft-id <draft_id>
undefined

Pods

Pod

Pods group inboxes together.
bash
undefined
Pod用于将多个收件箱分组管理。
bash
undefined

Create a pod

Create a pod

agentmail pods create --name "My Pod"
agentmail pods create --name "My Pod"

Create an inbox in a pod

Create an inbox in a pod

agentmail pods:inboxes create --pod-id <pod_id> --display-name "Pod Inbox"
agentmail pods:inboxes create --pod-id <pod_id> --display-name "Pod Inbox"

List threads in a pod

List threads in a pod

agentmail pods:threads list --pod-id <pod_id>
undefined
agentmail pods:threads list --pod-id <pod_id>
undefined

Webhooks

Webhook

bash
undefined
bash
undefined

Create a webhook for new messages

Create a webhook for new messages

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

List webhooks

List webhooks

agentmail webhooks list
undefined
agentmail webhooks list
undefined

Domains

域名

bash
undefined
bash
undefined

Add a custom domain

Add a custom domain

agentmail domains create --domain example.com --feedback-enabled false
agentmail domains create --domain example.com --feedback-enabled false

Verify domain DNS

Verify domain DNS

agentmail domains verify --domain-id <domain_id>
agentmail domains verify --domain-id <domain_id>

Get DNS records to configure

Get DNS records to configure

agentmail domains get-zone-file --domain-id <domain_id>
undefined
agentmail domains get-zone-file --domain-id <domain_id>
undefined

Global Flags

全局标志

All commands support:
--api-key
,
--base-url
,
--environment
,
--format
,
--debug
.
所有命令均支持:
--api-key
--base-url
--environment
--format
--debug

Output Formats

输出格式

Use
--format
to control output:
json
(default),
pretty
,
yaml
,
jsonl
,
raw
,
explore
.
使用
--format
参数控制输出格式:
json
(默认)、
pretty
yaml
jsonl
raw
explore