Introduction & Installation
Relevant source files
The following files were used as context for generating this wiki page:
The Resend CLI provides a terminal-based interface for interacting with the Resend platform. You use it to send emails, manage domains, handle contact lists, and configure automated workflows directly from the shell or within CI/CD pipelines. It supports standard API operations and includes specific features for rendering React Email templates locally before transmission.
Sources: skills/resend-cli/SKILL.md:1-25, package.json:2-10
Installation Methods
You can install the Resend CLI using package managers or standalone installer scripts. The project requires Node.js version 22 or higher if installed via npm.
Package Managers
| Method | Command |
|---|---|
| Node.js (npm) | npm install -g resend-cli |
| Homebrew (macOS/Linux) | brew install resend/cli/resend |
Sources: skills/resend-cli/SKILL.md:50-65, package.json:22-24
Installer Scripts
Standalone scripts facilitate installation on systems without a package manager. These scripts detect the host architecture, verify binary integrity via checksums, and update the system PATH.
- macOS and Linux:
Run the following command in your terminal:curl -fsSL https://resend.com/install.sh | bash - Windows:
Run the following command in PowerShell:irm https://resend.com/install.ps1 | iex
Sources: install.sh:4-7, install.ps1:4-7
Installation Logic and Architecture
The installer scripts perform several environment checks to ensure compatibility and security.
Platform Support
The CLI supports the following architectures:
- macOS (Intel
x64and Apple Siliconarm64). - Linux (
x64andarm64). - Windows (
x64).
Sources: install.sh:75-90, install.ps1:32-35
Installation Workflow
The install.sh and install.ps1 scripts follow a structured process to deploy the binary.
This diagram represents the sequence of operations performed by the standalone installer scripts.
Sources: install.sh:75-200, install.ps1:40-160
Initial Configuration and Health Checks
After installation, you must authenticate the CLI and verify the environment.
Authentication
You authenticate by providing a Resend API key. The CLI resolves credentials in the following priority:
RESEND_API_KEYenvironment variable.- Stored profile created via
resend login.
Sources: skills/resend-cli/SKILL.md:86-90, src/commands/doctor.ts:100-115
The Doctor Command
You run resend doctor to diagnose the local environment. It performs four primary checks:
- CLI Version: Compares the local version against the latest GitHub release.
- API Key: Validates the presence and source of the API key.
- Credential Storage: Identifies if the key is stored in a secure OS vault or a plaintext file.
- API Validation: Tests the key against the Resend API to verify permissions and domain status.
Sources: src/commands/doctor.ts:200-265, skills/resend-cli/references/workflows.md:10-15
Update Mechanism
The CLI includes an automatic update notifier that checks for new versions in the background.
The update notifier checks the GitHub Releases API every hour. It suppresses notices if the output is not a TTY or if CI=true is set.
Sources: src/lib/update-check.ts:10-100
Global Environment Variables
The CLI behavior can be modified using the following variables:
| Variable | Description |
|---|---|
RESEND_API_KEY | The primary API key for authentication. |
RESEND_PROFILE | Selects a specific stored auth profile. |
RESEND_INSTALL | Custom directory for script-based installation. |
RESEND_NO_UPDATE_NOTIFIER | Set to 1 to disable update checks. |
Sources: skills/resend-cli/SKILL.md:30-45, install.sh:10-15, src/lib/update-check.ts:95-105
Summary
Introduction & Installation covers the deployment of the resend-cli through various package managers and scripts. The system architecture prioritizes secure binary distribution via checksums and provides a robust diagnostic tool (resend doctor) to ensure the environment is correctly configured for API interactions.