gws-docs

Read and write Google Docs through the gws command-line interface.

Updated Nov 9, 2023
One-click install
npx skills add https://github.com/oresttokovenko/dot-files --skill gws-docs-oresttokovenko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gws-docs
Source: https://github.com/oresttokovenko/dot-files/tree/main/chezmoi/dot_agents/skills/gws-docs
Command: npx skills add https://github.com/oresttokovenko/dot-files --skill gws-docs-oresttokovenko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with Google Docs programmatically requires navigating the Docs API's resources, methods, and parameters, which is tedious to do by hand. This Skill exposes the Docs API through the gws CLI so an AI agent can create, read, and update documents directly. ## Core Features & Use Cases - Document Retrieval: Fetch the latest version of any Google Doc using the documents.get method. - Document Creation: Create blank documents with a given title via documents.create. - Batch Updates: Apply multiple validated edits atomically with documents.batchUpdate, plus a helper command to append text to a document. - Use Case: Ask the agent to pull the contents of a meeting-notes doc, append a new section of action items, and verify the update, all through gws docs commands. ## Quick Start Use the gws docs skill to read the contents of my Google Doc and append a summary paragraph at the end.

Frequently Asked Questions about gws-docs

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

FAQPage Schema
How do I read a Google Doc from the command line?

Use gws docs documents get with the document ID to fetch the latest version of a Google Doc. Run gws schema docs.documents.get first to see the required parameters and flags.

How do I append text to a Google Doc programmatically?

Use the gws-docs-write helper command, which appends text to a document. Alternatively, call documents.batchUpdate with insertText requests to apply validated edits atomically.

What is required before using gws docs commands?

The gws binary must be installed, and the gws-shared skill must be present for authentication, global flags, and security rules. If it is missing, run gws generate-skills to create it.

Does batchUpdate apply partial changes if one request fails?

No. Each request in a batchUpdate call is validated before being applied, and if any request is invalid the entire call fails and nothing is applied, keeping the document consistent.

How do I find the right parameters for a Docs API method?

Run gws docs --help to browse resources and methods, then gws schema docs.<resource>.<method> to inspect required parameters, types, and defaults before building your --params and --json flags.