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

emailr-cli

v1.6.0

Published

Command-line interface for the Emailr email API

Readme

Emailr CLI

The official command-line interface for the Emailr email API. Send transactional emails, manage contacts, templates, domains, and more from your terminal.

Installation

npm (recommended)

npm install -g emailr-cli

Homebrew (macOS/Linux)

brew install emailr-dev/tap/emailr-cli

Direct Download

Download the latest binary for your platform from the releases page:

| Platform | Architecture | Download | |----------|--------------|----------| | macOS | Apple Silicon (M1/M2/M3) | emailr-macos-arm64 | | macOS | Intel | emailr-macos-x64 | | Linux | x64 | emailr-linux-x64 | | Linux | ARM64 | emailr-linux-arm64 | | Windows | x64 | emailr-windows-x64.exe |

After downloading:

# macOS/Linux
chmod +x emailr-*
sudo mv emailr-* /usr/local/bin/emailr

# Windows - move to a directory in your PATH

Verify Installation

emailr --version

Quick Start

1. Configure your API key

emailr config set api-key YOUR_API_KEY

Or set the environment variable:

export EMAILR_API_KEY=YOUR_API_KEY

2. Send your first email

emailr send \
  --to [email protected] \
  --from [email protected] \
  --subject "Hello from Emailr CLI" \
  --html "<h1>Hello!</h1><p>This email was sent from the command line.</p>"

Commands

Email Sending

# Send a simple email
emailr send --to [email protected] --from [email protected] --subject "Hello" --html "<p>Hi!</p>"

# Send with a template
emailr send --to [email protected] --from [email protected] --template TEMPLATE_ID --template-data '{"name": "John"}'

# Send with CC and BCC
emailr send --to [email protected] --from [email protected] --subject "Hello" --html "<p>Hi!</p>" --cc [email protected] --bcc [email protected]

Contacts

# List contacts
emailr contacts list

# Create a contact
emailr contacts create --email [email protected] --first-name John --last-name Doe

# Get a contact
emailr contacts get CONTACT_ID

# Update a contact
emailr contacts update CONTACT_ID --first-name Jane

# Delete a contact
emailr contacts delete CONTACT_ID

Templates

# List templates
emailr templates list

# Create a template
emailr templates create --name "Welcome Email" --subject "Welcome {{name}}!" --html "<h1>Welcome {{name}}!</h1>"

# Get a template
emailr templates get TEMPLATE_ID

# Update a template
emailr templates update TEMPLATE_ID --subject "Updated: Welcome {{name}}!"

# Delete a template
emailr templates delete TEMPLATE_ID

Domains

# List domains
emailr domains list

# Add a domain
emailr domains add example.com

# Get domain details
emailr domains get DOMAIN_ID

# Verify domain DNS
emailr domains verify DOMAIN_ID

# Check DNS status
emailr domains check-dns DOMAIN_ID

# Delete a domain
emailr domains delete DOMAIN_ID

Configuration

# Set API key
emailr config set api-key YOUR_API_KEY

# Set custom API URL
emailr config set api-url https://api.emailr.dev

# View current config
emailr config show

# Clear config
emailr config clear

Output Formats

All commands support --format option:

# JSON output (default for scripting)
emailr contacts list --format json

# Table output (default for interactive use)
emailr contacts list --format table

Environment Variables

| Variable | Description | |----------|-------------| | EMAILR_API_KEY | Your Emailr API key | | EMAILR_BASE_URL | Custom API URL (default: https://api.emailr.dev) |

Configuration File

The CLI stores configuration in ~/.emailr/config.json:

{
  "apiKey": "et_live_...",
  "baseUrl": "https://api.emailr.dev"
}

Examples

Send a welcome email to new users

#!/bin/bash
emailr send \
  --to "$USER_EMAIL" \
  --from "[email protected]" \
  --template "welcome-template-id" \
  --template-data "{\"name\": \"$USER_NAME\", \"activation_link\": \"$ACTIVATION_URL\"}"

Bulk import contacts from CSV

#!/bin/bash
while IFS=, read -r email first_name last_name; do
  emailr contacts create --email "$email" --first-name "$first_name" --last-name "$last_name"
done < contacts.csv

Check domain verification status

#!/bin/bash
DOMAIN_ID=$(emailr domains list --format json | jq -r '.[0].id')
emailr domains check-dns "$DOMAIN_ID" --format json | jq '.dkim.verified'

Development

# Clone the repository
git clone https://github.com/emailr-dev/emailr.git
cd emailr

# Install dependencies
pnpm install

# Build the CLI
pnpm --filter emailr-cli build

# Run locally
node packages/sdks/cli/dist/index.js --help

License

MIT License - see LICENSE for details.

Support

  • Documentation: https://docs.emailr.dev
  • Issues: https://github.com/emailr-dev/emailr/issues
  • Email: [email protected]