Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计提醒

gmailGmail 邮件管理

Agent Skill

gmail 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,805

周安装

73

GitHub Stars

141

下载量

566
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gmail(Gmail 邮件管理)
来源仓库:https://github.com/glebis/claude-skills
仓库路径:skills/gmail
安装命令:
npx skills add https://github.com/glebis/claude-skills --skill gmail
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/glebis/claude-skills --skill gmail

简介

gmail 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。

  • 适用于需要根据关键词或任务场景从来源线索中筛选信息的场景。
  • 通过 npx skills add 命令安装,需确认权限范围和维护状态后再使用。
  • 建议结合原始 README 核验具体用法,注意是否触发联网或文件读写操作。
  • 安装前应评估是否会执行命令或访问外部资源,确保符合安全策略。

SKILL.md

Gmail Search Skill

Search and fetch emails via Gmail API with flexible query options and output formats.

Prerequisites

Credentials must be configured in ~/.gmail_credentials/. Run setup to check status:

python3 scripts/gmail_search.py setup

Obtaining Gmail API Credentials

1. Create Google Cloud Project

  1. Go to console.cloud.google.com
  2. Click project dropdown -> "New Project"
  3. Name it (e.g., "Gmail Agent Skill") -> Create

2. Enable Gmail API

  1. Navigate to "APIs & Services" -> "Library"
  2. Search for "Gmail API"
  3. Click it and press "Enable"

3. Configure OAuth Consent Screen

  1. Go to "OAuth consent screen" (left sidebar)
  2. Choose "External" user type
  3. Fill in required fields:

- App name: Gmail Agent Skill - User support email: your email - Developer email: your email

  1. Click "Save and Continue", skip Scopes
  2. On "Test users" page, add your Gmail address
  3. Complete all steps

4. Publish the Test App

Important: Without this step, you'll get "Error 403: access_denied".

  1. Go back to "OAuth consent screen"
  2. Under "Publishing status", click "Publish App"
  3. Confirm the dialog

This keeps the app in test mode (not production) but allows your test users to authenticate. You'll see an "unverified app" warning during login - click "Advanced" -> "Go to Gmail Agent Skill (unsafe)" to proceed.

Note: Test tokens expire after 7 days. Production requires Google verification.

5. Create OAuth Credentials

  1. Go to "Credentials" (left sidebar)
  2. Click "Create Credentials" -> "OAuth client ID"
  3. Select "Desktop app" as application type
  4. Name it (e.g., "Gmail Agent Client")
  5. Click "Create"

6. Get Your Credentials

  1. Client ID will be displayed - copy it
  2. Client Secret: Click the download icon or view details to get the secret

7. Save Credentials

Create ~/.gmail_credentials/credentials.json:

{
  "installed": {
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://oauth2.googleapis.com/token",
    "redirect_uris": ["http://localhost"]
  }
}

8. Authenticate

python3 scripts/gmail_search.py auth

This opens a browser. Click through the "unverified app" warning ("Advanced" -> "Go to Gmail Agent Skill"), approve access, and you're ready.

Quick Start

# Check setup status
python3 scripts/gmail_search.py setup

# Authenticate (opens browser)
python3 scripts/gmail_search.py auth

# Search emails
python3 scripts/gmail_search.py search "meeting notes"

# Search with filters
python3 scripts/gmail_search.py search --from "boss@company.com" --unread

Commands

Setup

Check configuration status:

python3 scripts/gmail_search.py setup
python3 scripts/gmail_search.py setup --json

Authenticate

Authenticate with Gmail (opens browser for OAuth):

python3 scripts/gmail_search.py auth

Scope

View or change API permission scope:

# View current scope
python3 scripts/gmail_search.py scope

# Change scope (requires re-auth)
python3 scripts/gmail_search.py scope --set readonly
python3 scripts/gmail_search.py scope --set modify
python3 scripts/gmail_search.py scope --set full

Available scopes:

  • readonly - Read emails only (default, recommended)
  • modify - Read + modify labels, mark read/unread
  • full - Full access including delete

Search

Search emails with free-text query or filters:

# Free-text search (uses Gmail search syntax)
python3 scripts/gmail_search.py search "project deadline"
python3 scripts/gmail_search.py search "from:john@example.com subject:invoice"

