gmail-automation by sickn33/antigravity-awesome-skills
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill gmail-automation轻量级 Gmail 集成,具备独立的 OAuth 身份验证。无需 MCP 服务器。
⚠️ 需要 Google Workspace 账户。 不支持个人 Gmail 账户。
使用 Google 进行身份验证(打开浏览器):
python scripts/auth.py login
检查身份验证状态:
python scripts/auth.py status
需要时注销:
python scripts/auth.py logout
所有操作均通过 scripts/gmail.py 进行。如果首次使用时未登录,将自动进行身份验证。
# 使用 Gmail 查询语法搜索
python scripts/gmail.py search "from:someone@example.com is:unread"
# 搜索最近的邮件(无查询则返回所有邮件)
python scripts/gmail.py search --limit 20
# 按标签过滤
python scripts/gmail.py search --label INBOX --limit 10
# 包含垃圾邮件和已删除邮件
python scripts/gmail.py search "subject:important" --include-spam-trash
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# 获取完整的邮件内容
python scripts/gmail.py get MESSAGE_ID
# 仅获取元数据(邮件头)
python scripts/gmail.py get MESSAGE_ID --format metadata
# 获取最小化响应(仅 ID)
python scripts/gmail.py get MESSAGE_ID --format minimal
# 发送简单邮件
python scripts/gmail.py send --to "user@example.com" --subject "Hello" --body "Message body"
# 发送带抄送和密送的邮件
python scripts/gmail.py send --to "user@example.com" --cc "cc@example.com" --bcc "bcc@example.com" \
--subject "Team Update" --body "Update message"
# 从别名发送(必须在 Gmail 设置中配置)
python scripts/gmail.py send --to "user@example.com" --subject "Hello" --body "Message" \
--from "Mile9 Accounts <accounts@mile9.io>"
# 发送 HTML 邮件
python scripts/gmail.py send --to "user@example.com" --subject "HTML Email" \
--body "<h1>Hello</h1><p>HTML content</p>" --html
# 创建草稿
python scripts/gmail.py create-draft --to "user@example.com" --subject "Draft Subject" \
--body "Draft content"
# 发送现有草稿
python scripts/gmail.py send-draft DRAFT_ID
# 标记为已读(移除 UNREAD 标签)
python scripts/gmail.py modify MESSAGE_ID --remove-label UNREAD
# 标记为未读
python scripts/gmail.py modify MESSAGE_ID --add-label UNREAD
# 归档(从收件箱移除)
python scripts/gmail.py modify MESSAGE_ID --remove-label INBOX
# 为邮件加星标
python scripts/gmail.py modify MESSAGE_ID --add-label STARRED
# 取消邮件星标
python scripts/gmail.py modify MESSAGE_ID --remove-label STARRED
# 标记为重要
python scripts/gmail.py modify MESSAGE_ID --add-label IMPORTANT
# 同时进行多个标签更改
python scripts/gmail.py modify MESSAGE_ID --remove-label UNREAD --add-label STARRED
# 列出所有 Gmail 标签(系统和用户创建的)
python scripts/gmail.py list-labels
Gmail 支持强大的搜索运算符:
| 查询 | 描述 |
|---|---|
from:user@example.com | 来自特定发件人的邮件 |
to:user@example.com | 发送给特定收件人的邮件 |
subject:meeting | 主题中包含 "meeting" 的邮件 |
is:unread | 未读邮件 |
is:starred | 已加星标的邮件 |
is:important | 重要邮件 |
has:attachment | 带有附件的邮件 |
after:2024/01/01 | 某个日期之后的邮件 |
before:2024/12/31 | 某个日期之前的邮件 |
newer_than:7d | 最近 7 天内的邮件 |
older_than:1m | 超过 1 个月的邮件 |
label:work | 带有特定标签的邮件 |
in:inbox | 收件箱中的邮件 |
in:sent | 已发送邮件 |
in:trash | 已删除邮件 |
使用 AND(空格)、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"
| 标签 | ID |
|---|---|
| 收件箱 | INBOX |
| 已发送 | SENT |
| 草稿 | DRAFT |
| 垃圾邮件 | SPAM |
| 已删除邮件 | TRASH |
| 已加星标 | STARRED |
| 重要 | IMPORTANT |
| 未读 | UNREAD |
令牌使用系统密钥环安全存储:
服务名称:gmail-skill-oauth
令牌过期时会使用 Google 的云函数自动刷新。
每周安装数
96
代码仓库
GitHub 星标数
27.1K
首次出现
2026年2月9日
安全审计
安装于
opencode94
codex93
gemini-cli92
kimi-cli91
amp91
github-copilot91
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 login
Check authentication status:
python scripts/auth.py status
Logout when needed:
python scripts/auth.py logout
All 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-labels
Gmail 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 |
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 |
Tokens stored securely using the system keyring:
Service name: gmail-skill-oauth
Tokens automatically refresh when expired using Google's cloud function.
Weekly Installs
96
Repository
GitHub Stars
27.1K
First Seen
Feb 9, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode94
codex93
gemini-cli92
kimi-cli91
amp91
github-copilot91
GitHub Actions 官方文档查询助手 - 精准解答 CI/CD 工作流问题
40,500 周安装
数据库性能审计工具 - 协调4大审计工作器,优化持久化与运行时性能
202 周安装
SEO技术审计与优化指南 | Lighthouse SEO审计与Google搜索规范
196 周安装
优良电子账簿合规性诊断工具 - 自动检查税务合规性,满足电子账簿保存法要求
193 周安装
Symfony API Platform DTO资源管理:优化API合约、序列化与安全
196 周安装
agent-fetch:更优的网页抓取工具,支持7种提取策略和浏览器模拟,获取完整文章内容
195 周安装
支付集成专家指南:Stripe/PayPal API集成、Webhook安全与PCI合规最佳实践
95 周安装
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 |
IMPORTANT| Unread | UNREAD |