google-docs
Interact with Google Docs - create documents, search by title, read content, and edit text. Use when user asks to: create a Google Doc, find a document, read doc content, add text to a doc, or replace text in a document. Lightweight alternative to full Google Workspace MCP server
Install
npx skills add https://github.com/sanjay3290/ai-skills/tree/main/skills/google-docs
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install sanjay3290-ai-skills@llmmart
git clone https://github.com/sanjay3290/ai-skills.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole sanjay3290/ai-skills collection as a plugin from our marketplace. Git is the plain clone.
README
Google Docs Skill
An AI agent skill for interacting with Google Docs - create documents, search by title, read content, and edit text. Works with Claude Code, Gemini CLI, Cursor, OpenAI Codex, Goose, and other AI clients supporting the Agent Skills Standard.
Features
- Create Documents - Create new Google Docs with optional content
- Search - Find documents by title
- Read Content - Extract text from documents
- Edit - Append, insert, or replace text
Lightweight alternative to the full Google Workspace MCP server.
⚠️ Requires Google Workspace account. Personal Gmail accounts are not supported.
Quick Start
1. Install dependencies
pip install keyring
2. Authenticate
python scripts/auth.py login
This opens a browser for Google OAuth. Tokens are stored securely in your system keyring.
3. Test connection
python scripts/auth.py status
Usage Examples
# Create a new document
python scripts/docs.py create "Meeting Notes"
# Create with initial content
python scripts/docs.py create "Project Plan" --content "# Overview\n\nThis is the plan."
# Find documents by title
python scripts/docs.py find "meeting" --limit 10
# Get text content of a document
python scripts/docs.py get-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms
# Get text using a full URL
python scripts/docs.py get-text "https://docs.google.com/document/d/1BxiMVs.../edit"
# Append text to end of document
python scripts/docs.py append-text DOC_ID "New paragraph at the end."
# Insert text at beginning
python scripts/docs.py insert-text DOC_ID "Text at the beginning.\n\n"
# Replace text in document
python scripts/docs.py replace-text DOC_ID "old text" "new text"
Command Reference
| Command | Description | Arguments |
|---|---|---|
create <title> |
Create new document | title, --content |
find <query> |
Search by title | search query, --limit |
get-text <id> |
Get document text | document ID or URL |
append-text <id> <text> |
Append to end | document ID, text |
insert-text <id> <text> |
Insert at start | document ID, text |
replace-text <id> <old> <new> |
Replace text | document ID, old, new |
Document ID Format
Google Docs uses IDs like 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms. You can:
- Use the full URL (ID is extracted automatically)
- Use just the document ID
- Get document IDs from the
findcommand
Token Management
Tokens stored securely using the system keyring:
- macOS: Keychain
- Windows: Windows Credential Locker
- Linux: Secret Service API (GNOME Keyring, KDE Wallet)
Service name: google-docs-skill-oauth
Troubleshooting
"Failed to get access token"
Run python scripts/auth.py login to authenticate.
"Document not found"
Check that the document ID is correct and you have access to the document.
"Permission denied"
You need edit access to modify a document. Check sharing settings.
License
Apache 2.0
Skill manifest
Google Docs
Lightweight Google Docs integration with standalone OAuth authentication. No MCP server required.
⚠️ Requires Google Workspace account. Personal Gmail accounts are not supported.
First-Time Setup
Authenticate with Google (opens browser):
python scripts/auth.py login
Check authentication status:
python scripts/auth.py status
Logout when needed:
python scripts/auth.py logout
Commands
All operations via scripts/docs.py. Auto-authenticates on first use if not logged in.
# Create a new document
python scripts/docs.py create "Meeting Notes"
# Create a document with initial content
python scripts/docs.py create "Project Plan" --content "# Overview\n\nThis is the project plan."
# Find documents by title
python scripts/docs.py find "meeting" --limit 10
# Get text content of a document
python scripts/docs.py get-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms
# Get text using a full URL
python scripts/docs.py get-text "https://docs.google.com/document/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit"
# Append text to end of document
python scripts/docs.py append-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms "New paragraph at the end."
# Insert text at beginning of document
python scripts/docs.py insert-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms "Text at the beginning.\n\n"
# Replace text in document
python scripts/docs.py replace-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms "old text" "new text"
Document ID Format
Google Docs uses document IDs like 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms. You can:
- Use the full URL (the ID will be extracted automatically)
- Use just the document ID
- Get document IDs from the
findcommand results
Token Management
Tokens stored securely using the system keyring:
- macOS: Keychain
- Windows: Windows Credential Locker
- Linux: Secret Service API (GNOME Keyring, KDE Wallet, etc.)
Service name: google-docs-skill-oauth
Access tokens are automatically refreshed when expired using Google's cloud function.
Files (ai-skills)
-
scripts
-
auth.py 12.8 KB
Loading… -
docs.py 10.7 KB
Loading… -
requirements.txt 16 B
Loading…
-
-
README.md 3 KB
# Google Docs Skill An AI agent skill for interacting with Google Docs - create documents, search by title, read content, and edit text. Works with Claude Code, Gemini CLI, Cursor, OpenAI Codex, Goose, and other AI clients supporting the [Agent Skills Standard](https://agentskills.io). ## Features - **Create Documents** - Create new Google Docs with optional content - **Search** - Find documents by title - **Read Content** - Extract text from documents - **Edit** - Append, insert, or replace text Lightweight alternative to the full [Google Workspace MCP server](https://github.com/gemini-cli-extensions/workspace). > **⚠️ Requires Google Workspace account.** Personal Gmail accounts are not supported. ## Quick Start ### 1. Install dependencies ```bash pip install keyring ``` ### 2. Authenticate ```bash python scripts/auth.py login ``` This opens a browser for Google OAuth. Tokens are stored securely in your system keyring. ### 3. Test connection ```bash python scripts/auth.py status ``` ## Usage Examples ```bash # Create a new document python scripts/docs.py create "Meeting Notes" # Create with initial content python scripts/docs.py create "Project Plan" --content "# Overview\n\nThis is the plan." # Find documents by title python scripts/docs.py find "meeting" --limit 10 # Get text content of a document python scripts/docs.py get-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms # Get text using a full URL python scripts/docs.py get-text "https://docs.google.com/document/d/1BxiMVs.../edit" # Append text to end of document python scripts/docs.py append-text DOC_ID "New paragraph at the end." # Insert text at beginning python scripts/docs.py insert-text DOC_ID "Text at the beginning.\n\n" # Replace text in document python scripts/docs.py replace-text DOC_ID "old text" "new text" ``` ## Command Reference | Command | Description | Arguments | |---------|-------------|-----------| | `create <title>` | Create new document | title, `--content` | | `find <query>` | Search by title | search query, `--limit` | | `get-text <id>` | Get document text | document ID or URL | | `append-text <id> <text>` | Append to end | document ID, text | | `insert-text <id> <text>` | Insert at start | document ID, text | | `replace-text <id> <old> <new>` | Replace text | document ID, old, new | ## Document ID Format Google Docs uses IDs like `1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms`. You can: - Use the full URL (ID is extracted automatically) - Use just the document ID - Get document IDs from the `find` command ## Token Management Tokens stored securely using the system keyring: - **macOS**: Keychain - **Windows**: Windows Credential Locker - **Linux**: Secret Service API (GNOME Keyring, KDE Wallet) Service name: `google-docs-skill-oauth` ## Troubleshooting ### "Failed to get access token" Run `python scripts/auth.py login` to authenticate. ### "Document not found" Check that the document ID is correct and you have access to the document. ### "Permission denied" You need edit access to modify a document. Check sharing settings. ## License Apache 2.0 -
requirements.txt 16 B
Loading… -
SKILL.md 2.5 KB
--- name: google-docs description: | Interact with Google Docs - create documents, search by title, read content, and edit text. Use when user asks to: create a Google Doc, find a document, read doc content, add text to a doc, or replace text in a document. Lightweight alternative to full Google Workspace MCP server with standalone OAuth authentication. license: Apache-2.0 metadata: author: sanjay3290 version: "1.0" --- # Google Docs Lightweight Google Docs integration with standalone OAuth authentication. No MCP server required. > **⚠️ Requires Google Workspace account.** Personal Gmail accounts are not supported. ## First-Time Setup Authenticate with Google (opens browser): ```bash python scripts/auth.py login ``` Check authentication status: ```bash python scripts/auth.py status ``` Logout when needed: ```bash python scripts/auth.py logout ``` ## Commands All operations via `scripts/docs.py`. Auto-authenticates on first use if not logged in. ```bash # Create a new document python scripts/docs.py create "Meeting Notes" # Create a document with initial content python scripts/docs.py create "Project Plan" --content "# Overview\n\nThis is the project plan." # Find documents by title python scripts/docs.py find "meeting" --limit 10 # Get text content of a document python scripts/docs.py get-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms # Get text using a full URL python scripts/docs.py get-text "https://docs.google.com/document/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit" # Append text to end of document python scripts/docs.py append-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms "New paragraph at the end." # Insert text at beginning of document python scripts/docs.py insert-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms "Text at the beginning.\n\n" # Replace text in document python scripts/docs.py replace-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms "old text" "new text" ``` ## Document ID Format Google Docs uses document IDs like `1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms`. You can: - Use the full URL (the ID will be extracted automatically) - Use just the document ID - Get document IDs from the `find` command results ## Token Management Tokens stored securely using the system keyring: - **macOS**: Keychain - **Windows**: Windows Credential Locker - **Linux**: Secret Service API (GNOME Keyring, KDE Wallet, etc.) Service name: `google-docs-skill-oauth` Access tokens are automatically refreshed when expired using Google's cloud function.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.