Skill

Automate Google Docs Operations

Lightweight Google Docs automation skill with standalone OAuth for Google Workspace accounts. Create, search, read, and edit documents via Python scripts

Works with google docs

46
Spark score
out of 100
Updated 3 days ago
Version 13.1.0

Add to Favorites

Why it matters

Integrate Google Docs into your local automation scripts for seamless document creation, searching, reading, and editing. This skill enables direct manipulation of Workspace documents without requiring an MCP server.

Outcomes

What it gets done

01

Create new Google Docs with or without initial content.

02

Search for documents by title and extract their content.

03

Append, insert, or replace text within existing Google Docs.

04

Authenticate and manage tokens securely using system keyrings.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-google-docs-automation | bash

Capabilities

What this skill does

Create new Google

Create new Google Docs with or without initial content.

Search for documents

Search for documents by title and extract their content.

Append, insert, or

Append, insert, or replace text within existing Google Docs.

Authenticate and manage

Authenticate and manage tokens securely using system keyrings.

Overview

Google Docs

What it does

This skill provides lightweight Google Docs integration through Python scripts with standalone OAuth authentication. It supports creating new documents (with or without initial content), searching documents by title, extracting text content, appending text to the end, inserting text at the beginning, and replacing text within documents. All operations work with document IDs or full URLs, and tokens are stored securely in your system keyring with automatic refresh.

How it connects

Use this skill when you need to create, search, read, or edit Google Docs from local automation scripts without an MCP server. It fits tasks involving document text extraction, append/insert operations, or content replacement in Google Workspace documents. Requires a Google Workspace account; personal Gmail accounts are not supported.

Source README

Google Docs

Lightweight Google Docs integration with standalone OAuth authentication. No MCP server required.

⚠️ Requires Google Workspace account. Personal Gmail accounts are not supported.

When to Use

  • You need to create, search, read, or edit Google Docs from local automation scripts.
  • The task involves document text extraction, append/insert operations, or content replacement in Workspace docs.
  • You want direct Docs automation without relying on an MCP server.

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 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.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.