| name | gdocs |
| description | This skill should be used when the user asks to "read document", "create document", "edit document", "google doc", "list documents", "insert text", "append text", "find and replace", "export document", "export to pdf", "export to word", "download as pdf", or mentions Google Docs operations. Provides Google Docs API integration for reading, writing, exporting, and managing documents. |
| version | 0.3.0 |
Google Docs Skill
Create, read, edit, and export Google Docs documents.
First-Time Setup
Run npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail/scripts/gmail.ts auth to authenticate with Google. This opens a browser for OAuth consent and grants access to all Google services including Docs.
Tokens are stored per-project in .claude/google-skill.local.json.
Using Your Own Credentials (Optional)
By default, this skill uses embedded OAuth credentials. To use your own Google Cloud project instead, save your credentials to ~/.config/google-skill/credentials.json.
Commands
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gdocs/scripts/gdocs.ts list
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gdocs/scripts/gdocs.ts list --max=50
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gdocs/scripts/gdocs.ts get <documentId>
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gdocs/scripts/gdocs.ts read <documentId>
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gdocs/scripts/gdocs.ts create --title="My Document"
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gdocs/scripts/gdocs.ts insert <documentId> --text="Hello World\n"
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gdocs/scripts/gdocs.ts insert <documentId> --text="Inserted here" --index=50
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gdocs/scripts/gdocs.ts append <documentId> --text="\n\nNew paragraph at the end."
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gdocs/scripts/gdocs.ts replace <documentId> \
--find="old text" \
--replace="new text"
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gdocs/scripts/gdocs.ts replace <documentId> \
--find="Hello" \
--replace="Hi" \
--match-case
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gdocs/scripts/gdocs.ts export <documentId>
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gdocs/scripts/gdocs.ts export <documentId> --format=docx
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gdocs/scripts/gdocs.ts export <documentId> --format=odt
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gdocs/scripts/gdocs.ts export <documentId> --format=pdf --output=./report.pdf
Export Formats
| Format | Extension | Description |
|---|
| pdf | .pdf | Portable Document Format (default) |
| docx | .docx | Microsoft Word |
| odt | .odt | OpenDocument Text |
| txt | .txt | Plain text |
| html | .html | Web page |
| rtf | .rtf | Rich Text Format |
| epub | .epub | E-book format |
Text Formatting Notes
- Use
\n for newlines in text arguments
- Use
\t for tabs
- Text is inserted as plain text (no rich formatting via CLI)
- For complex formatting, use the Google Docs web interface
Document IDs
Document IDs can be found in the URL of any Google Doc:
https://docs.google.com/document/d/{documentId}/edit
Or use the list command to see your recent documents with their IDs.
Output
All commands return JSON with success and data fields.
Help
npx tsx ${CLAUDE_PLUGIN_ROOT}/skills/gdocs/scripts/gdocs.ts --help