Communitygithub.com

aiagentwithdhruv/skills

通过统一工具管理多个Gmail账户的电子邮件。当用户要求检查邮件、阅读收件箱、标记邮件、归档邮件或跨账户管理Gmail时使用。

skills 是什么?

该技能提供了跨多个Gmail账户的电子邮件统一管理能力,支持检查收件箱、标记、归档、添加标签以及创建邮件过滤规则等操作。它基于多个Python脚本实现,覆盖身份验证、批量标签、过滤规则创建等场景,适合拥有多个邮箱账户的用户高效管理邮件。技能利用Gmail API进行读取和写入操作,支持的授权范围包括修改邮件、管理标签和设置。用户可通过命令行参数灵活指定查询条件、操作内容和目标账户,并支持预览模式避免误操作。配置采用JSON文件存储账户注册信息和OAuth凭据,自动生成令牌,降低了多账户管理的复杂度。该技能可在支持命令行工具执行的AI代理平台(如Claude Code、Cursor等)中使用,且无需额外付费。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/aiagentwithdhruv/skills/tree/HEAD/gmail-inbox

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Gmail 收件箱管理

目标

使用统一工具跨多个 Gmail 账户检查和管理电子邮件。

脚本

  • ./scripts/gmail_unified.py - 检查和管理收件箱
  • ./scripts/gmail_multi_auth.py - 认证账户
  • ./scripts/gmail_bulk_label.py - 批量标签
  • ./scripts/gmail_create_filters.py - 创建过滤器
  • ./scripts/gmail_auth.py - 认证辅助工具

快速参考

# 检查所有账户的未读邮件
python3 ./scripts/gmail_unified.py --query "is:unread" --limit 50

# 仅检查特定账户
python3 ./scripts/gmail_unified.py --query "is:unread" --account yourcompany

# 列出已注册账户
python3 ./scripts/gmail_unified.py --accounts

# 标记并归档邮件
python3 ./scripts/gmail_unified.py --query "from:notifications@" --label "Notifications" --archive

# 标记为已读
python3 ./scripts/gmail_unified.py --query "from:noreply@" --mark-read

# 预演(预览)
python3 ./scripts/gmail_unified.py --query "subject:invoice" --label "Invoices" --dry-run

账户注册表

账户邮箱凭据令牌
youruser[email protected]credentials.jsontoken_youruser.json
yourcompany[email protected]credentials_yourcompany.jsontoken_yourcompany.json

认证错误排除

“找不到令牌文件”

python3 ./scripts/gmail_multi_auth.py --account yourcompany --email [email protected]

“invalid_scope: 错误请求”

rm token_youruser.json
python3 ./scripts/gmail_multi_auth.py --account youruser --email [email protected]

“认证失败” 检查 credentials.json 是否存在于根目录。

必需的授权范围

  • gmail.modify - 读写邮件
  • gmail.labels - 创建/管理标签
  • gmail.settings.basic - 管理设置
  • spreadsheets - Google Sheets 访问
  • drive - Google Drive 访问

凭据位置

所有凭据文件应位于工作区根目录:

  • credentials.json / credentials_yourcompany.json - OAuth 客户端配置
  • token_*.json - 认证令牌(自动生成)
  • gmail_accounts.json - 账户注册表

模式

输入

名称类型必填描述
querystring否Gmail 搜索查询(例如 'is:unread')
accountstring否注册表中的特定账户名称
limitinteger否最多获取的邮件数(默认:50)

输出

名称类型描述
emailsarray包含主题、发件人、日期、摘要的邮件对象列表

凭据

名称来源
credentials.json文件
token_*.json文件(自动生成)

可组合

与该技能配合良好的技能:gmail-label、instantly-autoreply

费用

免费(Gmail API)

Individual skills in this repo

This repo contains 10 individual skills — each has its own dedicated page.

aiagentwithdhruv/skills

Add new Modal webhooks for event-driven execution. Use when user asks to create a webhook, add an endpoint, or set up event triggers.

aiagentwithdhruv/skills

Answer Euron Gen AI Bootcamp doubts instantly. Covers Euri API setup across all frameworks (Python, LangChain, OpenAI SDK, TypeScript, n8n, curl), MCP server setup, common errors, model recommendations, and token limits. Use when someone in the bootcamp asks a question.

aiagentwithdhruv/skills

Auto-label Gmail emails into Action Required, Waiting On, and Reference categories. Use when user asks to label emails, triage inbox, categorize emails, or organize Gmail.

aiagentwithdhruv/skills

Scrape Google Maps for B2B leads with deep website enrichment and contact extraction. Use when user asks to find local businesses, scrape Google Maps, generate contractor lists, or build local service business databases.

aiagentwithdhruv/skills

Run Claude orchestrator locally with Cloudflare tunneling. Use when user asks to run locally, start local server, or test webhooks locally.

aiagentwithdhruv/skills

MCP server for AI-powered macOS control — apps, display, audio, files, screenshots, clipboard

aiagentwithdhruv/skills

Deploy execution scripts to Modal cloud. Use when user asks to deploy to Modal, push code to cloud, or update Modal functions.

aiagentwithdhruv/skills

Scrape and verify business leads using Apify, classify with LLM, enrich emails, and save to Google Sheets. Use when user asks to find leads, scrape businesses, generate prospect lists, or build lead databases for any industry or location.

aiagentwithdhruv/skills

Query Skool community content using RAG pipeline with vector search. Use when user asks to search Skool knowledge, find community answers, or query Skool content.

aiagentwithdhruv/skills

Scrape Upwork jobs and generate personalized proposals with cover letters. Use when user asks to find Upwork jobs, create Upwork proposals, or apply to Upwork listings.

相关技能