Gmail Query Syntax
provos/ironcurtain
Reference for Gmail's search query syntax — operators like is:sent, newerthan:, from:, has:attachment, label:, and how they compose.
Interact with Gmail - search emails, read messages, send emails, create drafts, and manage labels.
$ npx skills add sanjay3290/ai-skills --skill gmail -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install sanjay3290/ai-skills gmail --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/sanjay3290/ai-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/gmail .claude/skills/gmail && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "gmail" agent skill from https://github.com/sanjay3290/ai-skills/tree/main/skills/gmail into .claude/skills/gmail/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gmail", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/sanjay3290/ai-skills/tree/main/skills/gmailType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add sanjay3290/ai-skills --skill gmail -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install sanjay3290/ai-skills gmail --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/sanjay3290/ai-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/gmail .agents/skills/gmail && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "gmail" agent skill from https://github.com/sanjay3290/ai-skills/tree/main/skills/gmail into .agents/skills/gmail/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gmail", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add sanjay3290/ai-skills --skill gmail -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install sanjay3290/ai-skills gmail --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/sanjay3290/ai-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/gmail .cursor/skills/gmail && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "gmail" agent skill from https://github.com/sanjay3290/ai-skills/tree/main/skills/gmail into .cursor/skills/gmail/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gmail", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/sanjay3290/ai-skills.git --path skills/gmail--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add sanjay3290/ai-skills --skill gmail -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install sanjay3290/ai-skills gmail --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/sanjay3290/ai-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/gmail .gemini/skills/gmail && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "gmail" agent skill from https://github.com/sanjay3290/ai-skills/tree/main/skills/gmail into .gemini/skills/gmail/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gmail", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install sanjay3290/ai-skills gmailInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add sanjay3290/ai-skills --skill gmail -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/sanjay3290/ai-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/gmail .github/skills/gmail && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "gmail" agent skill from https://github.com/sanjay3290/ai-skills/tree/main/skills/gmail into .github/skills/gmail/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gmail", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add sanjay3290/ai-skills --skill gmail -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install sanjay3290/ai-skills gmail --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/sanjay3290/ai-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/gmail .opencode/skills/gmail && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "gmail" agent skill from https://github.com/sanjay3290/ai-skills/tree/main/skills/gmail into .opencode/skills/gmail/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gmail", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
gmailInteract with Gmail - search emails, read messages, send emails, create drafts, and manage labels.
Gmail is an agent skill from sanjay3290/ai-skills. Interact with Gmail - search emails, read messages, send emails, create drafts, and manage labels. Use when user asks to: search email, read email, send email, create email draft, mark as read, archive email, star email, or manage Gmail labels. Lightweight alternative to full Google Workspace MCP server with standalone OAuth authentication.
Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts (for example `README.md`, `scripts/auth.py` and `scripts/gmail.py`).
It sits in Productivity & Automation, covering Email management and Cloud office suites. It works with Gmail, Model Context Protocol and Google Workspace. The repository describes itself as: 24 cross-platform agent skills for Claude Code, Cursor, Codex & Gemini CLI — databases, messaging, research, TTS, DevOps, and Google Workspace. The licence is Apache-2.0.
Read from SKILL.md and the folder at commit 281d88d. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 3 files in scripts/ (Python), which the agent can run.
Shell commands in SKILL.md call:
pythonFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Gmail loads about 1.2k tokens when it runs. Until then it costs about 87 tokens; SKILL.md has 205 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from sanjay3290/ai-skills at commit 281d88d, republished under its Apache-2.0 licence (© sanjay3290). 205 words, ~1,237 tokens.
.claude/skills/gmail/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.Lightweight Gmail integration with standalone OAuth authentication. No MCP server required.
⚠️ Requires Google Workspace account. Personal Gmail accounts are not supported.
Authenticate with Google (opens browser):
python scripts/auth.py loginCheck authentication status:
python scripts/auth.py statusLogout when needed:
python scripts/auth.py logoutAll operations via scripts/gmail.py. Auto-authenticates on first use if not logged in.
# Search with Gmail query syntax
python scripts/gmail.py search "from:someone@example.com is:unread"
# Search recent emails (no query returns all)
python scripts/gmail.py search --limit 20
# Filter by label
python scripts/gmail.py search --label INBOX --limit 10
# Include spam and trash
python scripts/gmail.py search "subject:important" --include-spam-trash# Get full message content
python scripts/gmail.py get MESSAGE_ID
# Get just metadata (headers)
python scripts/gmail.py get MESSAGE_ID --format metadata
# Get minimal response (IDs only)
python scripts/gmail.py get MESSAGE_ID --format minimal# Send a simple email
python scripts/gmail.py send --to "user@example.com" --subject "Hello" --body "Message body"
# Send with CC and BCC
python scripts/gmail.py send --to "user@example.com" --cc "cc@example.com" --bcc "bcc@example.com" \
--subject "Team Update" --body "Update message"
# Send from an alias (must be configured in Gmail settings)
python scripts/gmail.py send --to "user@example.com" --subject "Hello" --body "Message" \
--from "Mile9 Accounts <accounts@mile9.io>"
# Send HTML email
python scripts/gmail.py send --to "user@example.com" --subject "HTML Email" \
--body "<h1>Hello</h1><p>HTML content</p>" --html# Create a draft
python scripts/gmail.py create-draft --to "user@example.com" --subject "Draft Subject" \
--body "Draft content"
# Send an existing draft
python scripts/gmail.py send-draft DRAFT_ID# Mark as read (remove UNREAD label)
python scripts/gmail.py modify MESSAGE_ID --remove-label UNREAD
# Mark as unread
python scripts/gmail.py modify MESSAGE_ID --add-label UNREAD
# Archive (remove from INBOX)
python scripts/gmail.py modify MESSAGE_ID --remove-label INBOX
# Star a message
python scripts/gmail.py modify MESSAGE_ID --add-label STARRED
# Unstar a message
python scripts/gmail.py modify MESSAGE_ID --remove-label STARRED
# Mark as important
python scripts/gmail.py modify MESSAGE_ID --add-label IMPORTANT
# Multiple label changes at once
python scripts/gmail.py modify MESSAGE_ID --remove-label UNREAD --add-label STARRED# List all Gmail labels (system and user-created)
python scripts/gmail.py list-labelsGmail supports powerful search operators:
| Query | Description |
|---|---|
from:user@example.com | Emails from a specific sender |
to:user@example.com | Emails to a specific recipient |
subject:meeting | Emails with "meeting" in subject |
is:unread | Unread emails |
is:starred | Starred emails |
is:important | Important emails |
has:attachment | Emails with attachments |
after:2024/01/01 | Emails after a date |
before:2024/12/31 | Emails before a date |
newer_than:7d | Emails from last 7 days |
older_than:1m | Emails older than 1 month |
label:work | Emails with a specific label |
in:inbox | Emails in inbox |
in:sent | Sent emails |
in:trash | Trashed emails |
Combine with AND (space), OR, or - (NOT):
python scripts/gmail.py search "from:boss@company.com is:unread newer_than:1d"
python scripts/gmail.py search "subject:urgent OR subject:important"
python scripts/gmail.py search "from:newsletter@example.com -is:starred"| Label | ID |
|---|---|
| Inbox | INBOX |
| Sent | SENT |
| Drafts | DRAFT |
| Spam | SPAM |
| Trash | TRASH |
| Starred | STARRED |
| Important | IMPORTANT |
| Unread | UNREAD |
Tokens stored securely using the system keyring:
Service name: gmail-skill-oauth
Tokens automatically refresh when expired using Google's cloud function.
© sanjay3290, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 5 other files (scripts) in skills/gmail of sanjay3290/ai-skills.
Open the folder on GitHubat commit 281d88d
Gmail next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Gmail this skillsanjay3290/ai-skills | 430 | — | ~1.2k | Automated safety check: Pass | Apache-2.0 | |
| Gmail Query Syntaxprovos/ironcurtain | 613 | — | ~971 | Automated safety check: Pass | Apache-2.0 | |
| Apple Mail Setupdavekilleen/Dex | 493 | — | ~2.5k | Automated safety check: Pass | Custom licence | |
| Bootstrap Google Toolsgoogle/adk-recipes | 10k | — | ~5k | Automated safety check: Warn | Apache-2.0 | |
| Gwskv0906/pm-kit | 138 | — | ~1.6k | Automated safety check: Pass | MIT | |
| Google Workspaceswarmclawai/swarmclaw | 687 | — | ~680 | Automated safety check: Pass | MIT |
provos/ironcurtain
Reference for Gmail's search query syntax — operators like is:sent, newerthan:, from:, has:attachment, label:, and how they compose.
davekilleen/Dex
Set up and verify Apple Mail search on macOS, including the search index that silently returns nothing when it was never built.
google/adk-recipes
Install/auth CLIs the sandbox lacks - gws (Drive, Gmail, Sheets, Calendar), gcloud, agents-cli, mcp-cli (MCP servers).
kv0906/pm-kit
This skill should be used when the user asks to "set up gws", "install Google Workspace CLI", "connect Gmail to Claude", "manage Google Drive from terminal", "send email from CLI", "check my…
swarmclawai/swarmclaw
Use Google Workspace CLI (gws) for Drive, Docs, Sheets, Gmail, Calendar, Chat, and related Workspace API tasks.
hoodini/ai-agents-skills
Interact with all Google Workspace APIs via the gws CLI. An agent skill from hoodini/ai-agents-skills.
sanjay3290/ai-skills
Execute autonomous multi-step research using Google Gemini Deep Research Agent.
sanjay3290/ai-skills
Generate images using Google Gemini's image generation capabilities.
sanjay3290/ai-skills
Query and manage Google NotebookLM notebooks with persistent profile auth, source sync, batch/multi queries, and structured exports.
sanjay3290/ai-skills
Send and receive WhatsApp messages via the unofficial linked-device client pywhats (pip install pywhats) — pair with QR, send text/images, group chat, read receipts, presence/typing, and a…
sanjay3290/ai-skills
Convert documents and text to audio using ElevenLabs text-to-speech.
sanjay3290/ai-skills
Execute read-only SQL queries against multiple PostgreSQL databases.
Interact with Gmail - search emails, read messages, send emails, create drafts, and manage labels. Gmail is an agent skill from sanjay3290/ai-skills. Interact with Gmail - search emails, read messages, send emails, create drafts, and manage labels.
Gmail fits situations like: user asks to: search email; create email draft; manage Gmail labels.
Run `npx skills add sanjay3290/ai-skills --skill gmail -a claude-code`. Or copy the skill folder (skills/gmail in sanjay3290/ai-skills) into .claude/skills/gmail in your project. Claude Code loads it when a task matches its description.
Run `npx skills add sanjay3290/ai-skills --skill gmail -a codex`. Or copy the skill folder (skills/gmail in sanjay3290/ai-skills) into .agents/skills/gmail in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sanjay3290/ai-skills --skill gmail -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gmail, .gemini/skills/gmail, .github/skills/gmail and .opencode/skills/gmail in your project.
Going by SKILL.md and its folder, Gmail needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Gmail is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.2k tokens (SKILL.md is roughly 4.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Gmail: Gmail Query Syntax (provos/ironcurtain, 613 stars), Apple Mail Setup (davekilleen/Dex, 493 stars), Bootstrap Google Tools (google/adk-recipes, 10k stars) and Gws (kv0906/pm-kit, 138 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
sanjay3290 (a GitHub user) maintains it in sanjay3290/ai-skills, which has 430 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on September 10, 2026.
Source: sanjay3290/ai-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.