google-drive-sheets
它能做什么
让助手处理你的 Google Drive、Docs、Sheets 和 Slides 文件。适合把工作文档保存在 Google 中、并希望获得阅读或修改帮助的人。
适用场景
- ✓当你要求助手在 Google Drive 中查找某个文件时。
- ✓当你希望它阅读或编辑 Google 文档、表格或幻灯片时。
- ✓当某个文件无法打开,而你需要有关其共享设置的帮助时。
技能链接
https://github.com/yc-software/qm/blob/main/skills-seed/google-drive-sheets/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请在 Google Drive 中找到我的预算表格,并总结第一个工作表中的合计数。”
每周 5 个新技能,1 分钟读完。
工作原理
助手会使用你已连接的 Google 访问权限处理 Drive、Docs、Sheets 和 Slides。它只阅读或修改你的账户可以访问的文件。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Google Drive / Docs / Sheets / Slides
Use this skill when the user asks about Drive files, Google Docs, Google Sheets, Google Slides, sharing/access problems, or reading/editing any of that content.
This is an OAuth connector. The resolved user's Google OAuth token already lives on your computer as an environment variable, one per Google API host (the way a logged-in CLI's cached credential would):
$VAULT_TOKEN_WWW_GOOGLEAPIS_COM— forwww.googleapis.com(Drive)$VAULT_TOKEN_SHEETS_GOOGLEAPIS_COM— forsheets.googleapis.com(Sheets)$VAULT_TOKEN_DOCS_GOOGLEAPIS_COM— fordocs.googleapis.com(Docs)$VAULT_TOKEN_SLIDES_GOOGLEAPIS_COM— forslides.googleapis.com(Slides)
These all carry the same Google token (one OAuth grant spans every Google API), so
if a host-specific var is empty (e.g. an older connection made before that host was
added), $VAULT_TOKEN_WWW_GOOGLEAPIS_COM works as the bearer for any Google API host.
Call the Google APIs directly over https:// with curl and pass the matching token
as a bearer header (-H "Authorization: Bearer $VAULT_TOKEN_..."). Do not ask the user
for a token, log it, or use another principal's credential or a service fallback.
If the variable is empty or the API returns 401/403 or a file is inaccessible, tell the user which Google account/principal needs access and whether they should connect Google or share the file with that account.
Find files
Search Drive by name, owner, MIME type, or recency:
curl -sS --get 'https://www.googleapis.com/drive/v3/files' \
-H "Authorization: Bearer $VAULT_TOKEN_WWW_GOOGLEAPIS_COM" \
--data-urlencode "q=name contains 'deadline' and trashed=false" \
--data-urlencode 'fields=nextPageToken,files(id,name,mimeType,webViewLink,owners(emailAddress,displayName),modifiedTime)' \
--data-urlencode 'corpora=allDrives' \
--data-urlencode 'includeItemsFromAllDrives=true' \
--data-urlencode 'supportsAllDrives=true' \
--data-urlencode 'pageSize=100'
The three allDrives params matter: without them the API searches only "My Drive",
and files living in shared drives — most team docs — are invisible, so you'd wrongly
report a file doesn't exist. If the response has a nextPageToken, keep fetching with
pageToken= before concluding anything is missing.
For a specific file, fetch metadata first:
curl -sS 'https://www.googleapis.com/drive/v3/files/FILE_ID?supportsAllDrives=true&fields=id,name,mimeType,webViewLink,owners(emailAddress,displayName),capabilities' \
-H "Authorization: Bearer $VAULT_TOKEN_WWW_GOOGLEAPIS_COM"
Add supportsAllDrives=true to every per-file call (get, download, PATCH, DELETE) —
without it, operations on shared-drive files 404.
Read files
For uploaded files, download media:
curl -sS 'https://www.googleapis.com/drive/v3/files/FILE_ID?alt=media' \
-H "Authorization: Bearer $VAULT_TOKEN_WWW_GOOGLEAPIS_COM" \
-o inbox/drive-file.bin
For Google Docs/Sheets/Slides, export to a useful format:
curl -sS --get 'https://www.googleapis.com/drive/v3/files/FILE_ID/export' \
-H "Authorization: Bearer $VAULT_TOKEN_WWW_GOOGLEAPIS_COM" \
--data-urlencode 'mimeType=text/plain'
Keep source file ids and links in your answer so claims can be traced.
Read Sheets
Read values from a named range:
curl -sS 'https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values/Sheet1!A1:Z100' \
-H "Authorization: Bearer $VAULT_TOKEN_SHEETS_GOOGLEAPIS_COM"
For workbook structure:
curl -sS 'https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID?includeGridData=false' \
-H "Authorization: Bearer $VAULT_TOKEN_SHEETS_GOOGLEAPIS_COM"
Writes require approval
Creating, moving, sharing, or editing Drive/Sheets content is a write. Prepare the exact change, summarize the target file/range, and ask for approval before running it.
After approval, update values:
curl -sS -X PUT 'https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values/Sheet1!A1:B2?valueInputOption=USER_ENTERED' \
-H "Authorization: Bearer $VAULT_TOKEN_SHEETS_GOOGLEAPIS_COM" \
-H 'content-type: application/json' \
--data @values.json
Always report the file id/link and the modified range.
Persist a file to Drive (upload)
You can save a file you produced (a report, an export, a generated artifact) into the user's Drive. This is a write — summarize what you're uploading and where, and get approval first.
After
常见问题
如果助手无法打开某个文件怎么办?
它会告诉你需要哪个 Google 账户获得访问权限。之后你可以请文件所有者将文件共享给该账户。
它能编辑共享文档吗?
可以,前提是你的账户具有编辑权限。否则助手会说明该文件无法访问。
它需要我的 Google 密码吗?
不需要。它使用你在连接 Google 时已经授予的访问权限。
详情
作者的原始描述
Find, read, export, edit, and manage the user's Google Drive, Docs, Sheets, and Slides through per-user OAuth.
repo: yc-software/qm
热度
- GitHub 星标
- 16k
- 排名
- #10893
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
deploy-qm
16k按照完整的部署清单,将 QM 软件包部署到 Fly.io、AWS 或 Render,然后设置管理员、连接器,并可选择连接 Slack。
onboarding
16k在一段简短的对话中,引导新用户连接账户、说明自己的工作方式、选择语音,并设置最初的帮助内容。
admin
16k让经过验证的组织管理员在聊天中查看或更改全组织范围的设置及其他范围,并在每项更改前进行确认。
browse
16k从你的 shell 驱动真实的隐身浏览器,在网站上执行操作,例如登录或填写表单,并按人保存登录状态。仅用于操作,不用于阅读。