google-drive
Original:🇺🇸 English
Translated
23 scripts
Manage Google Drive files with manifest-tracked push/pull workflows via rclone. Use when the user needs to download, upload, list, or manage files on Google Drive shared drives.
4installs
Sourceusetemi/skills
Added on
NPX Install
npx skill4agent add usetemi/skills google-driveTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Google Drive
Architecture
gdrivegdriveDesigned for a pull-edit-push cycle, especially paired with Anthropic's official document skills for reading and editing office files: , , , and (from ).
docxxlsxpptxpdfhttps://github.com/anthropics/skillsBefore First Use
Before running any gdrive command, ensure dependencies are available. Check and install silently -- don't ask the user for permission to install these.
- rclone: Run . If missing, install it:
which rclone- Linux: (or
sudo apt install -y rclone)curl https://rclone.org/install.sh | sudo bash - macOS:
brew install rclone
- Linux:
- uv: Run . If missing:
which uvcurl -LsSf https://astral.sh/uv/install.sh | sh - Project sync: Run to ensure the venv and deps are ready.
uv sync --project <skill-dir> - Auth: Run . If it shows "No remotes configured", the user needs to run
gdrive ls(interactive -- tell the user what's about to happen and that they'll need to complete OAuth in a browser).gdrive auth setup
For headless machines (no ), instruct the user to set up an SSH tunnel first:
$DISPLAYssh -L 53682:localhost:53682 <remote-host>Then run on the remote host and open the printed URL on their local machine.
gdrive auth setupSee for the full setup guide.
references/setup.mdInvocation
All commands use this pattern:
bash
uv run --project /path/to/skills/google-drive gdrive <command> [args]For brevity, examples below use directly.
gdriveCommands
auth -- Manage remotes
bash
gdrive auth setup # interactive: configure rclone remotes (run once per machine)
gdrive auth status # report which remotes are configured and authenticate
gdrive auth logout # forget gdrive's remote registrations (rclone state stays)ls -- List drives or files
bash
# List configured remotes
gdrive ls
# List files at a remote path
gdrive ls mydrive:
gdrive ls mydrive:Projects/2025/
# Detailed listing
gdrive ls -l mydrive:Reports/
# Recursive listing
gdrive ls -R mydrive:Templates/cp -- Copy files on remote
bash
gdrive cp mydrive:Reports/Q4-Summary.docx mydrive:Archive/Q4-Summary.docxServer-side copy. Works across different remotes (unlike mv). Does not update the manifest.
pull -- Download files
bash
# Download to current directory
gdrive pull mydrive:Reports/Q4-Summary
# Download to specific location
gdrive pull mydrive:Reports/Q4-Summary ./reports/
# Force overwrite local changes
gdrive pull -f mydrive:Reports/Q4-Summary
# Pull all files in a folder
gdrive pull mydrive:Reports/
# Pull to a specific local directory
gdrive pull mydrive:Reports/ ./local-reports/
# Filter by glob pattern
gdrive pull mydrive:Reports/ --include "*.docx"
# Recursive pull (includes subdirectories)
gdrive pull -R mydrive:Projects/Google Docs/Sheets/Slides are automatically exported:
| Google Format | Exported As |
|---|---|
| Google Doc | .docx |
| Google Sheet | .xlsx |
| Google Slides | .pptx |
The manifest tracks the original MIME type so push can re-import correctly.
push -- Upload files
bash
# Push a tracked file (uses manifest for destination)
gdrive push ./Q4-Summary.docx
# Push to explicit destination
gdrive push ./report.docx mydrive:Reports/Q4-Summary.docx
# Force overwrite
gdrive push -f ./Q4-Summary.docx
# Push all locally-modified tracked files
gdrive push --all
# Filter batch push by remote
gdrive push --all -r mydrive
# Force batch push (skip conflict checks)
gdrive push --all -fFormat-aware upload: if a file was originally a Google Doc (per manifest), it's automatically re-imported as a Google Doc on push. For new files, you'll be prompted.
Conflict detection: if the remote file changed since last sync, push prompts before overwriting. Use to skip.
-fstatus -- Check sync state
bash
# Show all tracked files
gdrive status
# Filter by remote
gdrive status -r mydriveCategories:
- Up to date -- local matches last sync
- Local changes -- local file modified since last pull
- Missing locally -- tracked file deleted or moved locally
mkdir -- Create directories
bash
gdrive mkdir mydrive:Projects/2025/NewProjectmv -- Move files on remote
bash
gdrive mv mydrive:old/path.docx mydrive:new/path.docxUpdates manifest entries referencing the moved path.
search -- Find files
bash
# Search all configured remotes
gdrive search budget
# Search a specific remote
gdrive search mydrive: budget reportUses Google Drive's name-contains query. Shows results with file type, date, and web link.
rm -- Delete remote files
bash
gdrive rm mydrive:path/to/old-file.docx
gdrive rm -f mydrive:path/to/old-file.docx # skip confirmationDeletes the remote file and cleans up any matching manifest entries.
untrack -- Remove from manifest
bash
gdrive untrack ./local-file.docxRemoves the file from manifest tracking without deleting anything locally or on the remote.
doctor -- Health check
bash
gdrive doctorValidates: rclone installed, config file exists, all remotes have working tokens, no orphaned rclone remotes, all manifest entries have existing local files.
open -- Get web URL
bash
gdrive open mydrive:Reports/Q4-SummaryPrints the Google Drive web URL for the file.
link -- Get shareable link
bash
gdrive link mydrive:Reports/Q4-SummaryPrints a shareable Google Drive link for the file.
share -- Set permissions
bash
# Share with a user (default: reader)
gdrive share mydrive:Reports/Q4-Summary.docx user@example.com
# Share as writer
gdrive share mydrive:Reports/Q4-Summary.docx user@example.com --role writer
# Share as commenter
gdrive share mydrive:Reports/Q4-Summary.docx user@example.com --role commenter
# Share with anyone who has the link
gdrive share mydrive:Reports/Q4-Summary.docx --anyoneCalls the Google Drive API directly (rclone has no sharing support). Uses the OAuth token from rclone config.
Workflow: Pull-Edit-Push
The primary workflow for editing Google Drive documents:
bash
# 1. Pull the document (exports Google Doc as .docx)
gdrive pull mydrive:Proposals/Client-Brief
# 2. Edit with a document skill
# (use docx, xlsx, or pptx skill to read/modify the file)
# 3. Check what changed
gdrive status
# 4. Push back (re-imports as Google Doc)
gdrive push ./Client-Brief.docxMixed editing (agent XML + user in Google Docs):
If the user edited the doc directly in Google Docs between sessions, the pulled version may have different structure (reordered sections, removed content). Always re-inspect with before editing XML. Don't assume previous XML line numbers or structure.
pandocManifest
The manifest at tracks:
~/.config/skills/gdrive/manifest.json- Remote location and Google Drive file ID
- Original MIME type (for format-aware re-import)
- MD5 hashes at last sync (local and remote)
- Timestamps for change detection
The manifest enables:
- Pushing tracked files without specifying the remote path
- Detecting local modifications via MD5 comparison
- Re-importing exported Google Docs as native format on push
- Detecting moved files by MD5 hash
Remote Naming Convention
Shared drives are configured as separate rclone remotes. Pick a short prefix per drive so commands stay readable, e.g.:
- -- a personal My Drive
mydrive - -- an engineering shared drive
team-engineering - -- a design shared drive
team-design
Lowercased, hyphenated names work best. The wizard suggests names based on each drive's title and lets you override.
authTroubleshooting
"File not found" on pull -- Check the path with first. Google Docs don't have file extensions on the remote.
gdrive ls remote:path/Push doesn't re-import as Google Doc -- Ensure the file was originally pulled (has manifest entry with Google MIME type). For new files, use flag.
--drive-import-formatsManifest out of sync -- Run on stale entries, or delete to reset.
gdrive untrack~/.config/skills/gdrive/manifest.jsonGeneral setup issues -- Run to diagnose problems with rclone, remotes, and manifest health.
gdrive doctorConfiguration Files
- Manifest:
~/.config/skills/gdrive/manifest.json - Config:
~/.config/skills/gdrive/config.json - rclone config: (managed by rclone)
~/.config/rclone/rclone.conf - Override the gdrive config dir with
GDRIVE_CONFIG_DIR=/path/to/dir
Migrating from earlier versions
If upgrading from a build that stored config at , run to move the manifest and config to the new location. emits a until the migration runs.
~/.config/gdrive/gdrive config migrate --applygdrive auth statusdeprecation_warningThe interactive wizard previously invoked as is now . The bare is now a command group containing , , and .
gdrive authgdrive auth setupgdrive authsetupstatuslogoutAdd to in any repo using this skill:
.gitignore.gdrive-manifest.json