Google Drive
/install google-drive-service-account
Google Drive
Use this skill when Google Drive access is available through either:
GOOGLE_SERVICE_ACCOUNT_KEYfor service-account authGOOGLE_OAUTH_REFRESH_TOKENfor the dashboard Google Drive OAuth connector
OAuth mode also needs GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET so the refresh token can be exchanged for an access token.
This skill is for:
- Searching Drive files and folders
- Listing folder contents
- Inspecting file metadata
- Downloading binary files
- Exporting Google Docs, Sheets, and Slides to standard formats
- Uploading files or creating folders
Important behavior:
- The script prefers
GOOGLE_OAUTH_REFRESH_TOKENwhen present, then falls back toGOOGLE_SERVICE_ACCOUNT_KEY. - A service account only sees files it owns, files explicitly shared with the service account email, or a delegated user's Drive when domain-wide delegation is configured.
- If your workspace uses domain-wide delegation, set
[email protected]or pass--subject [email protected]. - For automation and tool use, prefer
--json.
Quick Start
Check access:
python3 {baseDir}/scripts/gdrive_sa.py whoami
Search files:
python3 {baseDir}/scripts/gdrive_sa.py search "name contains 'Q1'" --limit 10
python3 {baseDir}/scripts/gdrive_sa.py search "'root' in parents" --limit 25 --json
List a folder:
python3 {baseDir}/scripts/gdrive_sa.py ls root --limit 50
python3 {baseDir}/scripts/gdrive_sa.py ls \x3CfolderId> --json
Inspect metadata:
python3 {baseDir}/scripts/gdrive_sa.py info \x3CfileId>
Download or export:
python3 {baseDir}/scripts/gdrive_sa.py download \x3CfileId> --out /tmp/file.bin
python3 {baseDir}/scripts/gdrive_sa.py export \x3CfileId> --mime text/plain --out /tmp/doc.txt
python3 {baseDir}/scripts/gdrive_sa.py cat \x3CfileId> --mime text/plain
Create folders and upload files:
python3 {baseDir}/scripts/gdrive_sa.py mkdir "Reports" --parent root
python3 {baseDir}/scripts/gdrive_sa.py upload ./report.pdf --parent \x3CfolderId>
python3 {baseDir}/scripts/gdrive_sa.py upload ./notes.txt --name "meeting-notes.txt" --parent root
Query Tips
Drive search uses the standard Drive query syntax in the q parameter. Useful examples:
name contains 'invoice'mimeType = 'application/vnd.google-apps.folder''root' in parentstrashed = falsemodifiedTime > '2026-01-01T00:00:00Z'
Combined example:
python3 {baseDir}/scripts/gdrive_sa.py search "trashed = false and name contains 'roadmap'" --limit 20 --json
Google Workspace Export MIME Types
Common export choices for Google-native files:
- Docs to plain text:
text/plain - Docs to PDF:
application/pdf - Docs to Word:
application/vnd.openxmlformats-officedocument.wordprocessingml.document - Sheets to CSV:
text/csv - Sheets to XLSX:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet - Slides to PDF:
application/pdf
Example:
python3 {baseDir}/scripts/gdrive_sa.py export \x3CsheetId> --mime text/csv --out /tmp/sheet.csv
Notes
- The script automatically enables
supportsAllDrives=trueandincludeItemsFromAllDrives=true. - OAuth-connected agents act as the connected end user, not as a service account.
rootrefers to the visible root for the authenticated principal.- Use
catonly for text-friendly outputs. Usedownloadorexport --outfor binary files. - Confirm before uploading or creating folders in shared team drives.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install google-drive-service-account - 安装完成后,直接呼叫该 Skill 的名称或使用
/google-drive-service-account触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Google Drive 是什么?
Access Google Drive from OpenClaw using either GOOGLE_SERVICE_ACCOUNT_KEY service-account JSON or a GOOGLE_OAUTH_REFRESH_TOKEN from the Google Drive OAuth co... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 362 次。
如何安装 Google Drive?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install google-drive-service-account」即可一键安装,无需额外配置。
Google Drive 是免费的吗?
是的,Google Drive 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Google Drive 支持哪些平台?
Google Drive 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Google Drive?
由 jack-piplabs(@jack-piplabs)开发并维护,当前版本 v1.0.2。