tnm avatar

email-cli

Send emails via Google Workspace, Proton Mail, or SMTP

version
1.0.0
GitHub stars
8

Install

/plugin install email-cli@email-cli

Run it inside Claude Code after adding the marketplace with /plugin marketplace add tnm/email-cli.

Contents

Discovered from source

Skills 1

Email CLI

Send emails using the email-cli command.

Quick Start

# Send a simple email
email-cli send -t recipient@example.com -s "Subject" -m "Message body"

# Send with attachment
email-cli send -t user@example.com -s "Report" -m "See attached" -a report.pdf

# Pipe content from stdin
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)

  1. AgentMail first — easiest, just needs API key + inbox ID
  2. For existing email accounts, try SMTP
  3. For Gmail, prefer smtp.gmail.com with an App Password
  4. Only use Google API OAuth if the user explicitly asks for Gmail API/OAuth
  5. 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"

# Store secrets in macOS Keychain (optional, macOS only)
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                     # redacted by default
email-cli config show mymail              # redacted by default
email-cli config show --show-secrets      # with 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.

Sponsors

Details

Marketplace
tnm/email-cli
Category
Community