| name | gcmd |
| description | Export and access Google Drive files (docs, sheets, meeting notes) |
Google Drive CLI (gcmd) Skill
Quick reference for using gcmd CLI tool to work with Google Drive files.
Repository: https://github.com/shanemcd/gcmd
Quick Start
The easiest way to use gcmd is with uvx - no installation or repository cloning required:
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd export "https://docs.google.com/document/d/FILE_ID/edit" -o /tmp/
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd export "https://docs.google.com/spreadsheets/d/FILE_ID/edit" -o /tmp/
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd list
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd list -q "quarterly report"
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd info -v "https://docs.google.com/document/d/FILE_ID/edit"
Tip: Add an alias to your shell for convenience:
alias gcmd='uvx --from "git+https://github.com/shanemcd/gcmd" gcmd'
gcmd export "https://docs.google.com/document/d/FILE_ID/edit" -o /tmp/
Overview
gcmd is a Python CLI tool for working with Google Drive from the command line. Useful for:
- Exporting Google Docs as markdown for processing/archival
- Exporting Google Sheets as CSV (one file per sheet)
- Listing and searching Drive files
- Downloading files
- Viewing file metadata, permissions, and comments
- Reviewing document feedback and collaboration
When to Use This Skill
Use this skill when:
- User asks to export Google Docs as markdown
- User asks to export Google Sheets as CSV
- User provides a Google Drive URL and wants to read/access the content
- User asks to search for files in Google Drive
- User wants to view file permissions or comments on Google Docs
- User mentions "meeting notes" or "Gemini notes" from Google Meet
- User asks to list recent Google Drive files
Common Commands
Export Google Docs as Markdown
RECOMMENDED: Export to /tmp/ for easy reading by Claude Code
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd export "https://docs.google.com/document/d/FILE_ID/edit" -o /tmp/
Export to specific file path:
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd export FILE_ID -o /tmp/meeting-notes.md
Export all tabs as separate files:
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd export --all-tabs FILE_ID -o /tmp/
How -o works:
- Without
-o: Saves to current directory using document title + .exported.md
- With
-o /tmp/ (directory): Saves to /tmp/ using document title + .md extension (no .exported)
- With
-o /tmp/file.md (file): Saves to exact path /tmp/file.md
After exporting, ALWAYS read the file to provide the user with the content.
Export Google Sheets as CSV
Export creates a directory with one CSV file per sheet:
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd export "https://docs.google.com/spreadsheets/d/FILE_ID/edit" -o /tmp/
How it works:
- Auto-detects Google Sheets vs Docs based on URL/file type
- Creates a directory named after the spreadsheet
- Exports each sheet/tab as a separate CSV file
- Includes retry logic with exponential backoff for rate limiting
After exporting, read the CSV files to provide the user with the content.
List and Search Files
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd list
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd list -q "quarterly report"
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd list -t docs
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd list -v -n 10
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd list -t folders
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd list -t sheets
View File Info
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd info "https://docs.google.com/document/d/FILE_ID/edit"
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd info -v "https://docs.google.com/document/d/FILE_ID/edit"
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd info --show-comments "https://docs.google.com/document/d/FILE_ID/edit"
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd info FILE_ID -v
Detailed info shows:
- File metadata (name, type, size, dates)
- Owner and last modifier
- All permissions (users, groups, domains, public links)
- Your capabilities (can edit, comment, share, download, etc.)
- Document tabs (for multi-tab Google Docs)
- Document outline with all headings
- Comments and replies with quoted text, authors, timestamps, and status (resolved/deleted)
Download Files
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd download FILE_ID
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd download FILE_ID -o ~/Downloads/myfile.pdf
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd download "https://drive.google.com/file/d/FILE_ID/view"
URL Format Support
All commands accept multiple URL formats:
https://docs.google.com/document/d/FILE_ID/edit
https://docs.google.com/document/d/FILE_ID/edit?tab=t.0
https://docs.google.com/spreadsheets/d/FILE_ID/edit
https://docs.google.com/presentation/d/FILE_ID/edit
https://drive.google.com/file/d/FILE_ID/view
FILE_ID
Workflow Example
When user provides a Google Drive URL:
-
Export the document to /tmp/:
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd export "URL" -o /tmp/
-
Read the exported file:
The file will be in /tmp/ with the document title as filename.
-
Provide the content to the user or answer their questions about it.
-
Optional cleanup: After helping the user, you can delete the exported file:
rm /tmp/exported-filename.md
Common Workflow Examples
Find and export a document
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd list -q "MCP Server Analysis" -t docs
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd info -v "https://docs.google.com/document/d/FILE_ID/edit"
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd export --all-tabs FILE_ID -o /tmp/
Check permissions on shared docs
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd info -v FILE_ID
Review document feedback
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd info --show-comments "https://docs.google.com/document/d/FILE_ID/edit"
List recent work documents
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd list -t docs -v -n 20
Export a spreadsheet for analysis
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd export "https://docs.google.com/spreadsheets/d/FILE_ID/edit" -o /tmp/
ls /tmp/Spreadsheet\ Title/
cat "/tmp/Spreadsheet Title/Sheet1.csv"
Key Features
- URL support: All commands accept full Google Drive URLs or file IDs
- Native markdown export: Preserves formatting (headings, tables, links, bold, italic)
- Sheets CSV export: Export Google Sheets to CSV (one file per sheet in a directory)
- Multi-tab documents: Use
--all-tabs to export each tab separately
- Detailed info: View permissions, sharing, capabilities, document structure
- Comments access: View all comments and replies with quoted text, authors, and timestamps
- Auto-naming: Exported files use
.exported.md extension (auto-ignored by git) when no -o specified
- Rate limit handling: Automatic retries with exponential backoff for API rate limits
Authentication
First-Time Setup
Before first use, you need OAuth credentials:
- Go to Google Cloud Console
- Create a new project or select existing
- Enable APIs:
- Create OAuth 2.0 Client ID credentials:
- Click "+ CREATE CREDENTIALS" → "OAuth client ID"
- Application type: "Desktop app"
- Name: "gcmd" (or anything)
- Download the JSON file
- Save to:
~/.config/gcmd/credentials.json
First Run
On first use, your browser will open for authentication:
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd list
Token is cached at ~/.config/gcmd/token.json for future use.
Troubleshooting Authentication
If authentication fails, delete token and re-authenticate:
rm ~/.config/gcmd/token.json
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd list
Important Notes
- Always use
/tmp/ for exports - Makes files easy to find and read
- No installation required - Use
uvx to run directly from GitHub
- Read exported files - After exporting, read the file and provide content to user
- Clean up after - Delete exported files from /tmp/ when done
Troubleshooting
"credentials.json not found": Follow the Authentication setup steps above to create OAuth credentials
"Authentication failed": Delete token and re-authenticate:
rm ~/.config/gcmd/token.json
uvx --from "git+https://github.com/shanemcd/gcmd" gcmd list
"Not a Google Doc": Use download command instead of export for non-Doc files
Browser won't open: The CLI will provide a manual URL to paste in your browser
Tips
-
Add a shell alias for convenience:
alias gcmd='uvx --from "git+https://github.com/shanemcd/gcmd" gcmd'
-
Export location: Always use -o /tmp/ when exporting so files are in a predictable location for easy reading
-
File naming: Without -o, exported files use .exported.md extension. With -o /dir/, uses .md
-
Multi-tab documents: Use --all-tabs to export each tab as a separate file
-
Verbose mode: Use -v for detailed information (permissions, structure, comments, etc.)
-
Comments: Use --show-comments to view just comments without other verbose details
-
Search: The -q flag searches both file names and content
Links
Last updated: 2026-01-20