SendPigeon CLI: Send Emails From Your Terminal
Send emails, manage templates, stream logs, and run a local dev server - all from the command line.
You're debugging a production issue. Emails aren't delivering, and you need to see what's happening right now. Opening the dashboard, clicking through pages, refreshing... too slow.
npx @sendpigeon-sdk/cli logs tail
One command. Real-time streaming. The SendPigeon CLI brings your email workflow to the terminal.
No install needed:
npx @sendpigeon-sdk/cli <command>
Key commands:
logs tail- Stream logs in real-timesend- Send emails from the terminaltemplates pull/push- Version control your templatesdev- Local email catching server
Why a CLI?
Your SDK handles sending emails from application code. But what about everything else?
Debugging at 2am - Tail logs in real-time without leaving your terminal. Filter by status, watch for bounces, see exactly what's happening.
Template version control - Pull templates to your repo, edit in your IDE, review in PRs, push back. No more copy-pasting between dashboard and code.
Quick tests - Send a test email in 10 seconds without writing code. Check if your domain is verified. Trigger a webhook.
Offline development - Catch emails locally with zero config. No internet, no account, no problem.
Send Emails From the Terminal
No code required. Send emails directly:
sendpigeon send \
--to user@example.com \
--subject "Quick update" \
--html "<p>Just checking in!</p>"
Or use a template:
sendpigeon send \
--to user@example.com \
--template welcome \
--var name=John \
--var company=Acme
Useful for:
- Testing email flows manually
- Sending one-off notifications
- Debugging template rendering
Version Control Your Templates
Templates live in SendPigeon's dashboard, but you want them in git. The CLI bridges the gap.
Pull templates to your repo:
sendpigeon templates pull
This creates a sendpigeon-templates/ directory:
sendpigeon-templates/
welcome/
template.json # Metadata (subject, variables)
content.html # HTML body
content.txt # Plain text
password-reset/
template.json
content.html
Edit locally, then push:
sendpigeon templates push
Now you can:
- Review template changes in PRs
- Roll back to previous versions
- Deploy templates alongside code
- Use your favorite editor
Stream Logs in Real-Time
Watch emails as they're sent:
sendpigeon logs tail
Output:
[12:34:56] ✓ delivered user@example.com "Welcome to Acme"
[12:35:01] ✗ bounced bad@invalid.com "Password Reset"
[12:35:15] → sent another@example.com "Order Confirmation"
Filter by status:
sendpigeon logs tail --status bounced
Perfect for:
- Monitoring production sends
- Debugging delivery issues
- Demos and presentations
Local Development Server
Catch emails locally during development:
sendpigeon dev
This starts:
- HTTP API at
localhost:4100/v1/emails - Web UI at
localhost:4100 - SMTP at
localhost:4125
Set SENDPIGEON_DEV=true and your SDK routes to localhost automatically:
# Terminal 1
sendpigeon dev
# Terminal 2
SENDPIGEON_DEV=true npm run dev
No real emails sent. Ever.
See our local email testing guide for the full setup.
Authentication
Set your API key once:
export SENDPIGEON_API_KEY=sk_live_xxx
Or pass it to any command:
sendpigeon status --api-key sk_live_xxx
The status command shows your account info:
$ sendpigeon status
✓ API key valid
Organization: Acme Inc
Plan: Pro
API Key: sk_live_...xxx (live, full_access)
Usage this period:
1,234 / 50,000 emails (2%)
[██░░░░░░░░░░░░░░░░░░░░░░░░░░░░]
All Commands
| Command | Description |
|---|---|
sendpigeon dev | Local dev server (HTTP + SMTP) |
sendpigeon send | Send an email |
sendpigeon status | Check API key and account |
sendpigeon templates list | List all templates |
sendpigeon templates pull | Download templates locally |
sendpigeon templates push | Upload local templates |
sendpigeon logs | View recent emails |
sendpigeon logs tail | Stream logs in real-time |
sendpigeon webhooks | View webhook config |
sendpigeon webhooks test | Send test webhook |
sendpigeon domains list | List sending domains |
sendpigeon domains verify | Check DNS records |
Get Started
No install needed - use npx:
export SENDPIGEON_API_KEY=sk_live_xxx
npx @sendpigeon-sdk/cli status
Or install globally for shorter commands:
npm install -g @sendpigeon-sdk/cli
sendpigeon status
Read the CLI documentation for the full reference.