用途:Resend CLI 是 Resend 的官方命令行工具,用于在终端发送事务邮件,并管理域名、API 密钥、受众和联系人。官方仓库为 https://github.com/resend/resend-cli,文档为 https://resend.com/docs/cli。
主要能力:发送邮件(支持纯文本与 HTML)、查询邮件详情;管理域名(列出、创建、验证、删除);管理 API 密钥(列出、创建、删除);管理受众与联系人(列出、创建)。
使用方式:先执行 resend login 进行浏览器登录并创建 API 密钥。发送邮件示例:resend emails send --from "you@yourdomain.com" --to "user@example.com" --subject "Hello" --text "Body text",或使用 --html "<h1>Hi</h1>"。域名操作如 resend domains list、resend domains create --name example.com、resend domains verify --id DOMAIN_ID、resend domains delete --id DOMAIN_ID。API 密钥操作如 resend api-keys list、resend api-keys create --name "Production"、resend api-keys delete --id KEY_ID。受众与联系人操作如 resend audiences list、resend audiences create --name "Newsletter"、resend contacts list --audience-id AUD_ID、resend contacts create --audience-id AUD_ID --email "user@example.com" --first-name "John"。
适用场景与限制:发送前应确认域名所有权,可用 resend domains list 检查验证状态;富文本邮件用 --html,纯文本用 --text;邮件列表通过受众与联系人管理。CLI 更适合测试和一次性发送,生产流程建议使用 API 或 npm 包 resend 的 SDK。其他功能、收费与平台支持情况暂未提供。