termail
npx machina-cli add skill lu-zhengda/macos-toolkit/termail --openclawtermail — Terminal Email Client
Sync and list recent email threads:
!termail sync 2>&1 && termail list --limit 5 2>&1 || echo "termail not installed — brew install lu-zhengda/tap/termail"
Analyze the output above. Summarize unread threads (marked with *), highlight anything that looks urgent or time-sensitive, and offer to read specific threads with termail read <thread-id>, reply, compose, or search. If sync fails with a credentials error, guide the user through termail account add.
Commands — Reading
| Command | Purpose | Example |
|---|---|---|
termail list | List email threads | termail list --limit 20 |
termail list --label <label> | Filter by label | termail list --label SENT --limit 10 |
termail list --account <email> | List from a specific account | termail list --account work@gmail.com |
termail read <thread-id> | Read a full thread | termail read 19c5d4f2ea3c4478 |
termail search "<query>" | Full-text search (FTS5) | termail search "quarterly report" |
termail search --account <email> | Search a specific account | termail search "invoice" --account work@gmail.com |
termail labels | List all labels | termail labels |
Commands — Composing
| Command | Purpose | Example |
|---|---|---|
termail compose | Send a new email | termail compose --to user@example.com --subject "Hi" --body "Hello" |
termail reply <message-id> | Reply to a message | termail reply <message-id> --body "Thanks!" |
termail reply <message-id> --all | Reply all | termail reply <message-id> --body "Thanks!" --all |
termail forward <message-id> | Forward a message | termail forward <message-id> --to other@example.com |
Commands — Organizing
| Command | Purpose | Example |
|---|---|---|
termail archive <message-id> | Archive (remove from Inbox) | termail archive <message-id> |
termail trash <message-id> | Move to trash | termail trash <message-id> |
termail star <message-id> | Star a message | termail star <message-id> |
termail star <message-id> --remove | Unstar a message | termail star <message-id> --remove |
termail mark-read <message-id> | Mark as read | termail mark-read <message-id> |
termail mark-read <message-id> --unread | Mark as unread | termail mark-read <message-id> --unread |
termail label-modify <id> | Add/remove labels | termail label-modify <id> --add STARRED --remove INBOX |
Commands — Accounts & Sync
| Command | Purpose | Example |
|---|---|---|
termail account list | List configured accounts | termail account list |
termail account add | Add a Gmail account (opens browser for OAuth) | termail account add |
termail account remove <email> | Remove an account | termail account remove user@gmail.com |
termail sync | Sync emails for all accounts | termail sync |
termail sync --account <email> | Sync a specific account | termail sync --account user@gmail.com |
Multi-Account
termail supports multiple Gmail accounts. Use --account <email> with list, search, and sync to target a specific account. Without the flag, commands use the default account from config.
Switch accounts in the TUI with @.
Search
Full-text search powered by SQLite FTS5:
termail search "quarterly report"
termail search "from:alice subject:meeting"
Safety Guidelines
- Confirm before sending: Always verify recipients and content before
compose,reply, orforward - Archive over trash: Prefer
archiveto keep emails accessible; usetrashonly for unwanted mail - Sync before reading: Run
termail syncto fetch the latest emails before reading or searching - OAuth tokens are secure: Tokens are stored in the OS keyring (macOS Keychain), never in plain files
TUI Mode
Launch termail without arguments for an interactive email dashboard with keyboard navigation.
Source
git clone https://github.com/lu-zhengda/macos-toolkit/blob/main/skills/termail/SKILL.mdView on GitHub Overview
termail is a terminal-based email client that can sync and list recent threads, read messages, compose, reply, forward, and manage Gmail labels. It supports multi-account setups, per-account syncing, and SQLite FTS5-powered search to speed inbox management from the command line.
How This Skill Works
Users run termail commands to interact with Gmail from the terminal. It supports syncing, listing, reading, composing, and organizing across one or more accounts, with per-account targeting via the --account flag. Account addition uses OAuth in a browser via termail account add, and search uses SQLite FTS5 for fast full-text queries.
When to Use It
- Check your inbox quickly and identify unread or urgent threads.
- Read a full thread with termail read <thread-id>.
- Compose a new email or reply/forward an existing one.
- Search emails for keywords or phrases using termail search.
- Manage multiple Gmail accounts with sync, list, and account switching.
Quick Start
- Step 1: termail account add
- Step 2: termail sync
- Step 3: termail list --limit 5
Best Practices
- Always specify the target account with --account when working across multiple accounts.
- Use termail list --limit <n> to keep results manageable and focused.
- Leverage termail search with quotes to filter exact phrases (e.g., "quarterly report").
- Use termail label-modify to add or remove labels and keep Inbox tidy.
- When adding accounts, complete the OAuth flow with termail account add to avoid credential errors.
Example Use Cases
- termail sync --account work@gmail.com
- termail list --limit 5
- termail read 19c5d4f2ea3c4478
- termail compose --to team@example.com --subject 'Meeting' --body 'Let's meet Friday'
- termail search 'invoice' --account work@gmail.com