Communitygithub.com

aiagentwithdhruv/skills

使用統一工具管理多個 Gmail 帳戶的電子郵件。當使用者要求檢查郵件、閱讀收件匣、為郵件加上標籤、封存郵件或跨帳戶管理 Gmail 時使用。

skills 是什麼?

這個技能提供一個統一的命令列介面,讓開發者與 AI 代理能夠跨多個 Gmail 帳戶管理電子郵件。它支援檢查未讀郵件、讀取收件匣、為郵件加上標籤、封存郵件以及將郵件標記為已讀等操作,所有操作皆可指定特定帳戶或同時套用至所有已註冊帳戶。您可以透過 Gmail 搜尋查詢語法(如 `is:unread`、`from:notifications@`、`subject:invoice`)來篩選郵件,並支援 `--dry-run` 參數以預覽操作結果。此技能需要正確的 OAuth 認證,並會自動管理每個帳戶的 token 檔案;若遇到認證錯誤,可使用提供的腳本重新認證。它適用於 Claude Code、Cursor 與 Codex 等 AI 代理平台,並可與 `gmail-label` 及 `instantly-autoreply` 等技能組合使用。

相容平台~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

帳戶註冊表

帳戶名稱電子郵件憑證Token
youruser[email protected]credentials.jsontoken_youruser.json
yourcompany[email protected]credentials_yourcompany.jsontoken_yourcompany.json

認證錯誤排錯

「找不到 Token 檔案」

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

「invalid_scope: Bad Request」

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 - 認證 token(自動產生)
  • 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.

相關技能