Problem
The Google Drive REST API comments.create does not anchor comments to specific text in the Docs UI, even though the anchor data is saved. This is a known Google bug: issuetracker.google.com/issues/491884714.
The comment is created but appears as "orphaned" (not attached to any text), which makes it useless for document review workflows.
Attempted Workarounds
1. CDP / Playwright browser automation
- WSL2→Windows CDP connection is unreliable: Chrome responds intermittently even on localhost
- Requires maintaining: Chrome debug flags, Windows firewall rules, netsh portproxy, Python websocket clients
- Not viable for a CLI tool
2. Console JS script
- Current fallback: paste a script into Chrome DevTools console
- Uses
copy() to manage clipboard, user presses ArrowDown to advance
- Semi-manual: user still needs Ctrl+F, Ctrl+Alt+M, Enter, etc.
- Works but not a proper CLI solution
Desired Feature
A gog docs add-comment (or similar) command that:
- Takes document ID, anchor text (to search), and comment text
- Programmatically opens a browser tab to the document
- Finds the anchor text, opens the comment UI, pastes the comment, and submits
- Works reliably from WSL2, macOS, and native Linux
Potential approaches
- Use the built-in OpenClaw browser tooling if available
- Bundle a lightweight CDP client that works reliably
- Explore if the Docs API has any newer endpoint that properly anchors comments (unlikely given Google bug status)
Context
Problem
The Google Drive REST API
comments.createdoes not anchor comments to specific text in the Docs UI, even though the anchor data is saved. This is a known Google bug: issuetracker.google.com/issues/491884714.The comment is created but appears as "orphaned" (not attached to any text), which makes it useless for document review workflows.
Attempted Workarounds
1. CDP / Playwright browser automation
2. Console JS script
copy()to manage clipboard, user presses ArrowDown to advanceDesired Feature
A
gog docs add-comment(or similar) command that:Potential approaches
Context
gog forms add-question#570 (Forms quiz), Feature: Add Google Maps support (directions, places, distance matrix) #571 (Maps geocoding) — feature requests for Google Workspace tooling