Skip to main content
The Resend CLI is the official command-line interface for Resend. It’s built for humans, AI agents, and CI/CD pipelines.

Installation

curl -fsSL https://resend.com/install.sh | bash

Quick start

# Authenticate
resend login

# Send an email
resend emails send \
  --from "you@yourdomain.com" \
  --to recipient@example.com \
  --subject "Hello from Resend CLI" \
  --text "Sent from my terminal."

# Check your environment
resend doctor
For a full list of commands and options, see the CLI README.

Agent Skills

The Resend CLI includes built-in Agent Skills that help AI agents understand how to use the CLI effectively. Install the skill using the following command:
npx skills add resend/resend-cli
When running in non-interactive mode, all output is JSON, exit codes are consistent, and errors always include a message and code field.

Local development with webhooks

The CLI has a built-in webhooks listen command that handles everything for local development: it starts a local server, registers a temporary webhook, streams incoming events to your terminal, and cleans up when you exit.

Prerequisites

  • Resend CLI installed and authenticated (resend login)
  • A verified domain with receiving enabled
  • Tailscale installed and connected
Verify your environment is ready to proceed:
resend doctor
This command verifies your API key, lists your verified domains, and confirms you’re ready to proceed.
1

Expose the local port with Tailscale Funnel

webhooks listen runs on port 4318 by default. Expose that port publicly:
tailscale funnel 4318
Tailscale will give you a stable public URL at https://hostname.tailnet-name.ts.net.
2

Start listening for webhook events

resend webhooks listen \
  --url https://hostname.tailnet-name.ts.net \
  --events email.received
You can add any available event type to the --events flag. The all event type is also available to listen to all events.
resend webhooks listen --events all
The CLI will register a temporary webhook pointing at your Tailscale URL and stream incoming events to your terminal. The webhook is automatically deleted when you exit (Ctrl+C).
To forward payloads to your own local server (e.g. for integration testing), add --forward-to <your-local-url>. The CLI will pass along the original Svix headers so you can verify signatures. For example:
resend webhooks listen --forward-to http://localhost:4321/api/webhook
3

Send a test email

resend emails send \
  --from "onboarding@resend.dev" \
  --to "agent@yourdomain.com" \
  --subject "Test inbound" \
  --text "Hello, agent."
You should see the email.received event appear in your terminal within seconds.
For a permanent setup, deploy a webhook handler and register it via resend webhooks create pointing to your production URL.