gmail

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Gmail & Calendar Skill

Gmail & Calendar Skill

Read, send, search Gmail. List, create, delete calendar events.
读取、发送、搜索Gmail邮件。列出、创建、删除日历事件。

First-Time Setup

首次设置

Run
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts auth
to authenticate with Google. This opens a browser for OAuth consent.
Tokens are stored per-project in
.claude/google-skill.local.json
.
运行
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts auth
以通过Google进行身份验证。这会打开浏览器进行OAuth授权。
令牌按项目存储在
.claude/google-skill.local.json
文件中。

Using Your Own Credentials (Optional)

使用自有凭据(可选)

By default, this skill uses embedded OAuth credentials. To use your own Google Cloud project credentials instead:
  1. Create a Google Cloud project and enable the required APIs (Gmail, Calendar, Sheets, Docs, YouTube, Drive)
  2. Create OAuth 2.0 credentials (Desktop app type)
  3. 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项目凭据:
  1. 创建Google Cloud项目并启用所需API(Gmail、Calendar、Sheets、Docs、YouTube、Drive)
  2. 创建OAuth 2.0凭据(桌面应用类型)
  3. 下载JSON文件并保存至
    ~/.config/google-skill/credentials.json
若该文件存在,Skill将自动使用您的凭据。

Gmail Commands

Gmail命令

bash
undefined
bash
undefined

List 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"
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send
--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>"
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>"

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"
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"

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"
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"

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
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

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"
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send-md
--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
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts send-md
--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"
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts draft
--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"
undefined
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"
undefined

Styled Email Templates

样式化邮件模板

The
send-md
command converts markdown to beautifully styled HTML emails using Focus.AI brand guidelines:
  • 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
命令会将Markdown转换为符合Focus.AI品牌规范的精美HTML邮件:
  • client(默认):专业风格,带有蓝绿色强调色、细微边框和圆角
  • labs:大胆实验风格,带有黑色边框、阴影和大写标题
支持:标题、粗体/斜体、链接、代码块、表格、列表、引用、水平线。

Calendar Commands

日历命令

bash
undefined
bash
undefined

List 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"
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"

Delete event

Delete event

npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts delete <event-id>
undefined
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts delete <event-id>
undefined

Search Operators (Gmail)

搜索运算符(Gmail)

OperatorExampleDescription
from:
from:alice@example.com
From sender
to:
to:bob@example.com
To recipient
subject:
subject:meeting
Subject contains
is:unread
is:unread
Unread only
has:attachment
has:attachment
Has attachments
newer_than:
newer_than:7d
Within N days
label:
label:work
Has label
运算符示例描述
from:
from:alice@example.com
来自指定发件人
to:
to:bob@example.com
发送给指定收件人
subject:
subject:meeting
主题包含指定内容
is:unread
is:unread
仅未读邮件
has:attachment
has:attachment
包含附件
newer_than:
newer_than:7d
N天内的邮件
label:
label:work
带有指定标签

Output

输出

All commands return JSON with
success
and
data
fields.
所有命令均返回包含
success
data
字段的JSON格式结果。

Check Auth

检查身份验证状态

bash
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts check
bash
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts check

Help

帮助

bash
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts --help
bash
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts --help