Loading...
Loading...
Compare original and translation side by side
pip install --user google-auth google-auth-oauthlib google-api-python-client keyring pyyamlpip install --user google-auth google-auth-oauthlib google-api-python-client keyring pyyamlpython scripts/gmail.py checkpython scripts/gmail.py check~/.config/agent-skills/google.yamloauth_client:
client_id: your-client-id.apps.googleusercontent.com
client_secret: your-client-secretpython scripts/gmail.py check~/.config/agent-skills/google.yamloauth_client:
client_id: your-client-id.apps.googleusercontent.com
client_secret: your-client-secretpython scripts/gmail.py check| Scope | Permission | Used For |
|---|---|---|
| Read messages, labels, settings | Listing and reading messages |
| Send emails | Sending messages and drafts |
| Modify labels and metadata | Managing labels on messages |
| Manage labels | Creating and listing labels |
| 权限范围 | 权限说明 | 用途 |
|---|---|---|
| 读取邮件、标签、设置 | 列出和读取邮件 |
| 发送邮件 | 发送邮件和草稿 |
| 修改标签和元数据 | 管理邮件标签 |
| 管理标签 | 创建和列出标签 |
keyring del agent-skills gmail-token-jsonpython scripts/gmail.py checkkeyring del agent-skills gmail-token-jsonpython scripts/gmail.py checkpython scripts/gmail.py checkpython scripts/gmail.py checkpython scripts/gmail.py auth setup \
--client-id YOUR_CLIENT_ID \
--client-secret YOUR_CLIENT_SECRET~/.config/agent-skills/gmail.yamlpython scripts/gmail.py auth setup \
--client-id YOUR_CLIENT_ID \
--client-secret YOUR_CLIENT_SECRET~/.config/agent-skills/gmail.yamlundefinedundefined
**Arguments:**
- `--query`: Gmail search query (optional)
- `--max-results`: Maximum number of results (default: 10)
- `--json`: Output as JSON
**Search Query Examples:**
For complete Gmail search syntax, see [gmail-queries.md](references/gmail-queries.md).
Common queries:
- `is:unread` - Unread messages
- `from:user@example.com` - Messages from sender
- `subject:meeting` - Messages with subject keyword
- `has:attachment` - Messages with attachments
- `after:2024/01/01` - Messages after date
- `label:important` - Messages with label
**参数:**
- `--query`: Gmail搜索查询语句(可选)
- `--max-results`: 最大结果数(默认:10)
- `--json`: 以JSON格式输出
**搜索查询示例:**
完整的Gmail搜索语法请参考[gmail-queries.md](references/gmail-queries.md)。
常用查询语句:
- `is:unread` - 未读邮件
- `from:user@example.com` - 指定发件人的邮件
- `subject:meeting` - 主题包含关键词的邮件
- `has:attachment` - 带附件的邮件
- `after:2024/01/01` - 指定日期之后的邮件
- `label:important` - 带指定标签的邮件undefinedundefined
**Arguments:**
- `message_id`: The message ID (required)
- `--format`: Message format (full, minimal, raw, metadata) - default: full
- `--json`: Output as JSON
**参数:**
- `message_id`: 邮件ID(必填)
- `--format`: 邮件格式(full、minimal、raw、metadata)- 默认:full
- `--json`: 以JSON格式输出undefinedundefined
**Arguments:**
- `--to`: Recipient email address (required)
- `--subject`: Email subject (required)
- `--body`: Email body text (required)
- `--cc`: CC recipients (comma-separated)
- `--bcc`: BCC recipients (comma-separated)
- `--json`: Output as JSON
**参数:**
- `--to`: 收件人邮箱地址(必填)
- `--subject`: 邮件主题(必填)
- `--body`: 邮件正文(必填)
- `--cc`: 抄送人(逗号分隔)
- `--bcc`: 密送人(逗号分隔)
- `--json`: 以JSON格式输出undefinedundefined
**Arguments:**
- `--max-results`: Maximum number of results (default: 10)
- `--json`: Output as JSON
**参数:**
- `--max-results`: 最大结果数(默认:10)
- `--json`: 以JSON格式输出undefinedundefined
**Arguments:**
- `--to`: Recipient email address (required)
- `--subject`: Email subject (required)
- `--body`: Email body text (required)
- `--cc`: CC recipients (comma-separated)
- `--bcc`: BCC recipients (comma-separated)
- `--json`: Output as JSON
**参数:**
- `--to`: 收件人邮箱地址(必填)
- `--subject`: 邮件主题(必填)
- `--body`: 邮件正文(必填)
- `--cc`: 抄送人(逗号分隔)
- `--bcc`: 密送人(逗号分隔)
- `--json`: 以JSON格式输出undefinedundefined
**Arguments:**
- `draft_id`: The draft ID to send (required)
- `--json`: Output as JSON
**参数:**
- `draft_id`: 要发送的草稿ID(必填)
- `--json`: 以JSON格式输出undefinedundefined
**Arguments:**
- `--json`: Output as JSON
**参数:**
- `--json`: 以JSON格式输出undefinedundefined
**Arguments:**
- `name`: Label name (required)
- `--json`: Output as JSON
**参数:**
- `name`: 标签名称(必填)
- `--json`: 以JSON格式输出python scripts/gmail.py checkpython scripts/gmail.py checkpython scripts/gmail.py messages list --query "is:unread"python scripts/gmail.py messages list --query "is:unread"python scripts/gmail.py messages list --query "from:boss@example.com" --max-results 5python scripts/gmail.py messages list --query "from:boss@example.com" --max-results 5python scripts/gmail.py send \
--to colleague@example.com \
--subject "Quick Question" \
--body "Do you have time for a meeting tomorrow?"python scripts/gmail.py send \
--to colleague@example.com \
--subject "Quick Question" \
--body "Do you have time for a meeting tomorrow?"undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined| Operator | Description | Example |
|---|---|---|
| Sender email | |
| Recipient email | |
| Subject contains | |
| Has label | |
| Has attachment | |
| Unread messages | |
| Starred messages | |
| After date | |
| Before date | |
| Newer than period | |
| Older than period | |
ORundefined| 操作符 | 说明 | 示例 |
|---|---|---|
| 发件人邮箱 | |
| 收件人邮箱 | |
| 主题包含关键词 | |
| 带指定标签 | |
| 带附件 | |
| 未读邮件 | |
| 已标星邮件 | |
| 指定日期之后 | |
| 指定日期之前 | |
| 指定时间范围内的新邮件 | |
| 指定时间范围内的旧邮件 | |
ORundefined
For the complete reference, see [gmail-queries.md](references/gmail-queries.md).
完整参考请见[gmail-queries.md](references/gmail-queries.md)。python scripts/gmail.py checkpython scripts/gmail.py check~/.config/agent-skills/google.yamlkeyring del agent-skills gmail-token-json
python scripts/gmail.py check~/.config/agent-skills/google.yamlkeyring del agent-skills gmail-token-json
python scripts/gmail.py checkpip install --user google-auth google-auth-oauthlib google-api-python-client keyring pyyamlpip install --user google-auth google-auth-oauthlib google-api-python-client keyring pyyamlhttps://www.googleapis.com/auth/gmail.readonlyhttps://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/gmail.labelshttps://www.googleapis.com/auth/gmail.readonlyhttps://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/gmail.labels~/.config/agent-skills/gmail.yaml~/.config/agent-skills/gmail.yaml