| name | email |
| description | Send emails via CLI. Use when the user asks to send an email, compose a message, or needs email functionality. Supports AgentMail, Google Workspace, Proton Mail, and generic SMTP. |
Email CLI
Send emails using the email-cli command.
Quick Start
email-cli send -t recipient@example.com -s "Subject" -m "Message body"
email-cli send -t user@example.com -s "Report" -m "See attached" -a report.pdf
echo "Generated content" | email-cli send -t user@example.com -s "Report"
Common Patterns
Send to multiple recipients
email-cli send -t a@example.com -t b@example.com -s "Team Update" -m "Hello team"
HTML email
email-cli send -t user@example.com -s "Newsletter" -m "<h1>Hello</h1>" --html
Use specific provider
email-cli send -p work -t user@example.com -s "Subject" -m "Body"
Configuration
Before sending, a provider must be configured. Check existing config:
email-cli config list
Recommended decision order (for agents)
- AgentMail first — easiest, just needs API key + inbox ID
- For existing email accounts, try SMTP
- For Gmail, prefer
smtp.gmail.com with an App Password
- Only use Google API OAuth if the user explicitly asks for Gmail API/OAuth
- Use Proton only for Proton Mail Bridge users
Add provider (non-interactive, for agents)
AgentMail (easiest - no OAuth, no app passwords):
email-cli config add --name agent \
--type agentmail \
--api-key "am_..." \
--inbox-id "myagent@agentmail.to" \
--default
Get API key and create inbox at agentmail.to. Free tier: 3 inboxes, 3k emails/month.
Gmail (lowest friction for existing accounts):
email-cli config add --name gmail-smtp \
--type smtp \
--from me@gmail.com \
--host smtp.gmail.com \
--port 587 \
--username me@gmail.com \
--password "$GMAIL_APP_PASSWORD" \
--tls \
--default
If user does not have an app password yet:
- Ask them to enable 2-Step Verification.
- Ask them to generate an app password at
https://myaccount.google.com/apppasswords.
- Then run the command above.
SMTP:
email-cli config add --name mymail \
--type smtp \
--from me@example.com \
--host smtp.example.com \
--port 587 \
--username me@example.com \
--password "password" \
--tls
Proton Mail:
email-cli config add --name proton \
--type proton \
--from me@proton.me \
--username me@proton.me \
--password "bridge-password"
Google API (only when explicitly requested):
email-cli config add --name google \
--type google \
--from me@gmail.com \
--client-id "xxx.apps.googleusercontent.com" \
--client-secret "xxx"
Update config
email-cli config set mymail password "new-password"
email-cli config set agent api-key "new-api-key"
email-cli config add --name agent --type agentmail --api-key "am_..." --inbox-id "x@agentmail.to" --use-keychain
email-cli config set --use-keychain mymail password "new-password"
View config as JSON
email-cli config show
email-cli config show mymail
email-cli config show --show-secrets
email-cli config show --show-secrets mymail
Exit Codes
0 = Success
1 = Error (check stderr for details)
Reference
See reference.md for complete API documentation.