unosend
v1.4.1
Published
Unosend CLI - Send emails from your terminal
Maintainers
Readme
╦ ╦╔╗╔╔═╗╔═╗╔═╗╔╗╔╔╦╗
║ ║║║║║ ║╚═╗║╣ ║║║ ║║
╚═╝╝╚╝╚═╝╚═╝╚═╝╝╚╝═╩╝
One API. Infinite Emails.Installation
npm install -g unosendOr use with npx:
npx unosend send -f [email protected] -t [email protected] -s "Hello" --text "Hi"Quick Start
# 1. Initialize with your API key
unosend init
# 2. Send an email
unosend send -f [email protected] -t [email protected] -s "Hello!" --text "Hi there"
# 3. View your domains
unosend domains list
# 4. Check usage stats
unosend usageGet your API key at unosend.co/api-keys.
Commands
| Command | Description |
|---------|-------------|
| unosend init | Set up your API key |
| unosend send | Send an email |
| unosend emails | Get, resend, or cancel emails |
| unosend broadcasts | Manage email broadcasts |
| unosend domains | Manage sending domains |
| unosend contacts | Manage contacts |
| unosend audiences | Manage audiences |
| unosend templates | Manage email templates |
| unosend webhooks | Manage webhooks |
| unosend api-keys | Manage API keys |
| unosend suppressions | Manage email suppressions |
| unosend inbound | Manage inbound emails |
| unosend validate | Validate an email address |
| unosend logs | View email logs |
| unosend usage | View usage stats |
| unosend config | View or update configuration |
| unosend whoami | Show current auth status |
unosend init
Set up your API key interactively. Get yours at unosend.co/api-keys.
unosend send
Send an email.
# Basic email
unosend send -f [email protected] -t [email protected] -s "Subject" --text "Body"
# HTML email
unosend send -f [email protected] -t [email protected] -s "Subject" --html "<h1>Hello</h1>"
# From file
unosend send -f [email protected] -t [email protected] -s "Newsletter" --file ./email.html
# With display name
unosend send -f [email protected] -t [email protected] -s "Subject" --text "Body" --from-name "My App"
# Using a template
unosend send -f [email protected] -t [email protected] -s "Welcome" --template tmpl_abc123 --template-data '{"name":"John"}'
# Schedule for later
unosend send -f [email protected] -t [email protected] -s "Subject" --text "Body" --schedule "2026-04-01T09:00:00Z"
# With tags
unosend send -f [email protected] -t [email protected] -s "Subject" --text "Body" --tags "category:onboarding,env:production"
# With CC and BCC
unosend send -f [email protected] -t [email protected] -s "Subject" --text "Body" --cc "[email protected]" --bcc "[email protected]"Options:
| Option | Description |
|--------|-------------|
| -t, --to <email> | Recipient email (required) |
| -s, --subject <subject> | Subject line (required) |
| -f, --from <email> | Sender email (required) |
| --html <html> | HTML content |
| --text <text> | Plain text content |
| --file <path> | Read HTML from file |
| --reply-to <email> | Reply-to address |
| --cc <emails> | CC recipients (comma-separated) |
| --bcc <emails> | BCC recipients (comma-separated) |
| --from-name <name> | Sender display name |
| --template <id> | Template ID to use |
| --template-data <json> | Template variables as JSON |
| --schedule <datetime> | Schedule send (ISO 8601) |
| --tags <tags> | Tags as name:value pairs |
unosend emails
Manage sent emails.
unosend emails get <email-id> # Get email details
unosend emails resend <email-id> # Resend an email
unosend emails cancel <email-id> # Cancel a scheduled emailunosend broadcasts
Manage email broadcasts (campaigns).
# List broadcasts
unosend broadcasts list
# Create a broadcast
unosend broadcasts create --name "March Newsletter" --subject "What's New" \
--from [email protected] --file ./newsletter.html --audience aud_123
# Get broadcast details
unosend broadcasts get <broadcast-id>
# Update a broadcast
unosend broadcasts update <broadcast-id> --subject "Updated Subject"
# Send a broadcast
unosend broadcasts send <broadcast-id>
# Schedule a broadcast
unosend broadcasts create --name "Campaign" --subject "Hi" \
--from [email protected] --text "Hello!" --audience aud_123 \
--schedule "2026-04-01T09:00:00Z"
# Remove a broadcast
unosend broadcasts remove <broadcast-id>unosend domains
Manage your sending domains.
unosend domains list # List domains
unosend domains add example.com # Add a domain
unosend domains verify example.com # Verify domain DNS
unosend domains remove example.com # Remove a domainunosend contacts
Manage contacts in your audiences.
# List contacts
unosend contacts list --audience <audience-id>
# Add a contact
unosend contacts add [email protected] --audience <audience-id> --first-name "John" --last-name "Doe"
# Get a contact
unosend contacts get <contact-id>
# Update a contact
unosend contacts update <contact-id> --first-name "Jane" --subscribed
# Remove a contact
unosend contacts remove <contact-id>unosend audiences
Manage audiences (contact lists).
unosend audiences list # List audiences
unosend audiences add "Newsletter Subscribers" --description "Main list" # Create
unosend audiences get <audience-id> # Get details
unosend audiences remove <audience-id> # Removeunosend templates
Manage email templates.
# List templates
unosend templates list
# Create a template
unosend templates create "Welcome Email" --subject "Welcome!" --html "<h1>Welcome</h1>"
# Create from file
unosend templates create "Newsletter" --subject "Weekly Update" --file ./template.html
# Update a template
unosend templates update <template-id> --subject "New Subject" --html "<h1>Updated</h1>"
# Remove a template
unosend templates remove <template-id>unosend webhooks
Manage webhook endpoints.
# List webhooks
unosend webhooks list
# Add a webhook (all events)
unosend webhooks add https://example.com/webhook
# Add with specific events
unosend webhooks add https://example.com/webhook --events "email.delivered,email.bounced"
# View available events
unosend webhooks events
# Remove a webhook
unosend webhooks remove <webhook-id>Available events: email.sent, email.delivered, email.opened, email.clicked, email.bounced, email.complained, email.unsubscribed
unosend api-keys
Manage API keys.
unosend api-keys list # List API keys
unosend api-keys create "Production Key" # Create a new key
unosend api-keys revoke <key-id> # Revoke a keyunosend suppressions
Manage email suppressions.
unosend suppressions list # List suppressions
unosend suppressions add [email protected] --reason "User requested" # Add
unosend suppressions get <suppression-id> # Get details
unosend suppressions remove <suppression-id> # Removeunosend inbound
Manage inbound (received) emails.
unosend inbound list # List inbound emails
unosend inbound get <email-id> # Get inbound email details
unosend inbound remove <email-id> # Delete an inbound emailunosend validate
Validate an email address.
unosend validate [email protected]Returns: valid/invalid status, disposable check, role-based check, MX record check, and suggestions.
unosend usage
View email usage and statistics.
unosend usage # Default: last 30 days
unosend usage --period 7d # Last 7 days
unosend usage --period 90d # Last 90 daysShows: emails sent/limit with progress bar, delivered, bounced, opened, clicked, contacts, and domains.
unosend logs
View email sending logs.
unosend logs # Recent logs
unosend logs --limit 50 # More logs
unosend logs --status failed # Filter by statusunosend config
Manage configuration.
unosend config --list # View config
unosend config --set apiKey=un_xxxxx # Update API key
unosend config --set apiUrl=https://custom.endpoint.com # Custom endpointunosend whoami
Show current authentication status and configured endpoint.
Requirements
- Node.js >= 18.0.0
- An Unosend account and API key
Links
License
MIT
