gmail
Send, search, and organize Gmail messages, drafts, and labels. Read full threads and get shareable Google Groups permalinks. Use when asked to compose an email, reply to mail, forward a message, search inbox, manage attachments, organize Gmail, read a thread, or find a Google Groups discussion link.
What this skill does
# Gmail
Interact with Gmail for email management, search, and organization.
## Installation
**Dependencies**: `pip install --user google-auth google-auth-oauthlib google-api-python-client keyring pyyaml`
## Setup Verification
After installation, verify the skill is properly configured:
```bash
$SKILL_DIR/scripts/gmail.py check
```
This will check:
- Python dependencies (google-auth, google-auth-oauthlib, google-api-python-client, keyring, pyyaml)
- Authentication configuration
- Connectivity to Gmail API
If anything is missing, the check command will provide setup instructions.
## Authentication
Gmail uses OAuth 2.0 for authentication. For complete setup instructions, see:
1. [GCP Project Setup Guide](https://github.com/odyssey4me/agent-skills/blob/main/docs/gcp-project-setup.md) - Create project, enable Gmail API
2. [Google OAuth Setup Guide](https://github.com/odyssey4me/agent-skills/blob/main/docs/google-oauth-setup.md) - Configure credentials
### Quick Start
1. Create `~/.config/agent-skills/google.yaml`:
```yaml
oauth_client:
client_id: your-client-id.apps.googleusercontent.com
client_secret: your-client-secret
```
2. Run `$SKILL_DIR/scripts/gmail.py check` to trigger OAuth flow and verify setup.
On scope or authentication errors, see the [OAuth troubleshooting guide](https://github.com/odyssey4me/agent-skills/blob/main/docs/google-oauth-setup.md#troubleshooting).
## Commands
See [permissions.md](references/permissions.md) for read/write classification of each command.
### check
Verify configuration and connectivity.
```bash
$SKILL_DIR/scripts/gmail.py check
```
This validates:
- Python dependencies are installed
- Authentication is configured
- Can connect to Gmail API
- Displays your email address and mailbox statistics
### auth setup
Store OAuth 2.0 client credentials for custom OAuth flow.
```bash
$SKILL_DIR/scripts/gmail.py auth setup \
--client-id YOUR_CLIENT_ID \
--client-secret YOUR_CLIENT_SECRET
```
Credentials are saved to `~/.config/agent-skills/gmail.yaml`.
### auth reset
Clear stored OAuth token. The next command that needs authentication will trigger re-authentication automatically.
```bash
$SKILL_DIR/scripts/gmail.py auth reset
```
Use this when you encounter scope or authentication errors.
### auth status
Show current OAuth token information without making API calls.
```bash
$SKILL_DIR/scripts/gmail.py auth status
```
Displays: whether a token is stored, granted scopes, refresh token presence, token expiry, and client ID.
### messages list
List messages matching a query.
```bash
# List recent messages
$SKILL_DIR/scripts/gmail.py messages list
# Search for unread messages
$SKILL_DIR/scripts/gmail.py messages list --query "is:unread"
# Search with max results
$SKILL_DIR/scripts/gmail.py messages list --query "from:[email protected]" --max-results 20
```
**Arguments:**
- `--query`: Gmail search query (optional)
- `--max-results`: Maximum number of results (default: 10)
**Search Query Examples:**
For complete Gmail search syntax, see [gmail-queries.md](references/gmail-queries.md).
Common queries:
- `is:unread` - Unread messages
- `from:[email protected]` - Messages from sender
- `subject:meeting` - Messages with subject keyword
- `has:attachment` - Messages with attachments
- `after:2024/01/01` - Messages after date
- `label:important` - Messages with label
### messages get
Get a message by ID.
```bash
# Get full message
$SKILL_DIR/scripts/gmail.py messages get MESSAGE_ID
# Get minimal format
$SKILL_DIR/scripts/gmail.py messages get MESSAGE_ID --format minimal
```
**Arguments:**
- `message_id`: The message ID (required)
- `--format`: Message format (full, minimal, raw, metadata) - default: full
### messages mark-read
Mark one or more messages as read by removing the UNREAD label.
```bash
# Mark a single message
$SKILL_DIR/scripts/gmail.py messages mark-read MESSAGE_ID
# Mark multiple messages
$SKILL_DIR/scripts/gmail.py messages mark-read MSG1 MSG2 MSG3
# Mark all unread messages from a sender
$SKILL_DIR/scripts/gmail.py messages mark-read --query "is:unread from:[email protected]"
# Combine IDs and query
$SKILL_DIR/scripts/gmail.py messages mark-read MSG1 --query "is:unread label:updates"
```
**Arguments:**
- `message_ids`: One or more message IDs (optional if `--query` is used)
- `--query`: Gmail search query to find messages to mark as read
- `--max-results`: Maximum messages to mark from `--query` (default: 100)
### threads get
Get a full conversation thread with all messages displayed chronologically. For messages from Google Groups, includes shareable permalinks using the `d/msgid` URL format.
```bash
# Get full thread
$SKILL_DIR/scripts/gmail.py threads get THREAD_ID
```
**Arguments:**
- `thread_id`: The thread ID (required)
### send
Send an email message.
```bash
# Send simple email
$SKILL_DIR/scripts/gmail.py send \
--to [email protected] \
--subject "Hello" \
--body "This is the message body"
# Send with CC and BCC
$SKILL_DIR/scripts/gmail.py send \
--to [email protected] \
--subject "Team Update" \
--body "Here's the update..." \
--cc [email protected] \
--bcc [email protected]
```
```bash
# Send from a markdown file with frontmatter
$SKILL_DIR/scripts/gmail.py send --from-file update.md
# Send from file with CLI overrides
$SKILL_DIR/scripts/gmail.py send --from-file update.md --to [email protected]
# Reply to a message in-thread
$SKILL_DIR/scripts/gmail.py send --reply-to MESSAGE_ID --body "Thanks, got it."
```
**Arguments:**
- `--to`: Recipient email address (required unless in `--from-file` or `--reply-to`)
- `--subject`: Email subject (required unless in `--from-file` or `--reply-to`)
- `--body`: Email body text (required unless in `--from-file`)
- `--from-file`: Markdown file with YAML frontmatter (see format below)
- `--cc`: CC recipients (comma-separated)
- `--bcc`: BCC recipients (comma-separated)
- `--reply-to`: Message ID to reply to (sends in-thread, auto-fills to/subject)
CLI flags override frontmatter values. When using `--from-file`, the markdown
body is converted to HTML and sent as multipart/alternative (HTML + plain text
fallback).
**Markdown file format:**
```markdown
---
to: [email protected]
cc: [email protected]
bcc: [email protected]
subject: Weekly Update
---
# Status Update
Here's what happened this week:
- **Feature A** shipped to production
- Fixed the [login bug](https://jira.example.com/DEMO-123)
| Task | Status |
|------|--------|
| Deploy | Done |
```
### drafts list
List draft messages.
```bash
# List drafts
$SKILL_DIR/scripts/gmail.py drafts list
# List with custom max results
$SKILL_DIR/scripts/gmail.py drafts list --max-results 20
```
**Arguments:**
- `--max-results`: Maximum number of results (default: 10)
### drafts create
Create a draft email.
```bash
# Create draft
$SKILL_DIR/scripts/gmail.py drafts create \
--to [email protected] \
--subject "Draft Subject" \
--body "This is a draft message"
# Create draft with CC
$SKILL_DIR/scripts/gmail.py drafts create \
--to [email protected] \
--subject "Meeting Notes" \
--body "Notes from today's meeting..." \
--cc [email protected]
# Create a reply draft in-thread
$SKILL_DIR/scripts/gmail.py drafts create --reply-to MESSAGE_ID --body "I'll look into this."
```
```bash
# Create draft from a markdown file
$SKILL_DIR/scripts/gmail.py drafts create --from-file update.md
```
**Arguments:**
- `--to`: Recipient email address (required unless in `--from-file`)
- `--subject`: Email subject (required unless in `--from-file`)
- `--body`: Email body text (required unless in `--from-file`)
- `--from-file`: Markdown file with YAML frontmatter (same format as `send`)
- `--cc`: CC recipients (comma-separated)
- `--bcc`: BCC recipients (comma-separated)
### drafts send
Send a draft message.
```bash
# Send draft by ID
$SKILL_DIR/scripts/gmail.py drafts send DRAFT_ID
```
**Arguments:**
- `draft_id`: The dRelated in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard — shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.