Linux command
resend 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Authenticate
resend login
Send an email
resend emails send --from [sender@example.com] --to [recipient@example.com] --subject "[Hello]" --text "[Message body]"
Check API key
resend doctor
Start a local webhook
resend webhooks listen
Create a webhook
resend webhooks create
Send an email
resend emails send --from [sender@example.com] --to [recipient@example.com] --subject "[Hello]" --html "[<h1>Hello</h1>]"
说明
resend is the official CLI for the Resend email API. It enables sending transactional emails, managing webhooks, and diagnosing account configuration directly from the terminal. The CLI is designed for developers, CI/CD pipelines, and AI agent workflows. In non-interactive mode, output is formatted as JSON with consistent exit codes, making it suitable for scripting and automation. Errors include structured message and code fields for programmatic handling. The webhook listener (resend webhooks listen) creates a local development server that captures incoming events and streams them to the terminal, useful for testing email event handlers without deploying to production.
参数
- login
- Authenticate with your Resend account via the browser.
- doctor
- Verify API key validity, list verified domains, and check readiness.
- emails send
- Send an email with specified sender, recipient, subject, and body.
- webhooks listen
- Start a local server on port 4318 to capture and display incoming webhook events.
- webhooks create
- Register a new webhook endpoint for production environments.
- --from _address_
- Sender email address.
- --to _address_
- Recipient email address.
- --subject _text_
- Email subject line.
- --text _body_
- Plain text email body.
- --html _body_
- HTML email body.
- --forward-to _url_
- Forward webhook payloads to a local server, preserving signature headers.
- --version
- Show version information.
- --help
- Show available commands and options.
FAQ
What is the resend command used for?
resend is the official CLI for the Resend email API. It enables sending transactional emails, managing webhooks, and diagnosing account configuration directly from the terminal. The CLI is designed for developers, CI/CD pipelines, and AI agent workflows. In non-interactive mode, output is formatted as JSON with consistent exit codes, making it suitable for scripting and automation. Errors include structured message and code fields for programmatic handling. The webhook listener (resend webhooks listen) creates a local development server that captures incoming events and streams them to the terminal, useful for testing email event handlers without deploying to production.
How do I run a basic resend example?
Run `resend login` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does login do in resend?
Authenticate with your Resend account via the browser.