productivity
Google Docs CLI for Headless Automation
Use the Google Docs CLI for headless automation with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 5 read 2 write Manual OAuth token auth
Google Docs CLI for Headless Automation
Use KosmoKrator as a non-interactive integration runtime for local automations and wrappers.
Use headless automation when another tool needs a stable local command surface. The Google Docs CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Google Docs CLI for Headless Automation
kosmokrator integrations:configure google-docs --set access_token="$GOOGLE_DOCS_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call google-docs.gdocs_list_documents '{"pageSize":1,"pageToken":"example_pageToken","q":"example_q"}' --json Discovery Before Execution
Agents and scripts can inspect Google Docs docs and schemas before choosing a function.
kosmo integrations:docs google-docs --json
kosmo integrations:docs google-docs.gdocs_list_documents --json
kosmo integrations:schema google-docs.gdocs_list_documents --json
kosmo integrations:search "Google Docs" --json
kosmo integrations:list --json Useful Google Docs CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
google-docs.gdocs_list_documents | Read | pageSize, pageToken, q | List Google Docs documents visible to the authenticated user. Returns document IDs, names, owners, and modification times. Supports pagination and custom Drive API query filters. |
google-docs.gdocs_get_document | Read | documentId | Get the full content and structure of a Google Docs document by its ID. Returns the document title, body content (paragraphs, text runs), and styling information. |
google-docs.gdocs_create_document | Write | title | Create a new Google Docs document with a given title. Returns the document ID and a link to edit the document in the browser. |
google-docs.gdocs_batch_update | Write | documentId, requests | Send batch update requests to a Google Docs document. Supports inserting text, updating text styles, creating paragraphs, and other document modifications. Each request in the array is a Google Docs API request object. |
google-docs.gdocs_list_permissions | Read | fileId, pageSize | List all permissions (sharing settings) for a Google Docs document. Returns who has access, their roles (owner, writer, reader), and their email addresses. |
google-docs.gdocs_get_permission | Read | fileId, permissionId | Get details of a specific permission for a Google Docs document. Returns the permission type, role, and email address for a single permission entry. |
google-docs.gdocs_get_current_user | Read | none | Get the authenticated Google user's profile information. Returns user ID, email address, display name, and profile picture URL. Use this to verify which Google account is being used. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.