agent-email-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Agent Email CLI

Agent Email CLI

Overview

概述

Use this skill to operate the
agent-email
command safely and predictably for agent workflows that need inbox access.
Prefer JSON-native command output and return key fields (
email
,
messageId
,
subject
,
createdAt
,
from.address
) in your summaries.
使用本skill安全、可预测地操作
agent-email
命令,满足需要收件箱访问能力的Agent工作流需求。
优先使用JSON原生命令输出,并在摘要中返回关键字段(
email
messageId
subject
createdAt
from.address
)。

Workflow

工作流程

  1. Verify CLI availability.
bash
command -v agent-email
agent-email --help
If missing, install:
bash
npm install -g @zaddy6/agentemail
  1. 验证CLI可用性。
bash
command -v agent-email
agent-email --help
如果未找到,请安装:
bash
npm install -g @zaddy6/agentemail

or

bun install -g @zaddy6/agentemail

2. Create a mailbox account.

```bash
agent-email create
Record these fields from JSON output:
  • data.email
  • data.accountId
  • data.activeEmail
Do not record, repeat, or print secret values such as mailbox passwords or tokens.
  1. Read latest messages.
bash
agent-email read <email|default>
For inbox waiting/polling:
bash
agent-email read <email|default> --wait 30 --interval 2
For full message payloads:
bash
agent-email read <email|default> --full
  1. Retrieve one message in detail.
bash
agent-email show <email|default> <messageId>
Use
show
when you need body/source details for verification links, codes, or full content extraction.
  1. Manage mailbox profiles.
bash
agent-email accounts list
agent-email use <email|default>
agent-email accounts remove <email>
Avoid commands that require entering secrets on the command line in agent logs.
  1. Delete processed/irrelevant message when requested.
bash
agent-email delete <email|default> <messageId>
bun install -g @zaddy6/agentemail

2. 创建邮箱账户。

```bash
agent-email create
从JSON输出中记录以下字段:
  • data.email
  • data.accountId
  • data.activeEmail
请勿记录、重复或打印邮箱密码、token等机密值。
  1. 读取最新消息。
bash
agent-email read <email|default>
如需收件箱等待/轮询:
bash
agent-email read <email|default> --wait 30 --interval 2
如需获取完整消息载荷:
bash
agent-email read <email|default> --full
  1. 获取单条消息的详细信息。
bash
agent-email show <email|default> <messageId>
当你需要获取正文/源详情以提取验证链接、验证码或完整内容时,请使用
show
命令。
  1. 管理邮箱配置。
bash
agent-email accounts list
agent-email use <email|default>
agent-email accounts remove <email>
避免使用需要在命令行输入机密信息的命令,以防出现在Agent日志中。
  1. 按需删除已处理/无关消息。
bash
agent-email delete <email|default> <messageId>

Operational Guidance

操作指南

  • Keep command output machine-readable; avoid forcing human output unless requested.
  • Prefer
    default
    alias when user does not specify an email.
  • Never echo, store, or summarize secret values (
    password
    ,
    token
    ) from command output.
  • If command fails, surface the JSON error
    code
    and
    hint
    fields directly.
  • For auth failures (
    AUTH_REQUIRED
    /401), rerun command once and request user intervention if credentials must be re-established.
  • For rate limits (
    RATE_LIMITED
    /429), retry after short delay.
  • 保持命令输出为机器可读格式,除非有要求,否则不要强制转为人类可读输出。
  • 当用户未指定邮箱时,优先使用
    default
    别名。
  • 永远不要回显、存储或摘要命令输出中的机密值(
    password
    token
    )。
  • 如果命令执行失败,直接展示JSON错误的
    code
    hint
    字段。
  • 对于认证失败(
    AUTH_REQUIRED
    /401),重试一次命令,如果需要重新建立凭证,则请求用户介入。
  • 对于速率限制(
    RATE_LIMITED
    /429),短暂延迟后重试。

Troubleshooting

故障排查

  • command not found
    : ensure
    ~/.bun/bin
    or npm global bin path is on
    PATH
    .
  • NO_ACTIVE_ACCOUNT
    : run
    agent-email create
    or
    agent-email use <email>
    .
  • ACCOUNT_NOT_FOUND
    : run
    agent-email accounts list
    and pick a valid address.
  • EOTP
    during npm publish: use npm trusted publishing for CI or publish locally with OTP.
  • command not found
    :确保
    ~/.bun/bin
    或npm全局bin路径已加入
    PATH
  • NO_ACTIVE_ACCOUNT
    :运行
    agent-email create
    agent-email use <email>
  • ACCOUNT_NOT_FOUND
    :运行
    agent-email accounts list
    并选择有效的地址。
  • npm发布时出现
    EOTP
    :在CI环境使用npm可信发布,或本地通过OTP发布。

References

参考资料

  • For command cheat sheet and JSON field map, read references/commands.md.
  • 如需命令速查表和JSON字段映射,请阅读references/commands.md