npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@letanure/resend-cli

v0.40.0

Published

A command-line interface for Resend email API

Readme

Resend CLI

A 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.

TLDR

Get your API key at resend.com/api-keys, export it, and run:

CLI Mode:

export RESEND_API_KEY="re_your_api_key_here"
npx @letanure/resend-cli email send \
  --from="Acme <[email protected]>" \
  --to="[email protected]" \
  --subject="Hello from CLI" \
  --text="This email was sent from the command line!"

TUI Mode:

npx @letanure/resend-cli

Requirements

Node.js 18+ and a Resend API key

Get 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_)

Table of Contents

Installation

Recommended: Use with npx (no installation required)

npx @letanure/resend-cli --help

For frequent use: Install globally

npm install -g @letanure/resend-cli
resend-cli --help

In projects: Install locally

npm install @letanure/resend-cli
npx resend-cli --help

Configuration

Environment Variables

The CLI requires your Resend API key to be available as an environment variable.

Setup Methods

Temporary (current session only):

export RESEND_API_KEY="re_xxxxxxxxxxxx"

Permanent (recommended):

# Add to your shell profile
echo 'export RESEND_API_KEY="re_xxxxxxxxxxxx"' >> ~/.bashrc
source ~/.bashrc

# Or for zsh users
echo 'export RESEND_API_KEY="re_xxxxxxxxxxxx"' >> ~/.zshrc
source ~/.zshrc

One-time usage:

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

$ 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 <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

apikeys

Manage API keys

$ 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

audiences

Manage audiences for newsletters and broadcasts

$ 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

broadcasts

Manage newsletter broadcasts

$ 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

contacts

Manage contacts in your audiences

$ 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

domains

Manage domains and DNS configuration

$ 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

email

Send and manage emails

$ 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

$ resend-cli email send --help
Usage: email send [OPTIONS]

Send an email via Resend API

OPTIONS:
  --from, -f <value>          Sender email address with optional name
  --to, -t <value>            Recipient email(s) - comma separated for multiple (max 50)
  --subject, -s <value>       Email subject line
  --bcc, -b <value>           Blind carbon copy recipients - comma separated
  --cc, -c <value>            Carbon copy recipients - comma separated for multiple
  --scheduled-at, -a <value>  Natural language (in 1 min) or ISO 8601 format
  --reply-to, -r <value>      Reply-to address(es) - comma separated
  --html, -h <value>          HTML version of the message
  --text, -x <value>          Plain text version
  --output <value>            Output format (text, json)
  --dry-run                   Validate and preview without sending
  --api-key <value>           Resend API key (overrides RESEND_API_KEY environment variable)

EXAMPLES:
  $ resend-cli email send --from="Acme <[email protected]>" --to="[email protected]" --subject="Hello World" --html="<h1>it works!</h1>"
  $ resend-cli email send -f [email protected] -t [email protected] -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:

$ 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 active

Output 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:

$ resend-cli email send --output json --from="..." --to="..." --subject="..." --text="..."
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "to": "[email protected]",
    "from": "Acme <[email protected]>",
    "subject": "Hello"
  }
}

CI/CD Integration

Perfect for automated workflows:

# Extract email ID for further processing
EMAIL_ID=$(resend-cli email send --output json \
  --from="Acme <[email protected]>" \
  --to="[email protected]" \
  --subject="Welcome to our app" \
  --html="<h1>Welcome!</h1>" | jq -r '.data.id')

echo "Sent email with ID: $EMAIL_ID"

Troubleshooting

Common Issues

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

Development

See DEVELOPMENT.md for development setup, architecture details, and contributing guidelines.

License

MIT License - see LICENSE file for details.

Contributing

  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