gmail-skill by idanbeck/claude-skills
npx skills add https://github.com/idanbeck/claude-skills --skill gmail-skill读取、搜索和发送 Gmail 电子邮件。访问 Google 联系人。
在发送任何电子邮件之前,您必须获得用户的明确确认。
当用户要求发送电子邮件时:
即使在以下情况下也适用:
始终先确认。没有例外。
首次运行时,脚本将引导您完成设置。您需要创建一次 Google Cloud OAuth 客户端:
gmail.readonly、、、广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
gmail.sendgmail.modifycontacts.readonly~/.claude/skills/gmail-skill/credentials.json然后只需运行任何命令 - 浏览器会打开,您批准,完成。适用于您的所有账户。
注意: 如果您之前使用过 gmail-reader,您需要重新认证以授予新的 gmail.send 范围。
python3 ~/.claude/skills/gmail-skill/gmail_skill.py search "query" [--max-results N] [--account EMAIL]
查询示例:
from:john@example.com - 来自特定发件人subject:meeting after:2026/01/01 - 主题 + 日期has:attachment filename:pdf - 带有 PDF 附件is:unread - 未读邮件"exact phrase" - 精确匹配python3 ~/.claude/skills/gmail-skill/gmail_skill.py read EMAIL_ID [--account EMAIL]
python3 ~/.claude/skills/gmail-skill/gmail_skill.py list [--max-results N] [--label LABEL] [--account EMAIL]
python3 ~/.claude/skills/gmail-skill/gmail_skill.py send --to EMAIL --subject "Subject" --body "Body text" [--cc EMAIL] [--bcc EMAIL] [--account EMAIL]
必需参数:
--to / -t - 收件人电子邮件地址--subject / -s - 电子邮件主题行--body / -b - 电子邮件正文文本可选参数:
--cc - 抄送收件人(逗号分隔)--bcc - 密送收件人(逗号分隔)--account / -a - 从特定账户发送示例:
python3 ~/.claude/skills/gmail-skill/gmail_skill.py send \
--to "recipient@example.com" \
--subject "Meeting Tomorrow" \
--body "Hi, just confirming our meeting at 2pm tomorrow." \
--account work@company.com
python3 ~/.claude/skills/gmail-skill/gmail_skill.py mark-read EMAIL_ID [--account EMAIL]
python3 ~/.claude/skills/gmail-skill/gmail_skill.py mark-unread EMAIL_ID [--account EMAIL]
mark-read 和 mark-unread 都支持多个 ID(逗号分隔):
python3 ~/.claude/skills/gmail-skill/gmail_skill.py mark-read "id1,id2,id3" --account user@gmail.com
通过从收件箱中移除来归档电子邮件。相当于 Gmail 的 'e' 键盘快捷键。
python3 ~/.claude/skills/gmail-skill/gmail_skill.py mark-done EMAIL_ID [--account EMAIL]
将电子邮件移回收件箱(撤销归档)。
python3 ~/.claude/skills/gmail-skill/gmail_skill.py unarchive EMAIL_ID [--account EMAIL]
python3 ~/.claude/skills/gmail-skill/gmail_skill.py star EMAIL_ID [--account EMAIL]
python3 ~/.claude/skills/gmail-skill/gmail_skill.py unstar EMAIL_ID [--account EMAIL]
所有标签命令都支持多个 ID(逗号分隔):
python3 ~/.claude/skills/gmail-skill/gmail_skill.py star "id1,id2,id3" --account user@gmail.com
创建草稿邮件。回复现有邮件时使用 --reply-to-id,以确保在 Superhuman 等电子邮件客户端中正确的对话线程。
python3 ~/.claude/skills/gmail-skill/gmail_skill.py draft --to EMAIL --subject "Subject" --body "Body text" [--reply-to-id EMAIL_ID] [--cc EMAIL] [--bcc EMAIL] [--account EMAIL]
必需参数:
--to / -t - 收件人电子邮件地址--subject / -s - 电子邮件主题行--body / -b - 电子邮件正文文本可选参数:
--reply-to-id / -r - 要回复的邮件 ID(为线程添加正确的 In-Reply-To 和 References 标头)--cc - 抄送收件人(逗号分隔)--bcc - 密送收件人(逗号分隔)--account / -a - 在特定账户中创建草稿示例(新邮件):
python3 ~/.claude/skills/gmail-skill/gmail_skill.py draft \
--to "recipient@example.com" \
--subject "Draft for Review" \
--body "Here's my draft message."
示例(回复现有邮件):
python3 ~/.claude/skills/gmail-skill/gmail_skill.py draft \
--to "sender@example.com" \
--subject "Re: Original Subject" \
--body "Thanks for your email..." \
--reply-to-id 19b99b3127793843 \
--account work@company.com
python3 ~/.claude/skills/gmail-skill/gmail_skill.py labels [--account EMAIL]
python3 ~/.claude/skills/gmail-skill/gmail_skill.py contacts [--max-results N] [--account EMAIL]
python3 ~/.claude/skills/gmail-skill/gmail_skill.py search-contacts "query" [--account EMAIL]
# 列出所有已认证的账户
python3 ~/.claude/skills/gmail-skill/gmail_skill.py accounts
# 移除账户
python3 ~/.claude/skills/gmail-skill/gmail_skill.py logout --account user@gmail.com
通过使用 --account 和新电子邮件添加账户 - 浏览器会为该账户打开:
# 第一个账户(自动认证)
python3 ~/.claude/skills/gmail-skill/gmail_skill.py list
# 添加工作账户
python3 ~/.claude/skills/gmail-skill/gmail_skill.py list --account work@company.com
# 添加个人账户
python3 ~/.claude/skills/gmail-skill/gmail_skill.py list --account personal@gmail.com
# 使用特定账户
python3 ~/.claude/skills/gmail-skill/gmail_skill.py search "from:boss" --account work@company.com
令牌按账户存储在 ~/.claude/skills/gmail-skill/tokens/ 中
python3 ~/.claude/skills/gmail-skill/gmail_skill.py search "is:unread after:2026/01/01"
python3 ~/.claude/skills/gmail-skill/gmail_skill.py read 18d5a3b2c1f4e5d6
python3 ~/.claude/skills/gmail-skill/gmail_skill.py send \
--to "friend@example.com" \
--subject "Hello!" \
--body "Just wanted to say hi."
python3 ~/.claude/skills/gmail-skill/gmail_skill.py search-contacts "John Smith"
python3 ~/.claude/skills/gmail-skill/gmail_skill.py list --account work@company.com --max-results 5
所有命令都输出 JSON 以便于解析。
pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client requests~/.claude/skills/gmail-skill/tokens/每周安装数
219
仓库
GitHub 星标数
7
首次出现
2026 年 1 月 29 日
安全审计
安装于
opencode193
gemini-cli188
codex185
cursor183
github-copilot179
kimi-cli161
Read, search, and send Gmail emails. Access Google contacts.
Before sending ANY email, you MUST get explicit user confirmation.
When the user asks to send an email:
This applies even when:
Always confirm first. No exceptions.
On first run, the script will guide you through setup. You need to create a Google Cloud OAuth client once:
gmail.readonly, gmail.send, gmail.modify, contacts.readonly~/.claude/skills/gmail-skill/credentials.jsonThen just run any command - browser opens, you approve, done. Works for all your accounts.
Note: If you previously used gmail-reader, you'll need to re-authenticate to grant the new gmail.send scope.
python3 ~/.claude/skills/gmail-skill/gmail_skill.py search "query" [--max-results N] [--account EMAIL]
Query examples:
from:john@example.com - from specific sendersubject:meeting after:2026/01/01 - subject + datehas:attachment filename:pdf - with PDF attachmentsis:unread - unread emails"exact phrase" - exact matchpython3 ~/.claude/skills/gmail-skill/gmail_skill.py read EMAIL_ID [--account EMAIL]
python3 ~/.claude/skills/gmail-skill/gmail_skill.py list [--max-results N] [--label LABEL] [--account EMAIL]
python3 ~/.claude/skills/gmail-skill/gmail_skill.py send --to EMAIL --subject "Subject" --body "Body text" [--cc EMAIL] [--bcc EMAIL] [--account EMAIL]
Required arguments:
--to / -t - Recipient email address--subject / -s - Email subject line--body / -b - Email body textOptional arguments:
--cc - CC recipients (comma-separated)--bcc - BCC recipients (comma-separated)--account / -a - Send from specific accountExample:
python3 ~/.claude/skills/gmail-skill/gmail_skill.py send \
--to "recipient@example.com" \
--subject "Meeting Tomorrow" \
--body "Hi, just confirming our meeting at 2pm tomorrow." \
--account work@company.com
python3 ~/.claude/skills/gmail-skill/gmail_skill.py mark-read EMAIL_ID [--account EMAIL]
python3 ~/.claude/skills/gmail-skill/gmail_skill.py mark-unread EMAIL_ID [--account EMAIL]
Both mark-read and mark-unread support multiple IDs (comma-separated):
python3 ~/.claude/skills/gmail-skill/gmail_skill.py mark-read "id1,id2,id3" --account user@gmail.com
Archives email(s) by removing from inbox. Equivalent to Gmail's 'e' keyboard shortcut.
python3 ~/.claude/skills/gmail-skill/gmail_skill.py mark-done EMAIL_ID [--account EMAIL]
Moves email(s) back to inbox (undo archive).
python3 ~/.claude/skills/gmail-skill/gmail_skill.py unarchive EMAIL_ID [--account EMAIL]
python3 ~/.claude/skills/gmail-skill/gmail_skill.py star EMAIL_ID [--account EMAIL]
python3 ~/.claude/skills/gmail-skill/gmail_skill.py unstar EMAIL_ID [--account EMAIL]
All label commands support multiple IDs (comma-separated):
python3 ~/.claude/skills/gmail-skill/gmail_skill.py star "id1,id2,id3" --account user@gmail.com
Creates a draft email. Use --reply-to-id when replying to an existing email to ensure proper threading in email clients like Superhuman.
python3 ~/.claude/skills/gmail-skill/gmail_skill.py draft --to EMAIL --subject "Subject" --body "Body text" [--reply-to-id EMAIL_ID] [--cc EMAIL] [--bcc EMAIL] [--account EMAIL]
Required arguments:
--to / -t - Recipient email address--subject / -s - Email subject line--body / -b - Email body textOptional arguments:
--reply-to-id / -r - Message ID to reply to (adds proper In-Reply-To and References headers for threading)--cc - CC recipients (comma-separated)--bcc - BCC recipients (comma-separated)--account / -a - Create draft in specific accountExample (new email):
python3 ~/.claude/skills/gmail-skill/gmail_skill.py draft \
--to "recipient@example.com" \
--subject "Draft for Review" \
--body "Here's my draft message."
Example (reply to existing email):
python3 ~/.claude/skills/gmail-skill/gmail_skill.py draft \
--to "sender@example.com" \
--subject "Re: Original Subject" \
--body "Thanks for your email..." \
--reply-to-id 19b99b3127793843 \
--account work@company.com
python3 ~/.claude/skills/gmail-skill/gmail_skill.py labels [--account EMAIL]
python3 ~/.claude/skills/gmail-skill/gmail_skill.py contacts [--max-results N] [--account EMAIL]
python3 ~/.claude/skills/gmail-skill/gmail_skill.py search-contacts "query" [--account EMAIL]
# List all authenticated accounts
python3 ~/.claude/skills/gmail-skill/gmail_skill.py accounts
# Remove an account
python3 ~/.claude/skills/gmail-skill/gmail_skill.py logout --account user@gmail.com
Add accounts by using --account with a new email - browser opens for that account:
# First account (auto-authenticates)
python3 ~/.claude/skills/gmail-skill/gmail_skill.py list
# Add work account
python3 ~/.claude/skills/gmail-skill/gmail_skill.py list --account work@company.com
# Add personal account
python3 ~/.claude/skills/gmail-skill/gmail_skill.py list --account personal@gmail.com
# Use specific account
python3 ~/.claude/skills/gmail-skill/gmail_skill.py search "from:boss" --account work@company.com
Tokens are stored per-account in ~/.claude/skills/gmail-skill/tokens/
python3 ~/.claude/skills/gmail-skill/gmail_skill.py search "is:unread after:2026/01/01"
python3 ~/.claude/skills/gmail-skill/gmail_skill.py read 18d5a3b2c1f4e5d6
python3 ~/.claude/skills/gmail-skill/gmail_skill.py send \
--to "friend@example.com" \
--subject "Hello!" \
--body "Just wanted to say hi."
python3 ~/.claude/skills/gmail-skill/gmail_skill.py search-contacts "John Smith"
python3 ~/.claude/skills/gmail-skill/gmail_skill.py list --account work@company.com --max-results 5
All commands output JSON for easy parsing.
pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client requests~/.claude/skills/gmail-skill/tokens/Weekly Installs
219
Repository
GitHub Stars
7
First Seen
Jan 29, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
opencode193
gemini-cli188
codex185
cursor183
github-copilot179
kimi-cli161
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
27,400 周安装