google-docs

Create, read, edit, and export Google Docs via the Google Docs API.

Updated Jan 22, 2026
One-click install
npx skills add https://github.com/FahadImdad/Nexus-Fahad --skill google-docs-fahadimdad
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: google-docs
Source: https://github.com/FahadImdad/Nexus-Fahad/tree/main/00-system/skills/google/google-docs
Command: npx skills add https://github.com/FahadImdad/Nexus-Fahad --skill google-docs-fahadimdad

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires google-auth, google-auth-oauthlib, google-api-python-client, and includes scripts (resource) components.

What problem does it solve? Working with Google Docs programmatically requires handling OAuth authentication, document IDs, and the batchUpdate API, which is tedious to set up manually. This Skill provides ready-to-use commands for reading, writing, formatting, and exporting Google Docs without writing API boilerplate. ## Core Features & Use Cases - Full Document CRUD: Create, read, copy, rename, clear, and list Google Docs through simple CLI commands or Python functions. - Content Editing: Insert or append text, find and replace strings, add headings, bullet lists, tables, and apply text formatting like bold, fonts, and colors. - Export & Templates: Export documents to text, HTML, PDF, or DOCX, and generate new documents from template copies with placeholder replacement. - Use Case: Generate a weekly report in Python, create a new Google Doc, append the findings, and share the document URL with your team automatically. ## Quick Start Ask the AI to create a new Google Doc titled "Weekly Report" and append your summary text to it.

Frequently Asked Questions about google-docs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Google Doc from Python?

Use the create command with a title and optional initial content, which calls the Google Docs API documents().create method. The script returns the new document ID and URL, and you can then append or insert text into it.

How do I find and replace text in a Google Doc programmatically?

Run the replace command with the document ID, the text to find, and the replacement text. It uses the replaceAllText batchUpdate request and reports how many occurrences were changed, with an option for case-insensitive matching.

What authentication is required for the Google Docs API?

You need OAuth credentials from Google Cloud Console with the Docs API and Drive API enabled, stored as GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, and GOOGLE_PROJECT_ID in a .env file. Run the google_auth.py login script once to authorize.

Can I export a Google Doc to PDF or DOCX?

Yes, the export command supports text, HTML, PDF, and DOCX formats through the Drive API files().export method. Provide an output path to save the file locally, with binary formats written in binary mode.

Why does the Google Docs script fail with an authentication error?

Failures usually mean missing dependencies, absent OAuth credentials, or an expired login token. Run the pre-flight check with google_auth.py --check --service docs; exit code 1 means re-login is needed, and exit code 2 means credentials or packages are missing.