🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Google Docs Skill

by @zagran

Integrate with Google Docs API to create, read, update, format, and manage documents using OAuth 2.0 authentication.

Versionv0.1.0
Installs4
πŸ’‘ Examples

import urllib.request
import json
import os

Get access token first (using function from above)

access_token = get_access_token()

Get document

req = urllib.request.Request('https://docs.googleapis.com/v1/documents/{documentId}') req.add_header('Authorization', f'Bearer {access_token}') doc = json.load(urllib.request.urlopen(req)) print(json.dumps(doc, indent=2))

βš™οΈ Configuration

1. Google Cloud Project Setup - Go to Google Cloud Console - Create a new project or select existing one - Enable the Google Docs API - Create OAuth 2.0 credentials (Desktop app or Web application) - Download the credentials JSON file

2. Environment Setup

   export GOOGLE_CLIENT_ID="your-client-id"
   export GOOGLE_CLIENT_SECRET="your-client-secret"
   export GOOGLE_REFRESH_TOKEN="your-refresh-token"
   

πŸ“‹ Tips & Best Practices

1. Token Management - Cache access tokens (valid for 1 hour) - Store refresh token securely - Implement automatic token refresh

2. Batch Operations - Combine multiple updates into single batch call - Reduces API calls and improves performance

3. Index Calculation - Always get current document state before updates - Account for newline characters (\n) - Use endOfSegmentLocation for appending

4. Rate Limits - Google Docs API has quotas (check Cloud Console) - Implement exponential backoff for rate limit errors

View on ClawHub
TERMINAL
clawhub install google-docs-skill

πŸ§ͺ Use this skill with your agent

Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

πŸ” Can't find the right skill?

Search 60,000+ AI agent skills β€” free, no login needed.

Search Skills β†’