google-drive-service-account

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 connector.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "google-drive-service-account" with this command: npx skills add jack-piplabs/google-drive-service-account

Google Drive

Use this skill when Google Drive access is available through either:

  • GOOGLE_SERVICE_ACCOUNT_KEY for service-account auth
  • GOOGLE_OAUTH_REFRESH_TOKEN for 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_TOKEN when present, then falls back to GOOGLE_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 GOOGLE_DRIVE_SUBJECT=user@company.com or pass --subject user@company.com.
  • 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 <folderId> --json

Inspect metadata:

python3 {baseDir}/scripts/gdrive_sa.py info <fileId>

Download or export:

python3 {baseDir}/scripts/gdrive_sa.py download <fileId> --out /tmp/file.bin
python3 {baseDir}/scripts/gdrive_sa.py export <fileId> --mime text/plain --out /tmp/doc.txt
python3 {baseDir}/scripts/gdrive_sa.py cat <fileId> --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 <folderId>
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 parents
  • trashed = false
  • modifiedTime > '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 <sheetId> --mime text/csv --out /tmp/sheet.csv

Notes

  • The script automatically enables supportsAllDrives=true and includeItemsFromAllDrives=true.
  • OAuth-connected agents act as the connected end user, not as a service account.
  • root refers to the visible root for the authenticated principal.
  • Use cat only for text-friendly outputs. Use download or export --out for binary files.
  • Confirm before uploading or creating folders in shared team drives.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Multi Edge-TTS CN

Edge-TTS 在线语音合成 skill。基于微软 Edge TTS 引擎,生成速度快(1-2秒),支持多种音色和输出格式。同时支持飞书(OGG/Opus)和企业微信(AMR)。默认音色 xiaoxiao_lively。需联网。

Registry SourceRecently Updated
General

vedic-destiny

吠陀命盘分析中文入口。用于完整命盘研判、命主盘 Rashi chart 与九分盘 Navamsha chart 联读、既往事件回看、出生时间稳定度判断、事业主题、婚姻主题、时空盘专题,以及基于 Jagannatha Hora PDF、星盘截图或文本命盘数据的系统拆盘。当用户提到完整星盘、事业方向、婚姻问题、关系窗...

Registry SourceRecently Updated
General

One Person Company OS

Build a visual operating cockpit for an AI-native one-person company across promise, buyer, product, delivery, cash, learning, and assets. / 为 AI 一人公司建立可视化经营...

Registry SourceRecently Updated
General

健康追踪

健康追踪技能 - 追踪饮水、睡眠、步数等健康数据,JSON存储。

Registry SourceRecently Updated