The Resend CLI works out of the box for AI agents and CI/CD pipelines. This page covers agent-specific behavior — see the CLI reference for installation, commands, and full documentation.Documentation Index
Fetch the complete documentation index at: https://resend.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
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:Non-interactive mode
When the CLI detects a non-TTY environment (piped output, CI runner, or the--json flag), it automatically switches to machine-readable mode:
- Output: JSON to stdout, no progress indicators
- Exit codes:
0for success,1for errors - Errors: Always include
messageandcodefields
Piping from stdin
Agents generate content on the fly. Pass- to read from stdin instead of writing temp files:
--html-file - on send and --file - on batch commands.
Batch sending
Send up to 100 emails in a single request by piping a JSON array intoemails batch:
Safe retries
Add--idempotency-key to prevent duplicates when your agent retries a failed request:
emails send and emails batch.
Scheduling
The--scheduled-at flag accepts ISO 8601 timestamps and natural language:
resend emails cancel <id> and resend emails update <id> --scheduled-at <datetime>.
Reading inbound emails
Agents can process incoming email as an input source. Stream inbound emails as NDJSON withemails receiving listen:
Closing the loop with webhooks
When an agent sends an email, it often needs to know what happened next — was it delivered, did it bounce, did the recipient reply? Thewebhooks listen command gives your agent a real-time feedback loop by streaming webhook events directly to the terminal.
Ctrl+C). Use --forward-to to pipe payloads to a local server for processing:
--url flag takes any public URL that points to the local server port (4318 by default). Use any tunnel — Tailscale Funnel, ngrok, localtunnel, etc.