email

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Email

邮件

Each autark user has their own AgentMail inbox provisioned at onboarding. All mail — sends, replies, inbox reads — goes through the
autark mail
CLI, which is already authenticated via
~/.autark/credentials.json
. Do not call
api.agentmail.to
directly. Do not use the
agentmail
npm CLI.
每个autark用户在入职时都会获得专属的AgentMail收件箱。所有邮件操作——发送、回复、读取收件箱——均通过
autark mail
CLI完成,该工具已通过
~/.autark/credentials.json
完成身份验证。请勿直接调用
api.agentmail.to
。请勿使用
agentmail
npm CLI。

Auth

身份验证

autark mail
reads the inbox token and address from
~/.autark/credentials.json
on every call. You do not need to set env vars or pass auth flags. If a command errors with
missing agentmail_token
, the user hasn't finished setup — run
autark mail setup --prefix <name>
once.
AGENTMAIL_API_KEY
/
AGENTMAIL_EMAIL
/
AGENTMAIL_INBOX_ID
are honored as overrides if set in the environment — useful only when running with a non-default inbox.
autark mail
每次调用时都会从
~/.autark/credentials.json
读取收件箱令牌和地址。无需设置环境变量或传递身份验证标志。如果命令报错
missing agentmail_token
,说明用户尚未完成设置——只需运行一次
autark mail setup --prefix <name>
即可。
如果环境中设置了
AGENTMAIL_API_KEY
/
AGENTMAIL_EMAIL
/
AGENTMAIL_INBOX_ID
,它们将作为覆盖值生效——仅在使用非默认收件箱时有用。

Plain text vs HTML — pick the right flag

纯文本 vs HTML——选择正确的参数

The CLI accepts both
--text
and
--html
, matching the AgentMail / Mailgun / SendGrid / Resend / Postmark convention.
  • --text @file
    — ships as
    text/plain
    . Recipient sees the bytes verbatim. Any HTML tags (
    <div>
    ,
    <p>
    ,
    <br>
    ,
    <a>
    , etc.) show up as literal text in the recipient's inbox.
  • --html @file
    — ships as
    text/html
    . Recipient's email client renders it as a styled email with real anchors, paragraph breaks, etc.
The rule for outreach signatures: if you put a link in the signature / footer of the email, the link must be embedded in the word (e.g. the name "kushal" is itself the clickable link), never a bare URL on its own line. A bare-URL signature is not the shape autark sends.
To get an embedded-link signature, you have to use
--html
--text
would render the
<a href>
markup as literal text in Gmail / Outlook. This is what broke on 2026-05-28: 6 cold emails went out with
<a href="https://autark.sh">kushal</a>
in
--text
, and every recipient saw the raw markup in their Gmail. See
autark/docs/email-html-in-text-incident.md
for the postmortem.
If your send doesn't have a signature link (signup verification, test pings, system messages), plain
--text
is fine.
该CLI支持
--text
--html
两种参数,与AgentMail / Mailgun / SendGrid / Resend / Postmark的约定一致。
  • --text @file
    — 以
    text/plain
    格式发送。收件人将看到原始内容。任何HTML标签(
    <div>
    <p>
    <br>
    <a>
    等)都会在收件人邮箱中显示为纯文本
  • --html @file
    — 以
    text/html
    格式发送。收件人的邮件客户端会将其渲染为带有真实链接、段落换行等样式的邮件。
客户开发签名规则: 如果在邮件签名/页脚中添加链接,该链接必须嵌入到文字中(例如,“kushal”这个名称本身就是可点击的链接),绝对不能单独一行放置裸URL。autark不使用裸URL签名格式。
要实现嵌入链接的签名,必须使用
--html
参数——如果使用
--text
<a href>
标记会在Gmail/Outlook中显示为纯文本。这正是2026-05-28出现的问题:6封开发邮件使用
--text
参数发送,其中包含
<a href="https://autark.sh">kushal</a>
,所有收件人在Gmail中都看到了原始标记。详情请查看
autark/docs/email-html-in-text-incident.md
中的事后分析。
如果发送的邮件没有签名链接(注册验证、测试通知、系统消息),使用纯
--text
参数即可。

Lint every draft before sending

发送前检查所有草稿

Run
autark mail lint
on every draft (sends and replies) before
autark mail send
:
sh
autark mail lint --body @draft.txt
Exit 0 = clean. Exit 1 = violations printed as JSON, each with a
rule
,
detail
, and
why
. Treat the output as feedback, not a gate. The rules catch common AI tells; they sometimes false-positive on a draft that's actually fine. Read each
why
, judge whether the rule applies to your specific message, fix the ones that land, override the ones that don't. The bar isn't "lint exit 0" — it's "would this email land as a real human note?"
Lint inspects content quality only — AI-tells, hedging, length, signature shape. It does not police markup mechanics (that's the convention above + your judgment). Lint the body you're about to ship: if you're sending
--html
, lint the html file; if you're sending
--text
, lint the text file. Lint reads prose either way.
What lint checks:
  • structure-word — AI-tell vocabulary in the body (
    structurally
    ,
    fundamentally
    ,
    specifically
    ,
    essentially
    ,
    the key insight
    ,
    that's exactly
    , etc.). Humans writing cold email don't reach for these. Describe the thing directly.
  • em-dash — any
    character. Strong AI tell in outbound. Use commas, periods, or new line breaks. (Override if the recipient's own writing uses them and you're mirroring tone.)
  • body-url — any URL outside a markdown
    [name](url)
    or HTML
    <a href>
    anchor. The product link belongs in the signature anchor; a bare URL mid-body reads as an A/B variant.
  • too-many-questions — more than one
    ?
    . Pick the single question that gives you the most signal. (Override fine for replies answering multiple direct asks.)
  • compound-question — "are you X or Y...?" patterns. Drop the
    or
    and pick the more specific half.
  • too-long — >400 chars before the signature (~4–6 short lines). Past that you're explaining, not asking.
  • no-anchor-sig — signature has no clickable name link. Without an
    <a href>
    /
    [name](url)
    in the sig, the recipient has no quick path to figure out who you are.
If most violations land and you can't write a clean draft after 2 rewrites: the issue is upstream of the regex. Re-read
~/.claude/skills/outreach/SKILL.md
and ask whether you should send at all.
在执行
autark mail send
之前,务必对所有草稿(发送和回复邮件)运行
autark mail lint
sh
autark mail lint --body @draft.txt
退出码0表示检查通过。退出码1表示存在违规,将以JSON格式输出,每条违规包含
rule
detail
why
字段。请将输出视为反馈而非强制要求。这些规则用于检测常见的AI生成痕迹;有时会对实际合格的草稿误报。请阅读每条
why
内容,判断该规则是否适用于你的特定消息,修复适用的问题,忽略不适用的规则。标准并非“lint退出码为0”,而是“这封邮件看起来像是真人写的吗?”
Lint仅检查内容质量——AI生成痕迹、措辞犹豫、长度、签名格式。它不会检查标记语法(这由上述约定和你的判断决定)。请对你即将发送的内容进行检查:如果使用
--html
发送,则检查HTML文件;如果使用
--text
发送,则检查文本文件。无论哪种格式,Lint都会读取文本内容。
Lint检查的内容:
  • structure-word — 正文中的AI生成特征词汇(
    structurally
    fundamentally
    specifically
    essentially
    the key insight
    that's exactly
    等)。真人写开发邮件不会使用这些词汇。请直接描述内容。
  • em-dash — 任何
    字符。这是 outbound 邮件中明显的AI生成痕迹。请使用逗号、句号或换行替代。(如果收件人自身写作风格使用该符号,且你需要匹配语气,则可以忽略该规则。)
  • body-url — 任何不在markdown
    [name](url)
    或HTML
    <a href>
    链接中的URL。产品链接应放在签名链接中;正文中的裸URL看起来像是A/B测试变体。
  • too-many-questions — 超过一个
    ?
    。请选择最能获取有效信息的单个问题。(如果是回复多个直接提问,则可以忽略该规则。)
  • compound-question — “are you X or Y...?”这类模式。请去掉
    or
    ,选择更具体的部分。
  • too-long — 签名前内容超过400字符(约4-6短行)。超过这个长度就变成解释而非询问了。
  • no-anchor-sig — 签名中没有可点击的名称链接。如果签名中没有
    <a href>
    /
    [name](url)
    ,收件人无法快速了解你的身份。
如果大部分违规都适用,且经过2次重写仍无法写出合格草稿:问题出在规则之外。请重新阅读
~/.claude/skills/outreach/SKILL.md
,并考虑是否应该发送这封邮件。

Send a message — cold outreach (html, embedded-link sig)

发送消息——客户开发(HTML格式,带嵌入链接签名)

sh
autark mail send \
  --to person@example.com \
  --subject "Subject" \
  --html @./body.html \
  --run-id $RUN_ID
body.html
:
html
<p>Hi Karl,</p>
<p>one sentence quoting them.</p>
<p>one sentence on what you built.</p>
<p>one specific question?</p>
<p>best,<br><a href="https://autark.sh">kushal</a></p>
Recipient sees a styled email with "kushal" as a clickable link to autark.sh. This is the default shape for any cold outreach send.
Always pass
--run-id
.
With it,
autark mail send
records the autark action itself (channel=email, recipient, thread_id, message_id, subject) so you don't need a separate
autark log action
. Without
--run-id
, the send still works but isn't tracked — only do that for non-outreach signups/login flows where there's no autark run.
Other flags:
--cc
,
--bcc
,
--reply-to
,
--label
,
--attachment
(each repeatable or comma-separated),
--dry-run
to print the payload without sending,
--title
to override the auto-generated action title.
Response is JSON with
message_id
,
thread_id
, and (when
--run-id
was passed)
autark_action_id
. Save it.
sh
autark mail send \
  --to person@example.com \
  --subject "Subject" \
  --html @./body.html \
  --run-id $RUN_ID
body.html
html
<p>Hi Karl,</p>
<p>one sentence quoting them.</p>
<p>one sentence on what you built.</p>
<p>one specific question?</p>
<p>best,<br><a href="https://autark.sh">kushal</a></p>
收件人将看到一封样式化的邮件,其中“kushal”是指向autark.sh的可点击链接。这是所有客户开发邮件的默认格式。
务必传递
--run-id
传递该参数后,
autark mail send
会自动记录autark操作本身(channel=email、收件人、thread_id、message_id、主题),因此你无需单独执行
autark log action
。如果不传递
--run-id
,邮件仍会发送,但操作不会被记录——仅在非客户开发的注册/登录流程(无autark运行)中才这样做。
其他标志:
--cc
--bcc
--reply-to
--label
--attachment
(可重复使用或用逗号分隔)、
--dry-run
用于打印负载但不发送、
--title
用于覆盖自动生成的操作标题。
返回结果为包含
message_id
thread_id
(若传递了
--run-id
则还包含
autark_action_id
)的JSON。请保存该结果。

Send a message — non-outreach (plain text, no link)

发送消息——非客户开发(纯文本格式,无链接)

For signup verifications, test pings, system messages, or any send where there is no signature link to worry about:
sh
autark mail send \
  --to verify@signup-form.test \
  --subject "Subject" \
  --text @./body.txt
Plain
--text
is fine here. No
--run-id
because there's no autark run.
对于注册验证、测试通知、系统消息或任何无需担心签名链接的邮件:
sh
autark mail send \
  --to verify@signup-form.test \
  --subject "Subject" \
  --text @./body.txt
此处使用纯
--text
参数即可。无需传递
--run-id
,因为没有autark运行。

Reply in a thread

回复线程中的邮件

sh
autark mail reply \
  --message-id "$MESSAGE_ID" \
  --html @./reply.html \
  --run-id $RUN_ID
Same shape rules: if your reply has a signature link, use
--html
. If you're answering a one-liner with a one-liner and no sig link,
--text
is fine.
$MESSAGE_ID
is the message id of the message you're replying to (the inbound one you got, or your own original send). It's what
mail send
/
mail message
/
mail thread
return.
Use
autark mail reply-all
to reply to all recipients, and
autark mail forward --message-id <id> --to <addr> [--html @body.html]
to forward.
sh
autark mail reply \
  --message-id "$MESSAGE_ID" \
  --html @./reply.html \
  --run-id $RUN_ID
格式规则相同:如果回复包含签名链接,请使用
--html
参数。如果仅用一句话回复一句话且无签名链接,使用
--text
参数即可。
$MESSAGE_ID
是你要回复的邮件ID(收到的邮件或你自己发送的原始邮件)。
mail send
/
mail message
/
mail thread
命令会返回该ID。
使用
autark mail reply-all
回复所有收件人,使用
autark mail forward --message-id <id> --to <addr> [--html @body.html]
转发邮件。

Read inbox

读取收件箱

sh
autark mail threads [--limit 30]               # list threads
autark mail thread <thread_id>                 # one thread + all messages
autark mail messages [--limit 30]              # flat message list
autark mail message <message_id>               # single message
autark mail raw <message_id>                   # full raw payload
autark mail attachment --message-id <id> --attachment-id <id> [--out file]
JSON output throughout. No auth flags — credentials are read from disk.
sh
autark mail threads [--limit 30]               # 列出邮件线程
autark mail thread <thread_id>                 # 查看单个线程及所有邮件
autark mail messages [--limit 30]              # 平铺显示邮件列表
autark mail message <message_id>               # 查看单封邮件
autark mail raw <message_id>                   # 查看完整原始负载
autark mail attachment --message-id <id> --attachment-id <id> [--out file]
所有输出均为JSON格式。无需身份验证标志——凭据会从磁盘读取。

Escape hatch

应急方案

If AgentMail ships a new endpoint that
autark mail
doesn't wrap yet:
sh
autark mail request GET /inboxes/$EMAIL/some/new/endpoint
autark mail request POST /inboxes/$EMAIL/foo --body @payload.json
Reuses the same authenticated session. Use this only when no wrapped command fits.
如果AgentMail推出了
autark mail
尚未封装的新端点:
sh
autark mail request GET /inboxes/$EMAIL/some/new/endpoint
autark mail request POST /inboxes/$EMAIL/foo --body @payload.json
该命令会复用已验证的会话。仅当没有合适的封装命令时才使用此方案。

Rules

规则

  • For any send whose signature contains a link, use
    --html
    so the link is embedded in the name. Bare-URL signatures are not the shape autark sends.
  • Plain
    --text
    is fine for sends without a signature link (signup verifications, system pings, test sends).
  • Lint every draft (sends and replies). Treat the output as feedback, override the rules that don't apply.
  • Pass
    --run-id
    on every outreach send/reply so the action lands in autark and the reply-state cron can detect engagement.
  • Do not guess email permutations from name + domain. Use the
    email-finder
    skill before first contact — verify the address through a concrete source (Apollo, GitHub commits, etc.).
  • If the contact is high value or the source is shaky, corroborate with a second signal.
  • If an address hard-bounces, suppress it and move on. Don't try nearby guesses.
  • If browser work is needed for signups, verification links, or Apollo research, use the
    chrome-relay
    skill.
  • The
    autark mail send
    response (or
    --dry-run
    payload) is the canonical record —
    message_id
    +
    thread_id
    are how you find replies later. If you passed
    --run-id
    , autark already stored them under the action.
  • 任何签名包含链接的邮件,请使用
    --html
    参数,确保链接嵌入到名称中。autark不使用裸URL签名格式。
  • 对于无签名链接的邮件(注册验证、系统通知、测试邮件),使用纯
    --text
    参数即可。
  • 检查所有草稿(发送和回复邮件)。将输出视为反馈,忽略不适用的规则。
  • 所有客户开发邮件的发送/回复均需传递
    --run-id
    ,以便操作记录到autark中,回复状态定时任务可检测互动情况。
  • 请勿通过姓名+域名猜测邮箱地址。首次联系前请使用
    email-finder
    技能——通过可靠来源(Apollo、GitHub提交等)验证地址。
  • 如果联系人价值较高或来源不可靠,请通过第二种信号进行确认。
  • 如果地址硬退信,请将其加入抑制列表并继续后续操作。请勿尝试相近的猜测地址。
  • 如果注册、验证链接或Apollo研究需要浏览器操作,请使用
    chrome-relay
    技能。
  • autark mail send
    的响应(或
    --dry-run
    负载)是权威记录——
    message_id
    +
    thread_id
    是你后续查找回复的依据。如果传递了
    --run-id
    ,autark已将其存储在操作记录中。