Registry / communication / resend-cli

resend-cli

JSON →
library2.2.1jsnpmunverified

The Resend CLI is the official command-line interface for interacting with the Resend email API. It allows developers, AI agents, and CI/CD pipelines to manage and send emails directly from the terminal. The current stable version is 2.2.1, with frequent minor and patch releases, indicating active development and continuous feature additions. Key differentiators include its multi-platform installation methods (npm, cURL, Homebrew, PowerShell), built-in 'agent skill' support for AI coding agents, and robust authentication mechanisms. It provides commands for common tasks such as sending emails, managing domains, and checking the environment, aiming to streamline email operations programmatically and interactively.

npm install resend-cli
INSTALL
IMPORT
SIG · RESEND-CLI
R
resend-cli
communicationjavascriptv2.2.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

resend
npm install -g resend-cli
import { resend } from 'resend-cli'
The primary 'import' is to make the `resend` command globally available in your shell. Other installation methods like cURL or Homebrew also achieve this.
resend login
resend login
node resend login
Used to authenticate the CLI by storing your Resend API key locally. For non-interactive environments, the `--key` flag is mandatory.
resend emails send
resend emails send --from 'you@example.com' --to 'recipient@example.com' --subject 'Hello' --text 'Body'
resend send email
The core command for sending emails via the Resend API, requiring specific flags for sender, recipient, subject, and content.

Demonstrates authenticating the CLI, sending a basic text email, and checking the local environment configuration.

resend login resend emails send \ --from "you@example.com" \ --to delivered@resend.dev \ --subject "Hello from Resend CLI" \ --text "Sent from my terminal." resend doctor
resend --version
Debug
Known issues
breakingVersion 2.0.0 removed 'backwards compatibility shims', which might break existing scripts or integrations relying on older CLI behaviors or flags.
fix
Review the changelog for v2.0.0 and update CLI commands/scripts to conform to the new API. Re-test any automated workflows.
affects: >=2.0.0
gotchaThe Resend CLI resolves API keys using a strict priority: `--api-key` flag (highest), `RESEND_API_KEY` environment variable, then the locally stored config file (lowest). Misunderstanding this order can lead to unexpected authentication issues.
fix
Always explicitly use the `--api-key` flag for highest precedence, or ensure the `RESEND_API_KEY` environment variable is set correctly. Use `resend login` for local configuration as a fallback.
affects: >=1.0.0
gotchaWhen running `resend login` in a non-interactive environment (e.g., CI/CD pipelines, scripts), the `--key` flag is mandatory. Omitting it will result in an error.
fix
For non-interactive logins, use `resend login --key re_xxxxxxxxxxxxx` to provide the API key directly.
affects: >=1.0.0
breakingThe CLI requires Node.js version 20 or higher. Running with older Node.js versions may lead to errors or unexpected behavior.
fix
Upgrade your Node.js installation to version 20 or newer using a version manager like `nvm` or `fnm`.
affects: <2.0.0
securityVersion 1.10.0 included a fix to sanitize untrusted terminal output, preventing potential escape sequence injection vulnerabilities. Older versions might be susceptible to malicious input displaying unexpected terminal behaviors or executing arbitrary commands in certain contexts.
fix
Upgrade to `resend-cli` version 1.10.0 or newer immediately to mitigate potential terminal output injection risks.
affects: <1.10.0
Errors
Common errors & fixes
Error: auth_error
The Resend API key was not found through any of the configured sources (flag, environment variable, or config file).
fix
Run `resend login` to store your API key, or export `RESEND_API_KEY=re_xxx` in your environment, or pass it via `--api-key re_xxx` flag.
Error: missing_key
Attempted to run `resend login` in a non-interactive environment (e.g., CI/CD) without providing the `--key` flag.
fix
Use `resend login --key re_xxxxxxxxxxxxx` to provide the API key when not in an interactive terminal.
Upgrade
Version history
2.2.1latest on npm
Audit
Dependencies
noderequiredRequired runtime environment for the CLI executable.
Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
resend-cli — npm install resend-cli · libregistry