google-integration
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoogle Integration
Google集成
Complete Google Workspace integration with unified OAuth authentication. One login grants access to Gmail, Google Docs, Google Sheets, Google Calendar, Google Drive, Google Tasks, and Google Slides.
实现与Google Workspace的完整集成,支持统一OAuth认证。一次登录即可访问Gmail、Google Docs、Google Sheets、Google Calendar、Google Drive、Google Tasks和Google Slides。
Purpose
用途
Provides a unified interface to Google Workspace services with:
- Single authentication - Login once, use all services
- Shared credentials - One OAuth setup for everything
- Consistent patterns - Same error handling across all services
提供一个统一的Google Workspace服务界面,具备以下特性:
- 单点认证 - 一次登录,使用所有服务
- 共享凭据 - 一套OAuth配置适用于所有服务
- 一致模式 - 所有服务采用相同的错误处理机制
Included Services
包含的服务
| Service | Description | Operations |
|---|---|---|
| Gmail | Email operations | Read, send, reply, forward, drafts, labels |
| Google Docs | Document operations | Read, write, create, export, format |
| Google Sheets | Spreadsheet operations | Read, write, append, create, format |
| Google Calendar | Calendar operations | List events, create, update, find slots, check availability |
| Google Drive | File storage operations | Upload, download, share, organize folders |
| Google Tasks | Task management | Create, complete, organize task lists |
| Google Slides | Presentation operations | Create, edit slides, add text/images, export |
| 服务 | 描述 | 操作 |
|---|---|---|
| Gmail | 邮件操作 | 读取、发送、回复、转发、草稿、标签管理 |
| Google Docs | 文档操作 | 读取、写入、创建、导出、格式设置 |
| Google Sheets | 电子表格操作 | 读取、写入、追加、创建、格式设置 |
| Google Calendar | 日历操作 | 列出事件、创建、更新、查找时段、检查可用性 |
| Google Drive | 文件存储操作 | 上传、下载、共享、文件夹管理 |
| Google Tasks | 任务管理 | 创建、完成、任务列表管理 |
| Google Slides | 演示文稿操作 | 创建、编辑幻灯片、添加文本/图片、导出 |
First-Time Setup
首次设置
New users: Say to run the interactive setup wizard.
"connect google"The wizard guides you through:
- Creating a Google Cloud project
- Enabling required APIs
- Creating OAuth credentials
- Authenticating with your Google account
新用户:说出即可运行交互式设置向导。
"connect google"向导将引导您完成以下步骤:
- 创建Google Cloud项目
- 启用所需API
- 创建OAuth凭据
- 使用您的Google账号进行认证
Pre-Flight Check (ALWAYS RUN FIRST)
预检检查(务必先运行)
bash
python3 00-system/skills/google/google-master/scripts/check_google_config.py --jsonExit codes:
- 0: Ready - all services available
- 1: Need login - run the login command below
- 2: Missing credentials or dependencies
To authenticate (grants access to ALL services):
bash
python3 00-system/skills/google/google-master/scripts/google_auth.py --loginbash
python3 00-system/skills/google/google-master/scripts/check_google_config.py --json退出码说明:
- 0:就绪 - 所有服务可用
- 1:需要登录 - 运行下方的登录命令
- 2:缺少凭据或依赖项
进行认证(获取所有服务的访问权限):
bash
python3 00-system/skills/google/google-master/scripts/google_auth.py --loginQuick Start by Service
按服务快速开始
Gmail
Gmail
bash
undefinedbash
undefinedList recent emails
列出最近的邮件
python3 00-system/skills/google/gmail/scripts/gmail_operations.py list --max 10
python3 00-system/skills/google/gmail/scripts/gmail_operations.py list --max 10
Send email (creates draft first, asks for confirmation)
发送邮件(先创建草稿,需确认)
python3 00-system/skills/google/gmail/scripts/gmail_operations.py send --to "user@example.com" --subject "Hello" --body "Message"
undefinedpython3 00-system/skills/google/gmail/scripts/gmail_operations.py send --to "user@example.com" --subject "Hello" --body "Message"
undefinedGoogle Docs
Google Docs
bash
undefinedbash
undefinedRead document
读取文档
python3 00-system/skills/google/google-docs/scripts/docs_operations.py read <document_id>
python3 00-system/skills/google/google-docs/scripts/docs_operations.py read <document_id>
Create document
创建文档
python3 00-system/skills/google/google-docs/scripts/docs_operations.py create "My Document" --content "Initial content"
undefinedpython3 00-system/skills/google/google-docs/scripts/docs_operations.py create "My Document" --content "Initial content"
undefinedGoogle Sheets
Google Sheets
bash
undefinedbash
undefinedRead data
读取数据
python3 00-system/skills/google/google-sheets/scripts/sheets_operations.py read <spreadsheet_id> "Sheet1!A1:D10"
python3 00-system/skills/google/google-sheets/scripts/sheets_operations.py read <spreadsheet_id> "Sheet1!A1:D10"
Append rows
追加行
python3 00-system/skills/google/google-sheets/scripts/sheets_operations.py append <spreadsheet_id> "Sheet1!A:D" --values '[["New", "Row", "Data"]]'
undefinedpython3 00-system/skills/google/google-sheets/scripts/sheets_operations.py append <spreadsheet_id> "Sheet1!A:D" --values '["New", "Row", "Data"]'
undefinedGoogle Calendar
Google Calendar
bash
undefinedbash
undefinedList upcoming events
列出即将到来的事件
python3 00-system/skills/google/google-calendar/scripts/calendar_operations.py list --max 10
python3 00-system/skills/google/google-calendar/scripts/calendar_operations.py list --max 10
Find available slots
查找可用时段
python3 00-system/skills/google/google-calendar/scripts/calendar_operations.py find-slots --duration 30 --from "2025-12-16" --to "2025-12-20"
undefinedpython3 00-system/skills/google/google-calendar/scripts/calendar_operations.py find-slots --duration 30 --from "2025-12-16" --to "2025-12-20"
undefinedGoogle Drive
Google Drive
bash
undefinedbash
undefinedList files in root
列出根目录下的文件
python3 00-system/skills/google/google-drive/scripts/drive_operations.py list
python3 00-system/skills/google/google-drive/scripts/drive_operations.py list
Upload file
上传文件
python3 00-system/skills/google/google-drive/scripts/drive_operations.py upload ./local_file.pdf
python3 00-system/skills/google/google-drive/scripts/drive_operations.py upload ./local_file.pdf
Download file
下载文件
python3 00-system/skills/google/google-drive/scripts/drive_operations.py download <file_id> --output ./downloaded.pdf
undefinedpython3 00-system/skills/google/google-drive/scripts/drive_operations.py download <file_id> --output ./downloaded.pdf
undefinedGoogle Tasks
Google Tasks
bash
undefinedbash
undefinedList tasks
列出任务
python3 00-system/skills/google/google-tasks/scripts/tasks_operations.py tasks
python3 00-system/skills/google/google-tasks/scripts/tasks_operations.py tasks
Create task
创建任务
python3 00-system/skills/google/google-tasks/scripts/tasks_operations.py create "Call John" --due 2025-12-20
python3 00-system/skills/google/google-tasks/scripts/tasks_operations.py create "Call John" --due 2025-12-20
Complete task
完成任务
python3 00-system/skills/google/google-tasks/scripts/tasks_operations.py complete <task_id>
undefinedpython3 00-system/skills/google/google-tasks/scripts/tasks_operations.py complete <task_id>
undefinedGoogle Slides
Google Slides
bash
undefinedbash
undefinedList presentations
列出演示文稿
python3 00-system/skills/google/google-slides/scripts/slides_operations.py list
python3 00-system/skills/google/google-slides/scripts/slides_operations.py list
Create presentation
创建演示文稿
python3 00-system/skills/google/google-slides/scripts/slides_operations.py create "Q4 Report"
python3 00-system/skills/google/google-slides/scripts/slides_operations.py create "Q4 Report"
Export to PDF
导出为PDF
python3 00-system/skills/google/google-slides/scripts/slides_operations.py export <presentation_id> ./report.pdf
---python3 00-system/skills/google/google-slides/scripts/slides_operations.py export <presentation_id> ./report.pdf
---Structure
结构
google/
├── SKILL.md # This file (bundle overview)
├── google-connect/ # Setup wizard (say "connect google")
│ └── SKILL.md # Interactive setup workflow
├── google-master/ # Shared resources (DO NOT load directly)
│ ├── SKILL.md # Documentation for shared resources
│ ├── scripts/
│ │ ├── google_auth.py # Unified OAuth for all services
│ │ └── check_google_config.py # Pre-flight validation
│ └── references/
│ ├── setup-guide.md # Complete setup instructions
│ └── error-handling.md # Common errors and solutions
├── gmail/
│ ├── SKILL.md # Gmail-specific docs
│ └── scripts/gmail_operations.py
├── google-docs/
│ ├── SKILL.md # Docs-specific docs
│ └── scripts/docs_operations.py
├── google-sheets/
│ ├── SKILL.md # Sheets-specific docs
│ └── scripts/sheets_operations.py
├── google-calendar/
│ ├── SKILL.md # Calendar-specific docs
│ └── scripts/calendar_operations.py
├── google-drive/
│ ├── SKILL.md # Drive-specific docs
│ └── scripts/drive_operations.py
├── google-tasks/
│ ├── SKILL.md # Tasks-specific docs
│ └── scripts/tasks_operations.py
└── google-slides/
├── SKILL.md # Slides-specific docs
└── scripts/slides_operations.pygoogle/
├── SKILL.md # 本文件(集成概览)
├── google-connect/ # 设置向导(说出"connect google")
│ └── SKILL.md # 交互式设置流程
├── google-master/ # 共享资源(请勿直接加载)
│ ├── SKILL.md # 共享资源文档
│ ├── scripts/
│ │ ├── google_auth.py # 所有服务的统一OAuth认证
│ │ └── check_google_config.py # 预检验证
│ └── references/
│ ├── setup-guide.md # 完整设置说明
│ └── error-handling.md # 常见错误及解决方案
├── gmail/
│ ├── SKILL.md # Gmail专属文档
│ └── scripts/gmail_operations.py
├── google-docs/
│ ├── SKILL.md # Docs专属文档
│ └── scripts/docs_operations.py
├── google-sheets/
│ ├── SKILL.md # Sheets专属文档
│ └── scripts/sheets_operations.py
├── google-calendar/
│ ├── SKILL.md # Calendar专属文档
│ └── scripts/calendar_operations.py
├── google-drive/
│ ├── SKILL.md # Drive专属文档
│ └── scripts/drive_operations.py
├── google-tasks/
│ ├── SKILL.md # Tasks专属文档
│ └── scripts/tasks_operations.py
└── google-slides/
│ ├── SKILL.md # Slides专属文档
│ └── scripts/slides_operations.pySetup
设置步骤
Prerequisites
前置依赖
bash
pip install google-auth google-auth-oauthlib google-api-python-clientbash
pip install google-auth google-auth-oauthlib google-api-python-client1. Create Google Cloud Project
1. 创建Google Cloud项目
- Go to Google Cloud Console
- Create or select a project
- Enable APIs: Gmail, Docs, Sheets, Calendar, Drive, Tasks, Slides
- 访问Google Cloud Console
- 创建或选择一个项目
- 启用API:Gmail、Docs、Sheets、Calendar、Drive、Tasks、Slides
2. Create OAuth Credentials
2. 创建OAuth凭据
- Go to APIs & Services > Credentials
- Create OAuth 2.0 Client ID (Desktop app)
- Copy the Client ID and Client Secret
- Add to file (at Nexus root):
.envGOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com GOOGLE_CLIENT_SECRET=your-client-secret GOOGLE_PROJECT_ID=your-project-id
- 进入API与服务 > 凭据
- 创建OAuth 2.0客户端ID(桌面应用)
- 复制客户端ID和客户端密钥
- 添加到根目录的文件中:
.envGOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com GOOGLE_CLIENT_SECRET=your-client-secret GOOGLE_PROJECT_ID=your-project-id
3. Authenticate
3. 进行认证
bash
python3 00-system/skills/google/google-master/scripts/google_auth.py --loginThis opens a browser to grant permissions for all services at once.
For detailed setup: google-master/references/setup-guide.md
bash
python3 00-system/skills/google/google-master/scripts/google_auth.py --login这将打开浏览器,一次性授予所有服务的权限。
详细设置说明:google-master/references/setup-guide.md
Error Handling
错误处理
See google-master/references/error-handling.md for:
- Authentication errors (401, 403)
- Rate limiting (429)
- Permission issues
- Token refresh problems
请查看google-master/references/error-handling.md了解:
- 认证错误(401、403)
- 速率限制(429)
- 权限问题
- 令牌刷新问题
File Locations
文件位置
| File | Path | Purpose |
|---|---|---|
| OAuth credentials | | App identity |
| Access token | | User's auth token |
Both and token file are in and will not be committed.
.env.gitignore| 文件 | 路径 | 用途 |
|---|---|---|
| OAuth凭据 | | 应用身份标识 |
| 访问令牌 | | 用户的认证令牌 |
.env.gitignoreSecurity Notes
安全说明
- Credentials (file) - in
.env, never committed.gitignore - Token file () - in
google-token.json, never committed.gitignore - Each user authenticates with their own Google account
- 凭据(文件)- 已加入
.env,切勿提交.gitignore - 令牌文件()- 已加入
google-token.json,切勿提交.gitignore - 每个用户使用自己的Google账号进行认证