resend-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseResend CLI
Resend CLI
This skill is for agents that should operate Resend through the official CLI first, not by
dropping straight to raw REST.
The goal is not just “know the commands”. The goal is to make an agent:
- choose the right Resend primitive,
- choose the right CLI command,
- run it in a deterministic non-interactive way,
- detect the important CLI coverage gaps before it gets stuck, and
- fall back to MCP/API only when the CLI genuinely does not cover the job.
此技能适用于应优先通过官方CLI操作Resend的Agent,而非直接使用原生REST接口。
目标不仅是“了解命令”,而是让Agent能够:
- 选择合适的Resend原语,
- 选择合适的CLI命令,
- 以确定性的非交互方式运行命令,
- 在陷入困境前发现重要的CLI覆盖缺口,
- 仅当CLI确实无法完成任务时,才回退到MCP/API。
Start here
入门指南
Load only the files that match the task:
- — the default decision process for live Resend work
references/agent-operating-model.md - — install methods, auth priority, profiles, config paths
references/install-auth-and-profiles.md - — how agents should invoke
references/subprocess-contract.mdsafely and parse outputresend - — fast routing from user intent to the right command(s)
references/command-selection.md - — transactional sends, schedules, tags, attachments, batch limits
references/sending-scheduling-and-batch.md - — domain creation, verification, receiving, TLS, tracking, 403/domain mismatch
references/domains-dns-and-deliverability.md - — webhook creation, update, signature handling, temporary local listeners
references/webhooks-and-listeners.md - — inbound list/get/attachments/forward/listen flows
references/inbound-receiving-and-threading.md - — subscription modelling, targeting, campaigns
references/contacts-topics-segments-and-broadcasts.md - — template lifecycle and the important current CLI gaps
references/templates-and-coverage-gaps.md - — debug order, CLI quirks, when to fall back to MCP/API
references/diagnostics-and-fallbacks.md - — short end-to-end playbooks
references/recipes.md - — first-party source manifest and refresh notes
references/sources.md
Machine-readable assets:
- — command index with detail levels (
assets/command-catalog.json,source_inspected,readme_confirmed)tree_confirmed - — route common tasks to command sequences
assets/task-router.json - — fast-fail diagnosis hints
assets/error-map.json - — current CLI limitations and ambiguities that matter to agents
assets/coverage-gaps.json - — deterministic invocation defaults
assets/subprocess-contract.json - — reusable command/file scaffolds
assets/scaffold-index.json - — authoritative URLs used to build this skill
assets/source-manifest.json
Bundled helper:
- — agent wrapper for probing, routing, scaffolding, batch linting, diagnosis, and safe subprocess execution
scripts/resend_cli.py
仅加载与任务匹配的文件:
- —— 实时Resend工作的默认决策流程
references/agent-operating-model.md - —— 安装方法、认证优先级、配置文件、配置路径
references/install-auth-and-profiles.md - —— Agent应如何安全调用
references/subprocess-contract.md并解析输出resend - —— 将用户意图快速路由到正确命令的方法
references/command-selection.md - —— 事务性发送、调度、标签、附件、批量限制
references/sending-scheduling-and-batch.md - —— 域名创建、验证、收件、TLS、追踪、403/域名不匹配问题
references/domains-dns-and-deliverability.md - —— Webhook创建、更新、签名处理、临时本地监听器
references/webhooks-and-listeners.md - —— 收件列表/获取/附件/转发/监听流程
references/inbound-receiving-and-threading.md - —— 订阅建模、目标定位、营销活动
references/contacts-topics-segments-and-broadcasts.md - —— 模板生命周期及当前重要的CLI缺口
references/templates-and-coverage-gaps.md - —— 调试顺序、CLI特性、何时回退到MCP/API
references/diagnostics-and-fallbacks.md - —— 简短的端到端操作手册
references/recipes.md - —— 第一方源清单及更新说明
references/sources.md
机器可读资源:
- —— 带详细级别标记的命令索引(
assets/command-catalog.json、source_inspected、readme_confirmed)tree_confirmed - —— 将常见任务路由到命令序列
assets/task-router.json - —— 快速故障诊断提示
assets/error-map.json - —— 当前对Agent重要的CLI限制与歧义
assets/coverage-gaps.json - —— 确定性调用默认值
assets/subprocess-contract.json - —— 可复用的命令/文件脚手架
assets/scaffold-index.json - —— 用于构建此技能的权威URL
assets/source-manifest.json
捆绑助手:
- —— 用于探测、路由、脚手架搭建、批量检查、诊断及安全子进程执行的Agent封装器
scripts/resend_cli.py
Core operating rules
核心操作规则
1) Prefer the official CLI for live Resend work
1) 实时Resend工作优先使用官方CLI
Default order of preference:
- Official Resend CLI for live terminal/CI/agent operations
- Official Resend MCP server if the environment already exposes it and the CLI is unavailable
- Official SDK when editing app code inside an existing integration
- Raw REST only for stack-neutral examples, protocol debugging, or feature gaps
Do not choose raw REST just because it is familiar.
默认优先级顺序:
- 官方Resend CLI 用于实时终端/CI/Agent操作
- 官方Resend MCP服务器(若环境已暴露且CLI不可用)
- 官方SDK(在现有集成中编辑应用代码时)
- 原生REST 仅用于栈中立示例、协议调试或功能缺口
不要仅因为熟悉就选择原生REST。
2) For agents, stay non-interactive by default
2) 对于Agent,默认保持非交互模式
For bounded commands:
- pass all required flags explicitly
- use global
--json -q - prefer or a stored profile over typing secrets interactively
RESEND_API_KEY - set for deterministic output
RESEND_NO_UPDATE_NOTIFIER=1 - capture both stdout and stderr defensively
对于有限命令:
- 显式传递所有必需的标志
- 使用全局参数
--json -q - 优先使用或存储的配置文件,而非交互式输入密钥
RESEND_API_KEY - 设置以获得确定性输出
RESEND_NO_UPDATE_NOTIFIER=1 - 防御性地捕获标准输出和标准错误
3) Run doctor
early when the environment is unknown
doctor3) 环境未知时尽早运行doctor
命令
doctorWhen you do not know whether the CLI is installed, authenticated, or pointed at the right account:
bash
resend --json -q doctorThis is usually the fastest first read on:
- CLI availability/version
- whether an API key is being resolved
- whether verified domains exist
- whether the machine looks like an AI-agent environment
当你不确定CLI是否已安装、认证或指向正确账户时:
bash
resend --json -q doctor这通常是最快了解以下信息的第一步:
- CLI可用性/版本
- 是否已解析API密钥
- 是否存在已验证的域名
- 机器是否看起来像AI-Agent环境
4) Choose the primitive before the command
4) 先选择原语,再选择命令
- One logical transactional email →
emails send - Up to 100 distinct transactional emails in one request →
emails batch - Scheduled transactional email mutation → /
emails updateemails cancel - Campaign to a segment → /
broadcasts createbroadcasts send - Reusable hosted content →
templates * - Sender or receiving setup →
domains * - Inbound processing → +
emails receiving *webhooks * - Scoped credentials →
api-keys * - Recipient data and preferences → ,
contacts,contact-properties,topicssegments - Local dev event loop → or
webhooks listenemails receiving listen
- 单封逻辑事务性邮件 →
emails send - 一次请求中最多100封不同的事务性邮件 →
emails batch - 调度事务性邮件修改 → /
emails updateemails cancel - 针对细分群体的营销活动 → /
broadcasts createbroadcasts send - 可复用的托管内容 →
templates * - 发件人或收件设置 →
domains * - 收件处理 → +
emails receiving *webhooks * - 限定范围的凭据 →
api-keys * - 收件人数据与偏好 → 、
contacts、contact-properties、topicssegments - 本地开发事件循环 → 或
webhooks listenemails receiving listen
5) Know the current CLI gaps
5) 了解当前CLI的缺口
This version of the skill treats these as especially important:
- Template send gap: the CLI manages templates, but the current command surface does not expose a direct
emails send/template-vars flow.--template-id - Domain capability update gap: exposes TLS/open/click tracking, but not an explicit sending/receiving capability toggle, while inbound help text references such a toggle.
domains update - Stream commands are special: and
webhooks listenare long-running and should be treated as NDJSON/event streams in agent mode.emails receiving listen - JSON error channel discrepancy: the README promises machine JSON on stdout only, but the current source writes JSON errors with , so wrappers must parse stderr too.
console.error
此版本技能特别关注以下缺口:
- 模板发送缺口:CLI可管理模板,但当前命令未暴露直接的
emails send/模板变量流程。--template-id - 域名能力更新缺口:支持TLS/打开/点击追踪,但未提供显式的发送/接收能力切换,而收件帮助文本提及了此类切换。
domains update - 流命令特殊处理:和
webhooks listen是长期运行的命令,在Agent模式下应视为NDJSON/事件流。emails receiving listen - JSON错误通道不一致:README承诺仅在标准输出返回机器可读JSON,但当前源码使用写入JSON错误,因此封装器必须同时解析标准错误。
console.error
6) Keep IDs and file paths
6) 保留ID和文件路径
Most multi-step flows become much easier if the agent persists:
- domain IDs
- email IDs
- webhook IDs
- topic IDs
- segment IDs
- template IDs/aliases
- API key IDs
- the file paths it generated for HTML or batch JSON
如果Agent持久化以下信息,大多数多步骤流程会变得容易得多:
- 域名ID
- 邮件ID
- Webhook ID
- 主题ID
- 细分群体ID
- 模板ID/别名
- API密钥ID
- 为HTML或批量JSON生成的文件路径
The mutation ladder
变更阶梯
For state-changing live operations:
- classify the task
- confirm the command sequence
- make any needed file assets (, batch JSON)
.html - run with
--json -q - verify with ,
get, or a follow-up checklist - persist returned IDs and next-step context
- only then continue to the next mutation
对于改变状态的实时操作:
- 分类任务
- 确认命令序列
- 创建所需的文件资源(、批量JSON)
.html - 使用运行命令
--json -q - 通过、
get或后续检查验证结果list - 持久化返回的ID和下一步上下文
- 之后才继续执行下一个变更操作
Bundled helper script
捆绑助手脚本
scripts/resend_cli.pyCommands:
- — find the CLI, report install hints, and show environment basics
probe - — list known commands from the bundled catalogue
catalog - — inspect one command and its notes/gaps
info - — route a free-text task to the best CLI sequence
recommend - — print or materialise sample commands/files
scaffold - — statically validate an
lint-batchJSON fileemails batch - — explain likely causes of common CLI/API failures
doctor - — execute the official CLI with deterministic defaults and tolerant JSON parsing
run
Examples:
bash
python3 scripts/resend_cli.py probe
python3 scripts/resend_cli.py catalog --resource emails
python3 scripts/resend_cli.py info "emails send"
python3 scripts/resend_cli.py recommend "send 70 different shipment notifications"
python3 scripts/resend_cli.py scaffold batch-send --write-dir ./tmp
python3 scripts/resend_cli.py lint-batch ./tmp/batch-emails.json
python3 scripts/resend_cli.py doctor --command "emails send" --status 403 --message "1010 forbidden"
python3 scripts/resend_cli.py run -- emails list --limit 5scripts/resend_cli.py命令:
- —— 查找CLI,报告安装提示,并显示环境基础信息
probe - —— 列出捆绑目录中的已知命令
catalog - —— 检查单个命令及其说明/缺口
info - —— 将自由文本任务路由到最佳CLI序列
recommend - —— 打印或生成示例命令/文件
scaffold - —— 静态验证
lint-batchJSON文件emails batch - —— 解释常见CLI/API故障的可能原因
doctor - —— 使用确定性默认值和容错JSON解析执行官方CLI
run
示例:
bash
python3 scripts/resend_cli.py probe
python3 scripts/resend_cli.py catalog --resource emails
python3 scripts/resend_cli.py info "emails send"
python3 scripts/resend_cli.py recommend "send 70 different shipment notifications"
python3 scripts/resend_cli.py scaffold batch-send --write-dir ./tmp
python3 scripts/resend_cli.py lint-batch ./tmp/batch-emails.json
python3 scripts/resend_cli.py doctor --command "emails send" --status 403 --message "1010 forbidden"
python3 scripts/resend_cli.py run -- emails list --limit 5Response shape this skill should produce
此技能应生成的响应格式
A strong answer usually includes:
- the exact Resend primitive,
- the exact CLI command or command sequence,
- any file scaffolding the user needs,
- the operational caveats that matter here,
- the verification step,
- the fallback path if the CLI does not currently cover the flow.
优质回答通常包含:
- 确切的Resend原语,
- 确切的CLI命令或命令序列,
- 用户所需的任何文件脚手架,
- 此处重要的操作注意事项,
- 验证步骤,
- 如果CLI当前不支持该流程的回退路径。
Example prompts this skill should handle
此技能应处理的示例提示
- “Use the Resend CLI to send a scheduled password reset email”
- “Should I use ,
emails send, oremails batch?”broadcasts create - “Create a sending + receiving domain in ”
eu-west-1 - “Set up local webhook listening with ngrok”
- “Why is my batch file failing?”
- “How do I manage multiple Resend accounts from one agent?”
- “Can the CLI send a hosted template directly?”
- “How should my agent parse output safely?”
resend
- “使用Resend CLI发送一封定时密码重置邮件”
- “我应该使用、
emails send还是emails batch?”broadcasts create - “在创建一个发送+接收域名”
eu-west-1 - “使用ngrok设置本地Webhook监听”
- “为什么我的批量文件失败了?”
- “如何从一个Agent管理多个Resend账户?”
- “CLI能否直接发送托管模板?”
- “我的Agent应如何安全解析输出?”
resend