Resend CLI
Resend CLI is the official command-line tool for the Resend email platform. It lets agents send emails with full control over from, to, subject, body (text or HTML), CC, BCC, and reply-to — all via structured JSON output.
88Trust High
by resendcommunicationbeginnerv1.4.1updated Mar 13, 2026
6.2kTotal Runs
93.0%Success Rate
4.8kInstalls
88Trust Score
Tags
#email#resend#cli#transactional#notifications#automation#api
Required Tools
bashInputs
| Name | Type | Description | Req |
|---|---|---|---|
| from | text | Sender email address (must be from a verified domain in Resend) | yes |
| to | text | Recipient email address(es), space-separated for multiple | yes |
| subject | text | Email subject line | yes |
| body | text | Email body — plain text (--text) or HTML (--html or --html-file path) | yes |
| cc | text | CC recipient(s), space-separated | -- |
| bcc | text | BCC recipient(s), space-separated | -- |
| reply_to | text | Reply-to email address | -- |
Outputs
| Name | Type | Description | Req |
|---|---|---|---|
| email_id | text | The UUID of the sent email returned by the Resend API | yes |
| result | json | Full JSON response from Resend including email ID and status | yes |
Compatible Skills
SKILL.md
---
name: resend-cli
description: The official CLI for Resend — send transactional emails, manage domains, and run diagnostics from the command line.
---
# Resend CLI
The official CLI for Resend email platform.
## Installation
```bash
# cURL
curl -fsSL https://resend.com/install.sh | bash
# Homebrew
brew install resend/cli/resend
# npm
npm install -g resend-cli
```
## Quick Start
### Authenticate
```bash
# Interactive
resend login
# Non-interactive (CI)
resend login --key re_xxxxxxxxxxxxx
# Or use environment variable
export RESEND_API_KEY=re_xxxxxxxxxxxxx
```
### Send Email
```bash
# Plain text
resend emails send --from "you@yourdomain.com" --to recipient@example.com --subject "Hello from Resend CLI" --text "Sent from my terminal."
# HTML email
resend emails send --from "you@yourdomain.com" --to recipient@example.com --subject "Hello" --html "<p>HTML content</p>"
# With attachments (via HTML body with file)
resend emails send --from "you@yourdomain.com" --to recipient@example.com --subject "Report" --html-file ./email.html
```
### Multiple Recipients
```bash
resend emails send --from "you@yourdomain.com" --to alice@example.com bob@example.com --subject "Team update" --text "Hello everyone"
```
### With CC and BCC
```bash
resend emails send --from "you@yourdomain.com" --to recipient@example.com --subject "Meeting notes" --text "See attached." --cc manager@example.com --bcc archive@example.com --reply-to noreply@example.com
```
## Environment Diagnostics
```bash
# Check setup
resend doctor
# JSON output for agents
resend doctor --json
```
Checks:
- CLI Version
- API Key status
- Verified domains
- AI agent detection
## Authentication Priority
| Priority | Source |
|----------|--------|
| 1 | --api-key flag |
| 2 | RESEND_API_KEY env var |
| 3 | Config file (~/.config/resend/credentials.json) |
## Global Options
```bash
resend [global options] <command> [command options]
--api-key <key> # Override API key
-p, --profile <name> # Use specific profile
--json # Force JSON output
-q, --quiet # Suppress output
```
## API Key Format
API keys start with re_ and are validated before storage.
## Domain Verification
Sender domains must be verified in Resend dashboard before sending.
## Error Codes
| Code | Cause |
|------|-------|
| auth_error | No API key found |
| missing_body | No --text, --html, or --html-file |
| send_error | Resend API error |
| invalid_key_format | Key doesn't start with re_ |
## CI/CD Usage
```yaml
# GitHub Actions
env:
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
steps:
- run: |
resend emails send --from "deploy@yourdomain.com" --to "team@yourdomain.com" --subject "Deploy complete" --text "Version ${{ github.sha }} deployed."
```
## Resources
- Docs: https://resend.com/docs
- GitHub: https://github.com/resend/resend-cli