CLI 目录 横向对比 FCRS-1.0 标准 /llms.txt
← 返回 CLI 目录

Resend CLI

$ resend 官方出品 中风险
Resend · 办公协作与 SaaS · MIT · macos / linux / windows

Resend CLI(resend)用于管理 Resend 域名、事务邮件、受众广播与本地 Webhook 监听(resend webhooks listen)。专为开发者和编程 Agent 设计,在非 TTY 环境或传入 --json 时会自动输出结构化 JSON。

FCRS-1.0 综合评分
87 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
brew install resend/cli/resend
CLI vs MCP 选型建议 CLI + MCP 搭配

环境诊断 resend doctor、本地 webhooks listen 调试以及 React Email .tsx 渲染发送使用 resend CLI;纯对话宿主内发信可配合 Resend MCP。

Agent 友好度体检单

✓ 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
— 支持 NO_COLOR
✓ 自省/Schema 发现
— 官方 SKILL.md

当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。

FCRS-1.0 六维评分拆解

Agent 友好度 22 / 25

针对非 TTY 环境自动输出结构化 JSON,并完整支持 --json 与 RESEND_API_KEY。

  • Non-TTY auto-JSON behavior built specifically for agents and CI
  • Dedicated resend doctor diagnostics command
安全与权限边界 20 / 25

支持权限受限的 API 密钥与 [email protected] 等测试地址,但发往真实外部邮箱的邮件不可撤回。

  • Resend supports sending-only vs full-access API keys
  • Test sink addresses like [email protected] prevent external spam
安装与运行摩擦 14 / 15

可通过 npm、Homebrew Tap 及 curl/PowerShell 脚本在主流系统安装。

  • npm install -g resend-cli and brew install resend/cli/resend
能力覆盖与边际价值 13 / 15

涵盖邮件、域名、Webhook、广播与本地 webhooks listen 转发。

  • Includes React Email .tsx/.jsx rendering and local webhook forwarding
维护与来源背书 9 / 10

Resend 官方仓库(resend/resend-cli)以 MIT 协议积极维护。

  • Official Resend GitHub organization
文档与可验证性 9 / 10

官方 CLI 文档清晰且专门提供了 Agent 与 CI 用法示例。

  • Official docs at resend.com/docs/cli

安全边界、鉴权与放权指南

鉴权方式
环境变量密钥 浏览器 OAuth 本地配置文件
凭证存储位置

将会话密钥存储在 ~/.config/resend/,或直接读取环境变量 RESEND_API_KEY。

潜在副作用
只读查询 远端写入 计费影响
费用与配额提示

CLI 开源免费(MIT);Resend 提供每月 3,000 封免费额度及按量付费套餐。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# Resend CLI Agent Rules
- For automated smoke tests, only send to `[email protected]` or team test addresses; NEVER email external users autonomously.
- Use `RESEND_API_KEY` scoped with sending-only permissions where appropriate.
- Background `resend webhooks listen` with an explicit timeout so it does not hang the session.

Agent 高频安全命令配方

只读查询(安全推荐)

运行 Resend CLI 环境自检
resend doctor --json

检查 API 密钥有效性、本地配置与网络连通性,不发送任何邮件。

列出已验证的发信域名
resend domains list --json

以 JSON 返回已配置的发信域名及 DNS 验证状态。

受控写入与预演

向沙箱接收地址发送测试邮件
resend emails send --from [email protected] --to [email protected] --subject "Agent Smoke Test" --text "Hello" --json

仅向 Resend 官方测试接收地址 [email protected] 发送冒烟测试邮件。

核心优势

  • + 非 TTY 环境下自动输出机器可读 JSON,大幅降低脚本解析成本。
  • + 内置 resend webhooks listen,无需额外 ngrok 即可联调本地 Webhook。
  • + 提供 resend doctor 自检并支持 [email protected] 安全测试地址。

注意事项与踩坑点

  • ! 发往真实外部邮箱的邮件无法撤回,也不支持通用 --dry-run。
  • ! resend webhooks listen 为常驻监听流,同步运行会导致阻塞。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI