agentmail-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAgentMail CLI
AgentMail CLI
Use the CLI to send and receive emails programmatically. Requires environment variable.
agentmailAGENTMAIL_API_KEY使用 CLI以编程方式发送和接收邮件。需要配置环境变量。
agentmailAGENTMAIL_API_KEYInstall
安装
bash
npm install -g agentmail-clibash
npm install -g agentmail-cliCore Commands
核心命令
Inboxes
收件箱
bash
undefinedbash
undefinedCreate 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>
undefinedagentmail inboxes delete --inbox-id <inbox_id>
undefinedSend Email
发送邮件
bash
undefinedbash
undefinedSend 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"
--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"
--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>"
--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>"
--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"
--text "Reply body"
agentmail inboxes:messages reply --inbox-id <inbox_id> --message-id <message_id>
--text "Reply body"
--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"
--to "someone@example.com"
undefinedagentmail inboxes:messages forward --inbox-id <inbox_id> --message-id <message_id>
--to "someone@example.com"
--to "someone@example.com"
undefinedRead Email
读取邮件
bash
undefinedbash
undefinedList 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>
undefinedagentmail inboxes:threads retrieve --inbox-id <inbox_id> --thread-id <thread_id>
undefinedDrafts
草稿
bash
undefinedbash
undefinedCreate a draft
Create a draft
agentmail inboxes:drafts create --inbox-id <inbox_id>
--to "recipient@example.com"
--subject "Draft"
--text "Draft body"
--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"
--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>
undefinedagentmail inboxes:drafts send --inbox-id <inbox_id> --draft-id <draft_id>
undefinedPods
Pod
Pods group inboxes together.
bash
undefinedPod用于将多个收件箱分组管理。
bash
undefinedCreate 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>
undefinedagentmail pods:threads list --pod-id <pod_id>
undefinedWebhooks
Webhook
bash
undefinedbash
undefinedCreate 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
undefinedagentmail webhooks list
undefinedDomains
域名
bash
undefinedbash
undefinedAdd 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>
undefinedagentmail domains get-zone-file --domain-id <domain_id>
undefinedGlobal Flags
全局标志
All commands support: , , , , .
--api-key--base-url--environment--format--debug所有命令均支持:、、、、。
--api-key--base-url--environment--format--debugOutput Formats
输出格式
Use to control output: (default), , , , , .
--formatjsonprettyyamljsonlrawexplore使用参数控制输出格式:(默认)、、、、、。
--formatjsonprettyyamljsonlrawexplore