anentrypoint/docmcp
Overview
This skill provides a CLI interface to create, read, edit, format, and manage Google Docs, Sheets, Drive files, and Apps Script projects. It exposes a single executable that accepts JSON arguments and returns JSON output. Use it for scripted or repeatable document and spreadsheet automation, Drive searches, and Apps Script project management.
How this skill works
You run the gdoc CLI with a command and a single JSON argument. The tool reads OAuth tokens from a local token file and calls Google Docs, Sheets, Drive, or Apps Script APIs to perform the requested operation. All results and errors are returned as JSON so you can parse them in scripts or pipelines.
When to use it
- Create, append, or update Google Docs programmatically (text, tables, images).
- Read, write, format, or batch-edit Google Sheets ranges and cells.
- Search Google Drive for documents or spreadsheets by query or type.
- Create, edit, sync, and run Apps Script projects attached to a spreadsheet.
- Automate repetitive editing, formatting, or content replacement tasks.
Best practices
- Always authenticate first if tokens are missing by running the auth command and following the printed URL.
- Pass a single JSON argument string and use the exact invocation pattern shown in examples.
- Use batch operations (docs.batch or sheets.batch) for multiple edits to minimize API calls and preserve ordering.
- Test destructive actions (delete, section delete, scripts.delete) on copies or small samples first.
- Include specific ranges, sheet names, or doc IDs to avoid unintended broad changes.
Example use cases
- Generate meeting notes by creating a new Doc, inserting templated text, and formatting headings.
- Import CSV data into a spreadsheet, set column widths, freeze headers, and apply number formatting.
- Search Drive for all spreadsheets with a project name, open each, and append a summary row.
- Replace a phrase across a large doc or sheet using docs.edit or sheets.find_replace with replace_all enabled.
- Create or update an Apps Script file, sync the project, and run a deployment function from CLI.
FAQ
Run the auth command. The CLI prints an auth URL; visit it, authorize, and tokens are saved to the local config path.
How do I pass multiple edits in one request?
Use docs.batch or sheets.batch with an operations array to perform inserts, deletes, formats, or setValue operations in one call.