Skip to content

Shubhdeep12/resend-cli

Repository files navigation

Note: Resend now provides an official CLI. This project will no longer be the primary place for new CLI work; please use the official CLI instead (https://github.com/resend/resend-cli). I’ll be contributing to the official project going forward.

Resend CLI

Unofficial CLI for Resend

npm version Latest License: MIT

Features

  • Full API coverage: emails, domains, contacts, broadcasts, webhooks, keys, segments, topics, templates
  • Script & CI ready: --json, pagination, consistent exit codes
  • Flexible auth: named keys, RESEND_API_KEY, completions
  • Agent-friendly: behavior contract for deterministic output

Install

npm (Node.js required):

npm install -g @shubhdeep12/resend-cli

Then run resend --version to verify.

macOS / Linux (standalone binary, no Node required):

curl -fsSL https://raw.githubusercontent.com/Shubhdeep12/resend-cli/main/scripts/install.sh | bash

The script installs to /usr/local/bin (if writable) or ~/.local/bin. Then run resend --version. If resend isn’t found, add the printed directory to your PATH.

Windows (PowerShell, standalone binary):

irm https://raw.githubusercontent.com/Shubhdeep12/resend-cli/main/scripts/install.ps1 | iex

The script installs to %LOCALAPPDATA%\Programs\resend-cli and adds it to your user PATH. Restart the terminal, then run resend --version.

Manual: Download the latest binary for your OS/arch, extract, and run the executable.

Quick Start

# Authenticate once
resend auth login

# Send an email
resend emails send --from "you@yourdomain.com" --to "user@example.com" --subject "Hi" --html "<p>Hello!</p>"

# List recent emails as JSON
resend emails list --json --limit 5

# Use an env var instead of login
RESEND_API_KEY="re_xxx" resend emails list --json

Authentication

The CLI needs a Resend API key. It is resolved in this order:

  1. RESEND_API_KEY — Set in the environment or in a .env file in the current working directory. If set, this is always used.
  2. Saved key — From resend auth login (or resend auth select). Used only when RESEND_API_KEY is not set.

So: env (or .env) overrides saved keys. Put RESEND_API_KEY=re_xxx in .env or export it; run from the directory that contains .env if you use a file.

Documentation

Contributing

See CONTRIBUTING.md for development setup, testing, and release workflow.

License

MIT © Shubhdeep