gmail
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGmail & Calendar Skill
Gmail & Calendar Skill
Read, send, search Gmail. List, create, delete calendar events.
读取、发送、搜索Gmail邮件。列出、创建、删除日历事件。
First-Time Setup
首次设置
Run to authenticate with Google. This opens a browser for OAuth consent.
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts authTokens are stored per-project in .
.claude/google-skill.local.json运行 以通过Google进行身份验证。这会打开浏览器进行OAuth授权。
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts auth令牌按项目存储在 文件中。
.claude/google-skill.local.jsonUsing Your Own Credentials (Optional)
使用自有凭据(可选)
By default, this skill uses embedded OAuth credentials. To use your own Google Cloud project credentials instead:
- Create a Google Cloud project and enable the required APIs (Gmail, Calendar, Sheets, Docs, YouTube, Drive)
- Create OAuth 2.0 credentials (Desktop app type)
- Download the JSON and save to
~/.config/google-skill/credentials.json
The skill will automatically use your credentials if that file exists.
默认情况下,本Skill使用内置OAuth凭据。如需改用您自己的Google Cloud项目凭据:
- 创建Google Cloud项目并启用所需API(Gmail、Calendar、Sheets、Docs、YouTube、Drive)
- 创建OAuth 2.0凭据(桌面应用类型)
- 下载JSON文件并保存至
~/.config/google-skill/credentials.json
若该文件存在,Skill将自动使用您的凭据。
Gmail Commands
Gmail命令
bash
undefinedbash
undefinedList messages
List messages
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts list
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts list --query="is:unread" --max=5
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts list
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts list --query="is:unread" --max=5
Read message
Read message
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts read <message-id>
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts read <message-id>
Send email (plain text)
Send email (plain text)
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send
--to="recipient@example.com"
--subject="Hello"
--body="Message content"
--to="recipient@example.com"
--subject="Hello"
--body="Message content"
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send
--to="recipient@example.com"
--subject="Hello"
--body="Message content"
--to="recipient@example.com"
--subject="Hello"
--body="Message content"
Send HTML email
Send HTML email
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send
--to="recipient@example.com"
--subject="Hello"
--body="Plain text fallback"
--html="<h1>Hello</h1><p>HTML content</p>"
--to="recipient@example.com"
--subject="Hello"
--body="Plain text fallback"
--html="<h1>Hello</h1><p>HTML content</p>"
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send
--to="recipient@example.com"
--subject="Hello"
--body="Plain text fallback"
--html="<h1>Hello</h1><p>HTML content</p>"
--to="recipient@example.com"
--subject="Hello"
--body="Plain text fallback"
--html="<h1>Hello</h1><p>HTML content</p>"
Send with attachments
Send with attachments
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send
--to="recipient@example.com"
--subject="With files"
--body="See attached"
--attachment="/path/to/file.pdf,/path/to/other.docx"
--to="recipient@example.com"
--subject="With files"
--body="See attached"
--attachment="/path/to/file.pdf,/path/to/other.docx"
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send
--to="recipient@example.com"
--subject="With files"
--body="See attached"
--attachment="/path/to/file.pdf,/path/to/other.docx"
--to="recipient@example.com"
--subject="With files"
--body="See attached"
--attachment="/path/to/file.pdf,/path/to/other.docx"
Send HTML with inline images
Send HTML with inline images
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send
--to="recipient@example.com"
--subject="Newsletter"
--body="Plain text version"
--html="<h1>Hello</h1><img src='cid:logo'>"
--inline="/path/to/logo.png:logo"
--to="recipient@example.com"
--subject="Newsletter"
--body="Plain text version"
--html="<h1>Hello</h1><img src='cid:logo'>"
--inline="/path/to/logo.png:logo"
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send
--to="recipient@example.com"
--subject="Newsletter"
--body="Plain text version"
--html="<h1>Hello</h1><img src='cid:logo'>"
--inline="/path/to/logo.png:logo"
--to="recipient@example.com"
--subject="Newsletter"
--body="Plain text version"
--html="<h1>Hello</h1><img src='cid:logo'>"
--inline="/path/to/logo.png:logo"
Labels
Labels
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts labels
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts label <id> --add="IMPORTANT"
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts labels
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts label <id> --add="IMPORTANT"
Download as EML
Download as EML
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts download <message-id>
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts download <message-id>
Send markdown as styled HTML email (Focus.AI branding)
Send markdown as styled HTML email (Focus.AI branding)
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send-md
--to="recipient@example.com"
--file="/path/to/report.md"
--style=client # or "labs" for Focus.AI Labs style
--to="recipient@example.com"
--file="/path/to/report.md"
--style=client # or "labs" for Focus.AI Labs style
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send-md
--to="recipient@example.com"
--file="/path/to/report.md"
--style=client # or "labs" for Focus.AI Labs style
--to="recipient@example.com"
--file="/path/to/report.md"
--style=client # or "labs" for Focus.AI Labs style
Subject defaults to first H1 in markdown, or specify explicitly:
Subject defaults to first H1 in markdown, or specify explicitly:
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send-md
--to="recipient@example.com"
--file="report.md"
--style=labs
--subject="Weekly Report"
--to="recipient@example.com"
--file="report.md"
--style=labs
--subject="Weekly Report"
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send-md
--to="recipient@example.com"
--file="report.md"
--style=labs
--subject="Weekly Report"
--to="recipient@example.com"
--file="report.md"
--style=labs
--subject="Weekly Report"
Create as draft instead of sending:
Create as draft instead of sending:
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send-md
--to="recipient@example.com"
--file="report.md"
--draft
--to="recipient@example.com"
--file="report.md"
--draft
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send-md
--to="recipient@example.com"
--file="report.md"
--draft
--to="recipient@example.com"
--file="report.md"
--draft
Create a draft email (plain text or HTML)
Create a draft email (plain text or HTML)
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts draft
--to="recipient@example.com"
--subject="Draft Subject"
--body="Draft content"
--to="recipient@example.com"
--subject="Draft Subject"
--body="Draft content"
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts draft
--to="recipient@example.com"
--subject="Draft Subject"
--body="Draft content"
--to="recipient@example.com"
--subject="Draft Subject"
--body="Draft content"
Create HTML draft with attachments
Create HTML draft with attachments
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts draft
--to="recipient@example.com"
--subject="Draft with files"
--body="Plain text fallback"
--html="<h1>Hello</h1>"
--attachment="/path/to/file.pdf"
--to="recipient@example.com"
--subject="Draft with files"
--body="Plain text fallback"
--html="<h1>Hello</h1>"
--attachment="/path/to/file.pdf"
undefinednpx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts draft
--to="recipient@example.com"
--subject="Draft with files"
--body="Plain text fallback"
--html="<h1>Hello</h1>"
--attachment="/path/to/file.pdf"
--to="recipient@example.com"
--subject="Draft with files"
--body="Plain text fallback"
--html="<h1>Hello</h1>"
--attachment="/path/to/file.pdf"
undefinedStyled Email Templates
样式化邮件模板
The command converts markdown to beautifully styled HTML emails using Focus.AI brand guidelines:
send-md- client (default): Professional style with teal accents, subtle borders, rounded corners
- labs: Bold experimental style with black borders, box shadows, uppercase headers
Supports: headings, bold/italic, links, code blocks, tables, lists, blockquotes, horizontal rules.
send-md- client(默认):专业风格,带有蓝绿色强调色、细微边框和圆角
- labs:大胆实验风格,带有黑色边框、阴影和大写标题
支持:标题、粗体/斜体、链接、代码块、表格、列表、引用、水平线。
Calendar Commands
日历命令
bash
undefinedbash
undefinedList calendars
List calendars
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts calendars
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts calendars
List upcoming events
List upcoming events
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts events
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts events --max=20
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts events
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts events --max=20
Get event details
Get event details
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts event <event-id>
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts event <event-id>
Create event
Create event
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts create
--summary="Meeting"
--start="2026-01-15T10:00:00"
--end="2026-01-15T11:00:00"
--location="Conference Room"
--description="Discuss project"
--summary="Meeting"
--start="2026-01-15T10:00:00"
--end="2026-01-15T11:00:00"
--location="Conference Room"
--description="Discuss project"
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts create
--summary="Meeting"
--start="2026-01-15T10:00:00"
--end="2026-01-15T11:00:00"
--location="Conference Room"
--description="Discuss project"
--summary="Meeting"
--start="2026-01-15T10:00:00"
--end="2026-01-15T11:00:00"
--location="Conference Room"
--description="Discuss project"
Delete event
Delete event
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts delete <event-id>
undefinednpx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts delete <event-id>
undefinedSearch Operators (Gmail)
搜索运算符(Gmail)
| Operator | Example | Description |
|---|---|---|
| | From sender |
| | To recipient |
| | Subject contains |
| | Unread only |
| | Has attachments |
| | Within N days |
| | Has label |
| 运算符 | 示例 | 描述 |
|---|---|---|
| | 来自指定发件人 |
| | 发送给指定收件人 |
| | 主题包含指定内容 |
| | 仅未读邮件 |
| | 包含附件 |
| | N天内的邮件 |
| | 带有指定标签 |
Output
输出
All commands return JSON with and fields.
successdata所有命令均返回包含和字段的JSON格式结果。
successdataCheck Auth
检查身份验证状态
bash
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts checkbash
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts checkHelp
帮助
bash
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts --helpbash
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts --help