╦ ╦╔╗╔╔═╗╔═╗╔═╗╔╗╔╔╦╗
║ ║║║║║ ║╚═╗║╣ ║║║ ║║
╚═╝╝╚╝╚═╝╚═╝╚═╝╝╚╝═╩╝
One API. Infinite Emails.
The Unosend CLI lets you send emails, manage domains, and view logs directly from your terminal.
Installation
Install the CLI globally using npm:
Or using yarn:
Or using pnpm:
Quick Start
# Initialize with your API key
unosend init
# Send an email
unosend send -t user@example.com -s "Hello!" --text "Hi there"
# View your domains
unosend domains list
# Check email logs
unosend logs
Commands
unosend init
Set up your API key. Get yours at https://www.unosend.co/api-keys.
You’ll be prompted to enter your API key. This is stored locally in your home directory.
unosend send
Send an email from the command line.
Sender email address (defaults to your verified domain)
HTML content for the email body
Plain text content for the email body
Path to an HTML file to use as the email body
CC recipients (comma-separated)
BCC recipients (comma-separated)
Examples
Basic text email:
unosend send -t user@example.com -s "Hello" --text "Hi there!"
HTML email:
unosend send -t user@example.com -s "Welcome" --html "<h1>Welcome!</h1><p>Thanks for signing up.</p>"
Email from HTML file:
unosend send -t user@example.com -s "Newsletter" --file ./newsletter.html
Email with CC and BCC:
unosend send -t user@example.com -s "Team Update" --text "Meeting at 3pm" --cc "team@example.com" --bcc "manager@example.com"
Custom from address:
unosend send -t user@example.com -f "support@yourdomain.com" -s "Support Reply" --text "Thanks for reaching out!"
unosend domains
Manage your sending domains.
List all domains
Add a new domain
unosend domains add example.com
Verify domain DNS records
unosend domains verify example.com
This checks if your DNS records are properly configured.
Show domain details
unosend domains show example.com
Displays the DNS records you need to add and their verification status.
Remove a domain
unosend domains remove example.com
unosend logs
View your email sending logs.
Number of logs to retrieve (default: 10)
Filter by status: sent, delivered, failed, bounced
Examples
View recent logs:
View more logs:
Filter by failed emails:
unosend logs --status failed
unosend config
Manage your CLI configuration.
View current config
Update API key
unosend config --set apiKey=un_xxxxx
unosend whoami
Check your current authentication status and account info.
Configuration
The CLI stores your configuration in ~/.unosend/config.json. This includes:
- Your API key
- Default sender address (optional)
- Other preferences
You can edit this file directly or use unosend config to manage settings.
Environment Variables
You can also set your API key using an environment variable:
export UNOSEND_API_KEY=un_xxxxx
This takes precedence over the config file, making it useful for CI/CD pipelines.
Scripting & Automation
The CLI is designed to work well in scripts and automation:
#!/bin/bash
# Send deployment notification
unosend send \
-t devops@example.com \
-s "Deployment Complete" \
--text "Version $VERSION deployed successfully to production"
Troubleshooting
”API key not found”
Run unosend init to set up your API key, or set the UNOSEND_API_KEY environment variable.
”Domain not verified”
Make sure you’ve added the required DNS records. Run unosend domains show yourdomain.com to see the records you need to add.
”Permission denied” during installation
Try installing with sudo:
sudo npm install -g unosend
Or use a Node version manager like nvm to avoid permission issues.
Getting Help
# General help
unosend --help
# Command-specific help
unosend send --help
unosend domains --help
Need more help? Visit our documentation or reach out to support.