email-cli-tool
A simple CLI tool for sending emails with plain text, HTML, and file attachments.
Features
- Send plain text / HTML / mixed format emails
- Attach multiple files and images
- Multiple recipients support
- Direct SMTP connection (SSL / STARTTLS)
- Interactive configuration wizard
- Read body content from stdin
- Wait for the next incoming email (IMAP) and download its attachments
Installation
# From PyPI (latest)
pip install email-cli-tool
# Install a specific version
pip install email-cli-tool==0.2.0
# Upgrade an existing install
pip install --upgrade email-cli-tool
# Or with uv
uv tool install email-cli-tool # latest
uv tool install email-cli-tool==0.2.0 # specific version
The
emailcli skill installcommand requires version 0.2.0 or newer.
Quick Start
1. Initialize Configuration
emailcli init
Follow the prompts to enter your SMTP settings. Example for Gmail:
| Field | Value |
|---|---|
| From address | yourname@gmail.com |
| SMTP host | smtp.gmail.com |
| SMTP port | 465 |
| SMTP username | yourname@gmail.com |
| SMTP password | App password |
| Encryption | ssl |
2. Send Emails
# Plain text
emailcli send --to user@example.com --subject "Hello" --body "Hello World"
# HTML format
emailcli send --to user@example.com --subject "Notice" \
--html "<h1>Title</h1><p>Body content</p>"
# With attachments
emailcli send --to user@example.com --subject "Report" \
--body "Please see attachments" \
--attach report.pdf \
--attach photo.png
# Multiple recipients
emailcli send \
--to a@example.com \
--to b@example.com \
--subject "Broadcast" --body "Hello everyone"
# HTML body from file
emailcli send --to user@example.com --subject "Newsletter" \
--html-file template.html
# Read body from stdin
echo "Content" | emailcli send \
--to user@example.com --subject "Piped" --body -
3. Wait for Incoming Email
# Block until the next email arrives, print it, then exit
emailcli watch
# Wait up to 5 minutes and save attachments
emailcli watch --timeout 300 --save-attachments ./downloads
Requires IMAP settings — emailcli init asks for them, or add an imap section to the config (see below).
Command Reference
emailcli send
| Option | Required | Repeatable | Description |
|---|---|---|---|
--to |
✅ | ✅ | Recipient email address |
--subject |
✅ | Email subject | |
--body |
Plain text body, - reads from stdin |
||
--html |
HTML body string (mutually exclusive with --html-file) |
||
--html-file |
Read HTML body from file (mutually exclusive with --html) |
||
--attach |
✅ | Attachment file path | |
--from |
Override sender address from config |
At least one of
--body,--html, or--html-fileis required.
emailcli watch
Wait for the next incoming email (via IMAP polling), print headers and body to stdout, then exit. Only emails arriving after the command starts are matched; the received email is marked as read.
| Option | Default | Description |
|---|---|---|
--timeout |
0 (wait forever) |
Max seconds to wait; exits with code 2 on timeout |
--poll-interval |
10 |
Seconds between mailbox checks |
--save-attachments |
Directory to save attachments into | |
--mailbox |
INBOX |
Mailbox to watch |
emailcli init
Interactively create the configuration file at ~/.emailcli/config.yaml.
emailcli config show
Display current configuration (password is masked).
emailcli skill install
Install the send-email and wait-email agent skills so Claude Code or Codex can send and receive mail for you.
# Install for both Claude Code and Codex (default)
emailcli skill install
# Only one agent
emailcli skill install --target claude
emailcli skill install --target codex
Writes each skill's SKILL.md under ~/.claude/skills/ and/or ~/.codex/skills/.
Configuration
Path: ~/.emailcli/config.yaml
from: yourname@gmail.com
smtp:
host: smtp.gmail.com
port: 465
username: yourname@gmail.com
password: your-app-password
encryption: ssl # ssl | starttls | none
# Optional, only needed for `emailcli watch`
imap:
host: imap.gmail.com
port: 993 # default: 993
encryption: ssl # default: ssl
# username/password default to the smtp values
Development
# Install dependencies
uv sync
# Run tests
uv run pytest -v
# Run locally
uv run emailcli --help
License
MIT
Metadata
Release files for email-cli-tool 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| email_cli_tool-0.3.2.tar.gz | 48.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| email_cli_tool-0.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 64.8 kB
Release files / email_cli_tool-0.3.2.tar.gz
| Download URL | email_cli_tool-0.3.2.tar.gz |
|---|---|
| Size | 48.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d6772048384f6e3baea4059482fadbcd023ccfbf1681cc2546a489f2dd51ca71
|
|
BLAKE2b-256 checksum How to use checksums |
a8769afab7d8dff6a048fdba5aca8cc5b4287a369450d79b72f3964903b61614
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logRelease files / email_cli_tool-0.3.2-py3-none-any.whl
| Download URL | email_cli_tool-0.3.2-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9c0a989cefb361944ffc90809f23d93d6bcb02f81abf2365d829fa3956d80e04
|
|
BLAKE2b-256 checksum How to use checksums |
04fb4982820856f9aa9b50321f44e3d78a2565613e4ab06e62ee784e67e3b24d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency log