| name | mail |
| description | Manage Gmail using gog gmail command-line tool. Search emails, read messages, compose and send emails, manage labels, and perform common email operations. Use when the user needs to check their email, send messages, or work with Gmail. |
Gmail Manager
This skill provides Gmail management capabilities using the gog gmail command-line tool.
Prerequisites
Before using this skill, ensure gog is installed and authenticated:
go install github.com/stephenafamo/gog@latest
gog gmail init
The first time you run gog gmail, it will authenticate with your Google account.
User Configuration
- Default account: set via
GOOGLE_ACCOUNT in ~/.claude/.env
- All gog gmail commands should use
--account $GOOGLE_ACCOUNT flag
- Important emails: When user asks for "important" mail, NEVER use
is:important filter. Instead, search for unread emails, read their content, and intelligently prioritize based on context (e.g., customer messages, time-sensitive requests, personal communications vs newsletters/promotions)
- Label for action items: Use
!2do label to mark emails requiring action
Core Capabilities
1. List/Search Emails
To list or search emails:
gog gmail search --account $GOOGLE_ACCOUNT ""
gog gmail search --account $GOOGLE_ACCOUNT "query"
gog gmail search --account $GOOGLE_ACCOUNT "is:unread"
gog gmail search --account $GOOGLE_ACCOUNT "in:inbox"
2. Read Email
To read a specific email:
gog gmail thread get --account="$GOOGLE_ACCOUNT" <threadId>
gog gmail messages search --account="$GOOGLE_ACCOUNT" "from:sender@example.com"
3. Send Email
To send a new email:
gog gmail send --account $GOOGLE_ACCOUNT --to "recipient@example.com" --subject "Subject" --body "Message body"
gog gmail send --account $GOOGLE_ACCOUNT --to "recipient@example.com" --subject "Subject" --body "Message body" --attach "/path/to/file.pdf"
gog gmail send --account $GOOGLE_ACCOUNT --to "recipient@example.com" --subject "Subject" --body "Message body" --attach "/path/to/cv.pdf" --attach "/path/to/cover.pdf"
gog gmail send --account $GOOGLE_ACCOUNT --to "recipient@example.com" --cc "cc@example.com" --bcc "bcc@example.com" --subject "Subject" --body "Message"
gog gmail send --account $GOOGLE_ACCOUNT --reply-to-message-id "<message-id>" --reply-all --body "Reply message"
gog gmail send --account $GOOGLE_ACCOUNT --thread-id "<thread-id>" --reply-all --body "Reply message"
IMPORTANT: When replying to emails, always use --reply-to-message-id or --thread-id to keep the conversation threaded. Use --reply-all to automatically populate recipients from the original message.
4. Manage Labels
To manage email labels:
gog gmail labels list --account $GOOGLE_ACCOUNT
gog gmail labels get --account $GOOGLE_ACCOUNT <labelIdOrName>
gog gmail labels create --account $GOOGLE_ACCOUNT <name>
gog gmail labels modify --account="$GOOGLE_ACCOUNT" --add=<label1>,<label2> --remove=<label3> <threadId> ...
gog gmail labels modify --account="$GOOGLE_ACCOUNT" --remove=UNREAD <threadId>
gog gmail labels modify --account="$GOOGLE_ACCOUNT" --add=UNREAD <threadId>
Note: Use thread IDs (not message IDs) for label operations. Thread IDs are returned by gog gmail search commands.
IMPORTANT - --account flag quirk: When --account is followed by another flag (not the thread ID), use --account="$GOOGLE_ACCOUNT" with = syntax, and put threadId(s) at the end. Otherwise the parser treats the next flag as the account value.
5. Trash/Delete Emails
To trash or delete emails:
gog gmail trash <message-id>
gog gmail delete <message-id>
Usage Instructions
When the user requests email operations:
- For viewing emails: Use
gog gmail list or gog gmail search to find messages
- For reading emails: Use
gog gmail read with the message ID
- For sending new emails: Use
gog gmail send with appropriate flags
- For replying to emails: Use
gog gmail send with --reply-to-message-id or --thread-id and --reply-all to keep the conversation threaded
- For managing labels: Use
gog gmail labels and gog gmail label commands
Common Patterns
Check inbox
gog gmail search --account $GOOGLE_ACCOUNT "in:inbox"
Search for emails from a specific sender
gog gmail search --account $GOOGLE_ACCOUNT "from:sender@example.com"
Send a quick email
gog gmail send --account $GOOGLE_ACCOUNT --to "recipient@example.com" --subject "Quick update" --body "Here's the update..."
Reply to an email thread
gog gmail search --account $GOOGLE_ACCOUNT "from:sender@example.com"
gog gmail send --account $GOOGLE_ACCOUNT --reply-to-message-id "19be12f187273072" --reply-all --body "Thanks for your email..."
Error Handling
If gog is not installed:
go install github.com/stephenafamo/gog@latest
If authentication fails:
gog gmail init
Job Application Emails
When applying to jobs via email (e.g. jobs@company.com):
- Read
answers.md and position.md from the lead folder for context.
- Compose using the cover letter from
answers.md as the email body.
- Attach
cv.pdf using --attach /path/to/cv.pdf.
- IMPORTANT:
gog gmail has no draft mode - send sends immediately. Always show the user the full email text and ask for confirmation before sending.
- After sending, update the sheet status to
Applied.
Example:
gog gmail send --account $GOOGLE_ACCOUNT \
--to "jobs@company.com" \
--subject "Product Manager - Your Name" \
--body "..." \
--attach "/path/to/leads/024-company/cv.pdf"
Tips
- Use natural language queries for searching emails
- Message IDs can be obtained from list/search results
- Labels are case-sensitive
- The tool supports Gmail's search operators (from:, to:, subject:, etc.)
- Always use
--reply-to-message-id or --thread-id when replying to emails to keep conversations properly threaded in Gmail
- Use
--reply-all to automatically include all original recipients (To, CC) in your reply
- Attachments: use
--attach /absolute/path/to/file flag (repeatable for multiple files)