A command-line interface for Resend email API
npm install @letanure/resend-cliA command-line interface for the Resend email API. Send emails, manage domains, and more via CLI commands or an interactive TUI.
> Disclaimer: This is an unofficial CLI tool built on top of the Resend Node.js SDK. It is not affiliated with or endorsed by Resend.
> Warning: Currently in active development. Some features may be incomplete or subject to change.
Get your API key at resend.com/api-keys, export it, and run:
CLI Mode:
``bash`
export RESEND_API_KEY="re_your_api_key_here"
npx @letanure/resend-cli email send \
--from="Acme
--to="delivered@resend.dev" \
--subject="Hello from CLI" \
--text="This email was sent from the command line!"
TUI Mode:
`bash`
npx @letanure/resend-cli
Node.js 18+ and a Resend API key
1. Sign up at resend.com
2. Go to API Keys
3. Create a new API key
4. Copy the key (starts with re_)
- Requirements
- Get Your API Key
- Installation
- Configuration
- Usage
- Commands
- TUI Mode
- Output Formats
- CI/CD Integration
- Troubleshooting
- Development
- License
- Contributing
Recommended: Use with npx (no installation required)
`bash`
npx @letanure/resend-cli --help
For frequent use: Install globally
`bash`
npm install -g @letanure/resend-cli
resend-cli --help
In projects: Install locally
`bash`
npm install @letanure/resend-cli
npx resend-cli --help
The CLI requires your Resend API key to be available as an environment variable.
#### Setup Methods
Temporary (current session only):
`bash`
export RESEND_API_KEY="re_xxxxxxxxxxxx"
Permanent (recommended):
`bashAdd to your shell profile
echo 'export RESEND_API_KEY="re_xxxxxxxxxxxx"' >> ~/.bashrc
source ~/.bashrc
One-time usage:
`bash
RESEND_API_KEY="re_xxxxxxxxxxxx" resend-cli email send --from="..." --to="..."
`#### Getting Your API Key
1. Sign up at resend.com
2. Go to API Keys
3. Create a new API key
4. Copy the key (starts with
re_)Usage
`bash
$ resend-cli --help
Usage: resend-cli [options] [command]Resend CLI - Send emails, manage domains, and more
API Key: Set RESEND_API_KEY environment variable or use --api-key option
Options:
-V, --version output the version number
-v output the version number
--dry-run Enable dry-run mode for all operations (default: false)
--api-key Resend API key (overrides RESEND_API_KEY environment
variable)
-h, --help display help for command
Commands:
apikeys Manage API keys
audiences Audience operations
broadcasts Broadcast operations
contacts Manage contacts in your audiences
domains Domain operations
email Email operations
help [command] display help for command
`Commands
$3
Manage API keys
`bash
$ resend-cli apikeys --help
Usage: resend-cli apikeys [options] [command]Manage API keys
Options:
-h, --help display help for command
Commands:
create [options] Create a new API key in Resend
delete [options] Delete an existing API key from Resend
list [options] List all API keys in Resend
`
$3
Manage audiences for newsletters and broadcasts
`bash
$ resend-cli audiences --help
Usage: resend-cli audiences [options] [command]Audience operations
Options:
-h, --help display help for command
Commands:
create [options] Create a new audience via Resend API
retrieve [options] Retrieve an audience by ID from Resend API
delete [options] Delete an audience by ID from Resend API
list [options] List all audiences from Resend API
`
$3
Manage newsletter broadcasts
`bash
$ resend-cli broadcasts --help
Usage: resend-cli broadcasts [options] [command]Broadcast operations
Options:
-h, --help display help for command
Commands:
create|c [options] Create a new broadcast to send to your audience
delete|d [options] Delete a broadcast (only draft or scheduled broadcasts)
list|l List all broadcasts
retrieve [options] Retrieve a broadcast by ID from Resend API
send|s [options] Send a broadcast to your audience
update|u [options] Update a broadcast to send to your audience
`
$3
Manage contacts in your audiences
`bash
$ resend-cli contacts --help
Usage: resend-cli contacts [options] [command]Manage contacts in your audiences
Options:
-h, --help display help for command
Commands:
create [options] Create a contact in an audience via Resend API
delete [options] Delete a contact by ID or email from an audience in Resend
API
list [options] List all contacts in an audience
retrieve [options] Retrieve a contact by ID or email from an audience
update|u [options] Update an existing contact
`
$3
Manage domains and DNS configuration
`bash
$ resend-cli domains --help
Usage: resend-cli domains [options] [command]Domain operations
Options:
-h, --help display help for command
Commands:
create [options] Create a domain through the Resend Email API
retrieve [options] Retrieve a domain by ID from Resend API
verify [options] Verify a domain by ID using Resend API
update [options] Update a domain configuration using Resend API
delete [options] Delete a domain by ID using Resend API
list [options] List all domains from Resend API
`
$3
Send and manage emails
`bash
$ resend-cli email --help
Usage: resend-cli email [options] [command]Email operations
Options:
-h, --help display help for command
Commands:
send [options] Send an email via Resend API
retrieve [options] Retrieve an email by ID from Resend API
update [options] Update a scheduled email via Resend API
cancel [options] Cancel a scheduled email via Resend API
`
#### email send`bash
$ resend-cli email send --help
Usage: email send [OPTIONS]Send an email via Resend API
OPTIONS:
--from, -f Sender email address with optional name
--to, -t Recipient email(s) - comma separated for multiple (max 50)
--subject, -s Email subject line
--bcc, -b Blind carbon copy recipients - comma separated
--cc, -c Carbon copy recipients - comma separated for multiple
--scheduled-at, -a Natural language (in 1 min) or ISO 8601 format
--reply-to, -r Reply-to address(es) - comma separated
--html, -h HTML version of the message
--text, -x Plain text version
--output Output format (text, json)
--dry-run Validate and preview without sending
--api-key Resend API key (overrides RESEND_API_KEY environment variable)
EXAMPLES:
$ resend-cli email send --from="Acme " --to="user@example.com" --subject="Hello World" --html="it works!
"
$ resend-cli email send -f onboarding@resend.dev -t user@example.com -s "Hello World" --text="it works!"
$ resend-cli email send --output json --from="..." --to="..." --subject="..." --html="..." | jq '.'
$ EMAIL_ID=$(resend-cli email send --output json ... | jq -r '.data.id')
$ RESEND_API_KEY="re_xxxxx" resend-cli email send --from="..." --to="..." --subject="..." --html="..."
$ resend-cli email send --api-key="re_xxxxx" --from="..." --to="..." --subject="..." --html="..."
`
TUI Mode
Launch the interactive interface for a guided experience:
`bash
$ resend-cli
`Features:
- Interactive navigation with arrow keys and Enter
- Form-based input with validation
- Module organization by functionality
- Rich display with colors and layout
Available Modules:
- Email Operations - Send, retrieve, update, cancel emails
- Domain Management - List and manage domains
- Audience Management - Create, list, retrieve, delete audiences
- API Key Management - Create, list, delete API keys
- Contact Management - Create, list, update, delete contacts
- Broadcast Operations - List and manage broadcasts
Navigation:
- Arrow Keys / Enter: Navigate and select options
- Escape: Go back | Ctrl+C: Exit
Dry-Run Mode:
Both CLI and TUI modes support dry-run validation without sending:
- CLI: Add
--dry-run flag to any command
- TUI: Start with npx @letanure/resend-cli --dry-run
- Warning banner appears when dry-run mode is activeOutput Formats
The CLI supports both human-readable and machine-readable output:
Default (Human-readable):
Rich formatted output with colors and layout
JSON Output (for automation):
Add
--output json flag to any command for structured data:
`bash
$ resend-cli email send --output json --from="..." --to="..." --subject="..." --text="..."
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"to": "delivered@resend.dev",
"from": "Acme ",
"subject": "Hello"
}
}
`CI/CD Integration
Perfect for automated workflows:
`bash
Extract email ID for further processing
EMAIL_ID=$(resend-cli email send --output json \
--from="Acme " \
--to="delivered@resend.dev" \
--subject="Welcome to our app" \
--html="Welcome!
" | jq -r '.data.id')echo "Sent email with ID: $EMAIL_ID"
`Troubleshooting
$3
Missing API Key:
`
ā Configuration Error
Missing required environment variable: RESEND_API_KEY
Get your API key at https://resend.com/api-keys
``Input Validation: All inputs are validated - invalid emails, missing required fields, etc. will show clear error messages
Unknown Options: Unknown command options will trigger helpful error messages with suggestions
See DEVELOPMENT.md for development setup, architecture details, and contributing guidelines.
MIT License - see LICENSE file for details.
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Update documentation
6. Submit a pull request
See DEVELOPMENT.md for detailed development setup.
!visitors
---
README is auto-generated based on CLI commands and modules