{"id":17055,"library":"resend-cli","title":"Resend CLI","description":"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.","status":"active","version":"2.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/resend/resend-cli","tags":["javascript","cli","resend","email","api","tanstack-intent"],"install":[{"cmd":"npm install resend-cli","lang":"bash","label":"npm"},{"cmd":"yarn add resend-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add resend-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required runtime environment for the CLI executable.","package":"node","optional":false}],"imports":[{"note":"The primary 'import' is to make the `resend` command globally available in your shell. Other installation methods like cURL or Homebrew also achieve this.","wrong":"import { resend } from 'resend-cli'","symbol":"resend","correct":"npm install -g resend-cli"},{"note":"Used to authenticate the CLI by storing your Resend API key locally. For non-interactive environments, the `--key` flag is mandatory.","wrong":"node resend login","symbol":"resend login","correct":"resend login"},{"note":"The core command for sending emails via the Resend API, requiring specific flags for sender, recipient, subject, and content.","wrong":"resend send email","symbol":"resend emails send","correct":"resend emails send --from 'you@example.com' --to 'recipient@example.com' --subject 'Hello' --text 'Body'"}],"quickstart":{"code":"resend login\n\nresend emails send \\\n  --from \"you@example.com\" \\\n  --to delivered@resend.dev \\\n  --subject \"Hello from Resend CLI\" \\\n  --text \"Sent from my terminal.\"\n\nresend doctor","lang":"bash","description":"Demonstrates authenticating the CLI, sending a basic text email, and checking the local environment configuration."},"warnings":[{"fix":"Review the changelog for v2.0.0 and update CLI commands/scripts to conform to the new API. Re-test any automated workflows.","message":"Version 2.0.0 removed 'backwards compatibility shims', which might break existing scripts or integrations relying on older CLI behaviors or flags.","severity":"breaking","affected_versions":">=2.0.0"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"For non-interactive logins, use `resend login --key re_xxxxxxxxxxxxx` to provide the API key directly.","message":"When 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.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade your Node.js installation to version 20 or newer using a version manager like `nvm` or `fnm`.","message":"The CLI requires Node.js version 20 or higher. Running with older Node.js versions may lead to errors or unexpected behavior.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Upgrade to `resend-cli` version 1.10.0 or newer immediately to mitigate potential terminal output injection risks.","message":"Version 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.","severity":"security","affected_versions":"<1.10.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"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.","cause":"The Resend API key was not found through any of the configured sources (flag, environment variable, or config file).","error":"Error: auth_error"},{"fix":"Use `resend login --key re_xxxxxxxxxxxxx` to provide the API key when not in an interactive terminal.","cause":"Attempted to run `resend login` in a non-interactive environment (e.g., CI/CD) without providing the `--key` flag.","error":"Error: missing_key"}],"ecosystem":"npm","meta_description":null}