Mails.dev Email CLI
Email infrastructure for AI agents. Send and receive emails from imclaw@mails.dev.
Configuration
Already configured:
- Mailbox:
imclaw@mails.dev - API key: stored in
~/.mailsrc(configured viamails config set api_key)
Requires bun runtime. Path: ~/.bun/bin/bun
Common Operations
Send Email
export BUN_INSTALL="$HOME/.bun" && export PATH="$BUN_INSTALL/bin:$PATH"
mails send --to <recipient> --subject "<subject>" --body "<message>"
Example:
mails send --to user@example.com --subject "Hello" --body "Test message"
With HTML:
mails send --to user@example.com --subject "Report" --html "<h1>Report</h1><p>Data...</p>"
Check Inbox
mails inbox # List recent emails
mails inbox --mailbox imclaw@mails.dev # List for specific mailbox
mails inbox --query "keyword" # Search emails
mails inbox <id> # Read specific email
mails inbox <id> --save # Save attachments
Verify Email (for confirmation codes)
mails code --to imclaw@mails.dev --timeout 60
Workflows
Automated Report Sending
#!/bin/bash
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
REPORT_DATE=$(date +%Y-%m-%d)
mails send \
--to recipient@example.com \
--subject "Daily Report - $REPORT_DATE" \
--body "See attached report for $REPORT_DATE"
Email Alert Integration
# In cron or automation script
mails send --to imclaw@mails.dev --subject "[Alert] System Issue" --body "Description of issue"
Notes
- Rate limit: 100 emails/month on free tier
- Email IDs are shown as short prefixes (e.g.,
a6d18a3c) - Full ID can be shown with
mails inbox --full-id - Attachments saved with
--saveflag