google-docs
Skill0 starsChanged 2 months agoMITView on GitHub
Google Docs API integration with managed OAuth via Maton. Create, read, search, edit, and format Google Docs online cloud documents. Use this skill ONLY for online Google Docs cloud documents (Google Workspace docs.google.com or Document IDs). Do NOT use this skill for local office files (.docx or .doc files on the local file system); use the docx skill for local Word files. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
- Pipes a download into a shell
- Reads credentials
- Installs packages
- Sends data out
16 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- JonnyCBB/claude-code-configtheir own version, first seen Nov 8, 2026
- flopperj/dotfiles-coretheir own version, first seen Nov 4, 2026
- chnlich/charlie-bottheir own version, first seen Nov 1, 2026
- weininghui/skillsedited, first seen Oct 30, 2026
- 0mlkrizzz655335v/claude-skills-zhtheir own version, first seen Oct 15, 2026
- openai/pluginstheir own version, first seen Oct 13, 2026
Used with
Projects with it also use google-chat, gmail and 3 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
antoniolgSkillgoogle-chat
Read Google Chat spaces/threads via the Chat API, create/refresh OAuth tokens, parse Gmail Chat URLs, and list spaces. Use when asked to look up or verify messages in Google Chat or when you need API access to Chat from the CLI.
Also in 3 projects that use this
refly-aiSkillgmail
Integrate with Gmail for email management and automation. Use when you need to: (1) send and compose emails with attachments, (2) read and search emails by criteria, (3) manage drafts and email labels, or (4) reply to email threads and conversations.
Also in 5 projects that use this
OpenAISkilllinear
Manage issues, projects & team workflows in Linear. Use when the user wants to read, create or updates tickets in Linear.
Also in 4 projects that use this
AnthropicSkillslack
Also in 3 projects that use this
ElasticSkillcreate-skill
Interactively create a new Claude Code skill and add it to the elastic-docs-skills catalog. Use when the user wants to generate a new skill, scaffold a slash command, or build automation for docs tasks.
Also in 3 projects that use this
Other versions16 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- weininghui/skills★ 137% same
Wrote their own version · 15
- openai/plugins★ 7.8ksame name
- Lilac-Labs/gini-agent★ 1.9ksame name
- Open-Curiosity/gini-agent★ 1.9ksame name
- gemini-cli-extensions/workspace★ 646same name
- sanjay3290/ai-skills★ 452same name
- refly-ai/refly-skills★ 204same name
- AceDataCloud/Skills★ 17same name
- danielkwapien/google-docs-skill★ 10same name
- pbc-os/smb-starter-kit★ 10same name
- chnlich/charlie-bot★ 9same name
5 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
- google-calendarSkill
- google-sheetsSkill
- google-slidesSkill
- google-tasksSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 99
After installation, verify with:
- Distinctive: line 223
If you have multiple Google Docs connections, specify which one to use:
- Distinctive: line 247
If you have multiple connections, always specify the connection to ensure requests go to the intended account.
- Distinctive: line 281
Create a new empty Google Doc with a specified title.
- Very specific: line 348
deleteContentRange: Delete content within a specified range (startIndex and endIndex). - Very specific: line 464
Document IDs are opaque strings (extracted from the URL https://docs.google.com/document/d/<documentId>/edit).
- Very specific: line 504
Ensure your URL path starts with google-docs.
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Google Docs (Cloud Document Skill)
Access the Google Docs API with managed OAuth authentication via Maton. Create, read, update, format, and batch-edit Google Docs cloud documents.
⚠️ Cloud vs. Local File Scope Distinction:
google-docs(This Skill): Exclusively for online Google Docs cloud documents (docs.google.com/document/d/{documentId}). Interacts directly with Google's cloud servers via Maton OAuth API proxy.docxSkill: For reading, creating, or editing local.docx/.docfiles stored on the local disk.
Quick Start
CLI:
# Get Document structure & text content
maton google-docs document get <documentId># Create a new Google Doc
maton google-docs document create --title 'Project Architecture Spec'# Append text to a document body
maton google-docs document write <documentId> --text 'Meeting notes: discussion on Q3 roadmap.'Python:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/google-docs/v1/documents/<documentId>')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOFBase URL
https://api.maton.ai/google-docs/{native-api-path}Maton proxies requests to docs.googleapis.com and automatically injects your OAuth token.
CLI Installation (optional — agent decides)
Maton CLI is optional. Agent can decide whether to install it based on the environment.
macOS / Linux
curl -fsSL https://maton.ai/install.sh | bashWindows
irm https://maton.ai/install.ps1 | iexnpm (cross-platform)
npm install -g @maton/cliHomebrew (macOS)
brew install maton-ai/cli/matonAfter installation, verify with:
maton --versionAuthentication
CLI:
maton login # Opens browser for API key
maton login --interactive # Skip browser, paste API key directly
maton whoami # Show current auth stateManual:
- Sign in or create an account at maton.ai
- Go to maton.ai/settings
- Copy your API key
- Set your API key as
MATON_API_KEY:
export MATON_API_KEY="YOUR_API_KEY"Connection Management
Manage your Google Docs OAuth connections at https://api.maton.ai.
List Connections
CLI:
maton connection list google-docs --status ACTIVEmaton api -X GET /connections -f app=google-docs -f status=ACTIVEPython:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections?app=google-docs&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOFCreate Connection
CLI:
maton connection create google-docsmaton api /connections -f app=google-docsPython:
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'google-docs'}).encode()
req = urllib.request.Request('https://api.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOFResponse:
{
"connection": {
"connection_id": "{connection_id}",
"status": "ACTIVE",
"url": "https://connect.maton.ai/?session_token=...",
"app": "google-docs"
}
}Open the returned url in a browser to complete OAuth authorization.
Get Connection
CLI:
maton connection get {connection_id} # alias: maton connection viewmaton api /connections/{connection_id}Delete Connection
CLI:
maton connection delete {connection_id} --yesmaton api -X DELETE /connections/{connection_id}Specifying Connection
If you have multiple Google Docs connections, specify which one to use:
CLI:
maton google-docs document get <documentId> --connection {connection_id}maton api /google-docs/v1/documents/<documentId> --connection {connection_id}Python:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/google-docs/v1/documents/<documentId>')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Maton-Connection', '{connection_id}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOFIf you have multiple connections, always specify the connection to ensure requests go to the intended account.
Security & Permissions
- Access is scoped to Google Docs within the connected Google account.
- All write and delete operations require explicit user approval. Confirm target resource ID and content modifications with the user before executing.
API Reference
1. Get Document
Retrieve the full document object including title, structural elements, inline objects, and paragraph styling.
GET /google-docs/v1/documents/{documentId}Query Parameters:
suggestionsViewMode-DEFAULT_FOR_CURRENT_ACCESS,PREVIEW_APPROVED,PREVIEW_WITHOUT_SUGGESTIONS,SUGGESTIONS_INLINE.
Example CLI:
maton google-docs document get <documentId>
maton google-docs document get <documentId> --json2. Create Blank Document
Create a new empty Google Doc with a specified title.
POST /google-docs/v1/documents
Content-Type: application/json
{
"title": "Quarterly Technical Review"
}Example CLI:
maton google-docs document create --title 'Quarterly Technical Review'3. Append Plain Text to Document
Append plain text to the end of a document body via CLI.
Example CLI:
# Direct text
maton google-docs document write <documentId> --text 'Hello, world!'
# Read from a file
maton google-docs document write <documentId> -F notes.md
# Pipe from stdin
echo 'Piped summary' | maton google-docs document write <documentId> -F -4. Batch Update Document Content & Structure (Rich Formatting)
Perform atomic mutations on document text, formatting, paragraph styles, headers/footers, and inline tables.
POST /google-docs/v1/documents/{documentId}:batchUpdate
Content-Type: application/json
{
"requests": [
{
"insertText": {
"location": {
"index": 1
},
"text": "Executive Summary\n\nThis document outlines our cloud migration strategy."
}
}
]
}Example CLI:
maton api -X POST /google-docs/v1/documents/<documentId>:batchUpdate \
-d '{"requests":[{"insertText":{"location":{"index":1},"text":"Hello World\n"}}]}'Common Request Types for batchUpdate:
insertText: Insert text at a specific index location.deleteContentRange: Delete content within a specifiedrange(startIndexandendIndex).replaceAllText: Global search and replace text across document body.{ "replaceAllText": { "containsText": { "text": "{{PROJECT_NAME}}", "matchCase": true }, "replaceText": "SoloQueue v2.0" } }updateTextStyle: Apply bold, italic, font size, or color formatting to range.updateParagraphStyle: Apply heading styles (HEADING_1,HEADING_2,NORMAL_TEXT).
Extracting Plain Text from Document Structure
Google Docs API returns content inside body.content as structural elements. To read the plain text of a doc via Python:
import os, json, urllib.request
req = urllib.request.Request('https://api.maton.ai/google-docs/v1/documents/<documentId>')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
doc = json.load(urllib.request.urlopen(req))
text_chunks = []
for element in doc.get('body', {}).get('content', []):
if 'paragraph' in element:
for elem in element['paragraph'].get('elements', []):
if 'textRun' in elem:
text_chunks.append(elem['textRun'].get('content', ''))
print("".join(text_chunks))Code Examples
CLI
# Create a document
maton google-docs document create --title 'Sprint Planning'
# Write initial notes to the document
maton google-docs document write <documentId> --text 'Sprint 42 Goals:\n- Launch Auth\n- Speed tests'
# Inspect document structure in JSON
maton google-docs document get <documentId> --jsonJavaScript
// Get document metadata and content
const response = await fetch(
'https://api.maton.ai/google-docs/v1/documents/<documentId>',
{
headers: {
'Authorization': `Bearer ${process.env.MATON_API_KEY}`
}
}
);
const doc = await response.json();
console.log(doc.title);
// Create a new document
const createResponse = await fetch(
'https://api.maton.ai/google-docs/v1/documents',
{
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.MATON_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'RFC: AI Skill Gateway'
})
}
);
const newDoc = await createResponse.json();
console.log('Created doc ID:', newDoc.documentId);Python
import os
import requests
# Get document
response = requests.get(
'https://api.maton.ai/google-docs/v1/documents/<documentId>',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'}
)
doc = response.json()
print(doc.get('title'))
# Create document
create_response = requests.post(
'https://api.maton.ai/google-docs/v1/documents',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'},
json={'title': 'RFC: AI Skill Gateway'}
)
print('Created:', create_response.json().get('documentId'))Notes
- Document IDs are opaque strings (extracted from the URL
https://docs.google.com/document/d/<documentId>/edit). maton google-docs document writeappends plain text to the end of the document body. For inserting text at specific indices, replacing text, or applying heading/bold styles, usebatchUpdate.- IMPORTANT: When using curl commands, use
curl -gwhen URLs contain brackets to disable glob parsing. - IMPORTANT: When piping curl output to
jqor other commands, environment variables like$MATON_API_KEYmay not expand correctly in some shell environments. You may get "Invalid API key" errors when piping.
Error Handling
| Status | Meaning |
| 400 | Missing Google Docs connection or malformed request payload |
| 401 | Invalid or missing Maton API key |
| 404 | Google Doc ID not found or access denied |
| 429 | Rate limit exceeded |
| 5xx | Google Docs API backend error |
Troubleshooting: API Key Issues
CLI:
maton whoami
maton connection list google-docsManual:
echo $MATON_API_KEY
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOFTroubleshooting: Invalid App Name
- Ensure your URL path starts with
google-docs. For example:
- Correct:
https://api.maton.ai/google-docs/v1/documents/<documentId> - Incorrect:
https://api.maton.ai/docs/v1/documents/<documentId>
Resources
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