# Using helper flags
python3 scripts/gmail_search.py search --from "john@example.com"
python3 scripts/gmail_search.py search --to "me@example.com"
python3 scripts/gmail_search.py search --subject "Weekly Report"
python3 scripts/gmail_search.py search --label "INBOX"
python3 scripts/gmail_search.py search --label "work"

# Date filters (YYYY/MM/DD format)
python3 scripts/gmail_search.py search --after 2024/01/01
python3 scripts/gmail_search.py search --before 2024/12/31
python3 scripts/gmail_search.py search --after 2024/01/01 --before 2024/06/30

# Status filters
python3 scripts/gmail_search.py search --unread
python3 scripts/gmail_search.py search --starred
python3 scripts/gmail_search.py search --has-attachment

# Combined filters
python3 scripts/gmail_search.py search "invoice" --from "billing@" --has-attachment --after 2024/01/01

# Limit results
python3 scripts/gmail_search.py search "meeting" --limit 50

# Include full body (default shows snippet only)
python3 scripts/gmail_search.py search "contract" --full

# Include attachment info
python3 scripts/gmail_search.py search --has-attachment --attachments

# JSON output
python3 scripts/gmail_search.py search "project" --json

Download Attachments

Download attachments from a specific message:

# Download to default location (~/Downloads/gmail_attachments/)
python3 scripts/gmail_search.py download MESSAGE_ID

# Download to custom directory
python3 scripts/gmail_search.py download MESSAGE_ID --output /path/to/folder

# JSON output
python3 scripts/gmail_search.py download MESSAGE_ID --json

Get message ID from search results (shown in output).

Labels

List all available Gmail labels:

python3 scripts/gmail_search.py labels
python3 scripts/gmail_search.py labels --json

Output Formats

Markdown (default)

# Gmail Search Results (3 messages)

## Weekly Report
**From:** boss@company.com
**To:** me@example.com
**Date:** Mon, 25 Nov 2024 10:00:00 +0000
**ID:** `18abc123def`

> Here's the weekly report summary...

---

JSON

Add --json flag for structured output:

[
  {
    "id": "18abc123def",
    "thread_id": "18abc123def",
    "from": "boss@company.com",
    "to": "me@example.com",
    "subject": "Weekly Report",
    "date": "Mon, 25 Nov 2024 10:00:00 +0000",
    "snippet": "Here's the weekly report summary...",
    "labels": ["INBOX", "UNREAD"]
  }
]

Gmail Search Syntax

The skill supports Gmail's native search syntax in free-text queries:

OperatorExampleDescription
from:from:john@example.comFrom specific sender
to:to:team@company.comTo specific recipient
subject:subject:meetingIn subject line
label:label:workHas specific label
has:attachmenthas:attachmentHas attachments
filename:filename:pdfAttachment filename
is:unreadis:unreadUnread messages
is:starredis:starredStarred messages
after:after:2024/01/01After date
before:before:2024/12/31Before date
newer_than:newer_than:7dWithin last N days
older_than:older_than:1mOlder than N months
in:in:inboxIn specific folder
ORfrom:john OR from:janeEither condition
--label:spamExclude
"""exact phrase"Exact match

Example User Requests

User saysCommand
"Search Gmail for meeting notes"search "meeting notes"
"Find emails from John"search --from "john"
"Show unread emails"search --unread
"Emails about the project from last month"search "project" --after 2024/10/01
"Invoices with attachments"search "invoice" --has-attachment
"Read the full email about contract"search "contract" --full --limit 1
"Download attachments from that email"download MESSAGE_ID
"What labels do I have?"labels
"Starred emails from boss"search --from "boss" --starred
"Is Gmail configured?"setup

Dependencies

pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib

Files

  • ~/.gmail_credentials/credentials.json - OAuth client credentials
  • ~/.gmail_credentials/token.pickle - Cached auth token
  • ~/.gmail_credentials/scope.txt - Current scope setting

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.03%
按下载量换算153

windsurf

25.03%
按下载量换算142

OpenCode

17.58%
按下载量换算100

Codex

11.2%
按下载量换算63

Antigravity

6.8%
按下载量换算38

Gemini CLI

3.14%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills