Skip to main content
╦ ╦╔╗╔╔═╗╔═╗╔═╗╔╗╔╔╦╗
║ ║║║║║ ║╚═╗║╣ ║║║ ║║
╚═╝╝╚╝╚═╝╚═╝╚═╝╝╚╝═╩╝
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:
npm install -g unosend
Or using yarn:
yarn global add unosend
Or using pnpm:
pnpm add -g unosend

Quick Start

# Initialize with your API key
unosend init

# Send an email
unosend send -t [email protected] -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.
unosend init
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.
-t, --to
string
required
Recipient email address
-s, --subject
string
required
Email subject line
-f, --from
string
Sender email address (defaults to your verified domain)
--html
string
HTML content for the email body
--text
string
Plain text content for the email body
--file
string
Path to an HTML file to use as the email body
--reply-to
string
Reply-to email address
--cc
string
CC recipients (comma-separated)
--bcc
string
BCC recipients (comma-separated)

Examples

Basic text email:
unosend send -t [email protected] -s "Hello" --text "Hi there!"
HTML email:
unosend send -t [email protected] -s "Welcome" --html "<h1>Welcome!</h1><p>Thanks for signing up.</p>"
Email from HTML file:
unosend send -t [email protected] -s "Newsletter" --file ./newsletter.html
Email with CC and BCC:
unosend send -t [email protected] -s "Team Update" --text "Meeting at 3pm" --cc "[email protected]" --bcc "[email protected]"
Custom from address:
unosend send -t [email protected] -f "[email protected]" -s "Support Reply" --text "Thanks for reaching out!"

unosend domains

Manage your sending domains.

List all domains

unosend domains list

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.
--limit
number
Number of logs to retrieve (default: 10)
--status
string
Filter by status: sent, delivered, failed, bounced

Examples

View recent logs:
unosend logs
View more logs:
unosend logs --limit 50
Filter by failed emails:
unosend logs --status failed

unosend config

Manage your CLI configuration.

View current config

unosend config --list

Update API key

unosend config --set apiKey=un_xxxxx

unosend whoami

Check your current authentication status and account info.
unosend whoami

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 [email protected] \
  -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.