| name | mail |
| description | Interact with Gmail - list, read, search emails and download attachments. Use when user asks about emails, inbox, or mail-related tasks. |
| user-invocable | true |
| disable-model-invocation | false |
| allowed-tools | Bash, Read |
Mail CLI Skill
Use mail-cli tool to interact with Gmail.
Command Prefix
All commands use uv run:
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli <command>
First-time Setup
Before using mail-cli, you need to:
- Create OAuth2 credentials in Google Cloud Console
- Download the credentials JSON file
- Save it as
~/.config/mail-cli/credentials.json
- Run
mail-cli auth to authenticate
Commands Reference
Authentication
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli auth
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli auth --console
List Emails
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli list
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli list -n 10
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli list -q "from:someone@example.com"
List Unread Emails
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli unread
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli unread -n 5
Read Email
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli read <message_id>
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli read <message_id> --html
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli read <message_id> --mark-read
Search Emails
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli search -q "subject:important"
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli search -q "has:attachment" -n 10
Download Attachments
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli attachments <message_id>
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli attachments <message_id> --all
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli attachments <message_id> --index 1
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli attachments <message_id> --all -o ./downloads
Mark Read/Unread
cd ${CLAUDE_PLUGIN_ROOT}/src && uv run mail-cli mark <message_id>
Request Mapping
When user requests:
- "Check my emails" → Use
list command
- "Do I have new emails?" → Use
unread command
- "Read this email" → Use
read <message_id> command
- "Search for emails from..." → Use
search -q "from:..." command
- "Download attachments" → Use
attachments <message_id> --all command
- "Mark as read/unread" → Use
mark <message_id> command
Gmail Search Query Syntax
Common search operators:
| Operator | Example | Description |
|---|
from: | from:john@example.com | From specific sender |
to: | to:me | Sent to specific recipient |
subject: | subject:meeting | Subject contains word |
has:attachment | has:attachment | Has attachments |
is:unread | is:unread | Unread messages |
is:starred | is:starred | Starred messages |
after: | after:2024/01/01 | After specific date |
before: | before:2024/12/31 | Before specific date |
newer_than: | newer_than:2d | Newer than 2 days |
older_than: | older_than:1w | Older than 1 week |
label: | label:work | Has specific label |
Combine operators: from:john@example.com subject:report has:attachment
$ARGUMENTS contains the user's specific request. Parse it to determine which command to run.