Resend CLI
Installation
Before running any
resend
commands, check whether the CLI is installed:
resend
--version
If the command is not found, install it using one of the methods below:
cURL (macOS / Linux):
curl
-fsSL
https://resend.com/install.sh
|
bash
Homebrew (macOS / Linux):
brew
install
resend/cli/resend
Node.js:
npm
install
-g
resend-cli
PowerShell (Windows):
irm
https:
/
/
resend
.
com/install
.
ps1
|
iex
After installing, verify:
resend
--version
Agent Protocol
The CLI auto-detects non-TTY environments and outputs JSON — no
--json
flag needed.
Rules for agents:
Supply ALL required flags. The CLI will NOT prompt when stdin is not a TTY.
Pass
--quiet
(or
-q
) to suppress spinners and status messages.
Exit
0
= success,
1
= error.
Error JSON goes to stderr, success JSON goes to stdout:
{
"error"
:
{
"message"
:
"..."
,
"code"
:
"..."
}
}
Use
--api-key
or
RESEND_API_KEY
env var. Never rely on interactive login.
All
delete
/
rm
commands require
--yes
in non-interactive mode.
Authentication
Auth resolves:
--api-key
flag >
RESEND_API_KEY
env > config file (
resend login --key
). Use
--profile
or
RESEND_PROFILE
for multi-profile.
Global Flags
Flag
Description
--api-key
Mistake
Fix
1
Forgetting
--yes
on delete commands
All
delete
/
rm
subcommands require
--yes
in non-interactive mode — otherwise the CLI exits with an error
2
Not saving webhook
signing_secret
webhooks create
shows the secret once only — it cannot be retrieved later. Capture it from command output immediately
3
Omitting
--quiet
in CI
Without
-q
, spinners and status text still go to stderr (not stdout). Use
-q
for JSON on stdout with no spinner noise on stderr
4
Using
--scheduled-at
with batch
Batch sending does not support
scheduled_at
— use single
emails send
instead
5
Expecting
domains list
to include DNS records
List returns summaries only — use
domains get
Configure DNS records from output, then:
resend domains verify < domain-id
resend domains get < domain-id
check status
Create and send a broadcast: resend broadcasts create --from "news@domain.com" --subject "Update" --segment-id < id
--html "
Hi
" --send CI/CD (no login needed): RESEND_API_KEY = re_xxx resend emails send --from .. . --to .. . --subject .. . --text .. . Check environment health: resend doctor -q When to Load References Sending or reading emails → references/emails.md Setting up or verifying a domain → references/domains.md Managing API keys → references/api-keys.md Creating or sending broadcasts → references/broadcasts.md Managing contacts, segments, or topics → references/contacts.md , references/segments.md , references/topics.md Defining contact properties → references/contact-properties.md Working with templates → references/templates.md Viewing API request logs → references/logs.md Creating automations or sending events → references/automations.md Setting up webhooks or listening for events → references/webhooks.md Auth, profiles, or health checks → references/auth.md Multi-step recipes (setup, CI/CD, broadcast workflow) → references/workflows.md Command failed with an error → references/error-codes.md Resend SDK integration (Node.js, Python, Go, etc.) → Install the resend skill AI agent email inbox → Install the agent-email-inbox skill