← Back to Skills Marketplace
jack-piplabs

Google Drive

by jack-piplabs · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ⚠ suspicious
362
Downloads
0
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install google-drive-service-account
Description
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...
README (SKILL.md)

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 [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 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 \x3CsheetId> --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.
Usage Guidance
This skill implements a reasonable Google Drive helper, but review the following before installing: (1) The metadata incorrectly marks all four env vars as required; you only need to provide either a service account key OR an OAuth refresh token (and client_id/secret only for token refresh). Do not upload or paste credentials you don't need. (2) The script writes your service-account private key to a temporary file and calls openssl to sign JWTs — ensure you run it on a trusted host and that the provided key has least privilege. (3) The install step only lists Homebrew/python; on non-mac systems ensure python3 and openssl are available from trusted OS packages. (4) Because the skill can use whichever credentials you give it to access Drive, treat the provided tokens/keys as highly sensitive and consider testing in a restricted environment or reviewing the script fully before supplying secrets. If you are uncomfortable giving broad Drive access, do not install or restrict the credentials to a low-privilege Drive account.
Capability Analysis
Type: OpenClaw Skill Name: google-drive-service-account Version: 1.0.2 The skill bundle provides a functional tool for interacting with Google Drive via service accounts or OAuth. The Python script (scripts/gdrive_sa.py) implements standard Drive API operations (search, list, upload, download) using built-in libraries and the system 'openssl' binary for JWT signing. While it briefly writes the private key to a temporary file with restricted permissions (0o600) to facilitate signing, it uses a try-finally block for cleanup and does not exhibit any signs of data exfiltration, malicious execution, or intentional prompt injection.
Capability Assessment
Purpose & Capability
The script and SKILL.md implement Google Drive operations (search, list, download, upload, export) and require python3/openssl — these are coherent with the stated purpose. However, the registry metadata declares all four environment variables as required even though the skill's own documentation and code say it uses EITHER a service account JSON OR an OAuth refresh token; that mismatch is disproportionate.
Instruction Scope
SKILL.md instructs only Drive-related commands (whoami, search, ls, info, download/export/cat, mkdir, upload). The runtime instructions and examples use only Google Drive endpoints and the declared env vars; there is no instruction to read unrelated system files or contact unexpected endpoints.
Install Mechanism
Install spec only offers a Homebrew formula to install python (formula: python). That's an ordinary way to ensure python3 on macOS but is not cross-platform; there is no remote download or execution of arbitrary code. If running on non-mac systems, the install step is inapplicable and the skill expects python3 to already be present.
Credentials
The skill's metadata lists GOOGLE_SERVICE_ACCOUNT_KEY, GOOGLE_OAUTH_REFRESH_TOKEN, GOOGLE_CLIENT_ID, and GOOGLE_CLIENT_SECRET as required env vars and designates the refresh token as primary. In practice the code uses either a service-account key OR an OAuth refresh token (plus client id/secret only when exchanging a refresh token). Requiring all four is disproportionate and forces users to provide credentials they may not need. The skill will have full Drive access for whichever credential you supply, so granting these values to the agent is sensitive.
Persistence & Privilege
always is false and the skill is user-invocable; it does not request permanent agent inclusion or cross-skill configuration changes. The agent can invoke the skill autonomously by default (platform normal), but no extra privileges are requested.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install google-drive-service-account
  3. After installation, invoke the skill by name or use /google-drive-service-account
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.2
- Added explicit environment variable requirements and listing to skill metadata (`GOOGLE_SERVICE_ACCOUNT_KEY`, `GOOGLE_OAUTH_REFRESH_TOKEN`, `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET`). - Specified `GOOGLE_OAUTH_REFRESH_TOKEN` as the primary environment variable in metadata. - No changes to functionality or code; documentation/metadata improvements only.
v1.0.1
Expanded authentication support to include Google OAuth connector. - Now supports both service account (GOOGLE_SERVICE_ACCOUNT_KEY) and dashboard OAuth (GOOGLE_OAUTH_REFRESH_TOKEN) authentication. - Chooses OAuth mode automatically if relevant environment variables are set. - Updated description and instructions to cover both authentication types. - Service account impersonation and domain delegation notes clarified. - Reminder added that OAuth mode requires client ID and secret.
v1.0.0
Initial release of Google Drive access via service accounts for OpenClaw. - Supports Google Drive file search, listing, metadata inspection, downloads, exports, uploads, and folder creation. - Uses service account credentials via `GOOGLE_SERVICE_ACCOUNT_KEY`; supports delegated user impersonation if configured. - Provides command-line interface using Python scripts for key Drive actions. - Compatible with shared files and team drives with `supportsAllDrives=true` and Drive query features. - Includes quick-start commands and usage examples for common actions.
Metadata
Slug google-drive-service-account
Version 1.0.2
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 362 downloads so far.

How do I install Google Drive?

Run "/install google-drive-service-account" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Google Drive free?

Yes, Google Drive is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Google Drive support?

Google Drive is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Google Drive?

It is built and maintained by jack-piplabs (@jack-piplabs); the current version is v1.0.2.

💬 Comments