Unofficial CLI for Resend email API
npm install @mjrussell/resend-cli


> Unofficial CLI for Resend — Not affiliated with or endorsed by Resend.
A command-line interface for the Resend email API for managing received (inbound) emails and attachments.
- List and view received emails
- View email attachments
- JSON output for scripting
- Simple environment-based configuration
``bash`
npm install -g @mjrussell/resend-cli
`bash`
git clone https://github.com/mjrussell/resend-cli.git
cd resend-cli
npm install
npm run build
npm install -g .
Set your Resend API key as an environment variable:
`bash`
export RESEND_API_KEY="re_your_api_key_here"
1. Sign up at resend.com
2. Set up inbound email routing for your domain
3. Go to API Keys → Create API key (needs read permissions)
4. Store securely (e.g., in your shell profile or a secrets manager)
`bashList received emails
resend email list
Commands
$3
List received (inbound) emails (default: 10 most recent).
| Option | Description |
|--------|-------------|
|
-j, --json | Output as JSON |
| -l, --limit | Number of emails (default: 10) |$3
Get details for a received email (from, to, subject, text, html).
| Option | Description |
|--------|-------------|
|
-j, --json | Output as JSON |$3
List all attachments for a received email.
| Option | Description |
|--------|-------------|
|
-j, --json | Output as JSON |$3
Get metadata for a specific attachment.
| Option | Description |
|--------|-------------|
|
-j, --json | Output as JSON |
| -o, --output | Output path (metadata only) |Examples
`bash
List 5 most recent emails
resend email list --limit 5Get the most recent email ID
EMAIL_ID=$(resend email list --json | jq -r '.data.data[0].id')Get email details
resend email get $EMAIL_IDCheck attachment count
resend email attachments $EMAIL_ID --json | jq '.data.data | length'
`Environment Variables
| Variable | Description | Required |
|----------|-------------|----------|
|
RESEND_API_KEY | Your Resend API key | Yes |Exit Codes
| Code | Description |
|------|-------------|
|
0 | Success |
| 1 | API error or generic failure |
| 2 | Invalid usage or missing API key |Development
`bash
git clone https://github.com/mjrussell/resend-cli.git
cd resend-cli
npm install
npm run build # Build the CLI
npm run dev # Run with tsx (dev mode)
npm run watch # Watch mode with tsup
npm run typecheck # Type check without emitting
`Roadmap
- [ ] Send emails (
resend email send)
- [ ] Domain management (resend domain list)
- [ ] Actual attachment file downloads
- [ ] Pagination supportContributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (
git checkout -b feature/amazing-feature)
3. Commit your changes (git commit -m 'Add amazing feature')
4. Push to the branch (git push origin feature/amazing-feature`)MIT © Matt Russell
This is an unofficial tool. Resend is a trademark of Resend Inc.