Google Docs Writer
Extends gog with write operations for Google Docs. Uses the same OAuth credentials gog stores in the GNOME keyring.
Prerequisites
gog auth addcompleted (OAuth token in keyring)secretstoragePython package (pre-installed on most Linux desktops)- Doc must be owned by or shared as Editor with the authenticated account
Commands
Script: scripts/gdocs.py
# Read doc content as plain text
python3 scripts/gdocs.py read <docId>
# Replace entire doc with content from file
python3 scripts/gdocs.py write <docId> <textFile>
# Append content from file to end of doc
python3 scripts/gdocs.py append <docId> <textFile>
# Clear all doc content
python3 scripts/gdocs.py clear <docId>
# Find and replace text
python3 scripts/gdocs.py replace <docId> "find this" "replace with"
Formatting
The write command auto-converts markdown headers to Google Docs headings:
# Heading→ Heading 1## Heading→ Heading 2### Heading→ Heading 3
Header markers (#) are stripped from the final doc.
Workflow
- Write content to a temp file (markdown-formatted for best results)
- Use
write(replace all) orappend(add to end) - Use
readto verify
For creating new docs, use gog docs create <title> first, then write content with this skill.
Token Caching
Access tokens are cached at /tmp/.gdocs_access_token for ~50 minutes. No manual token management needed.
Error: 403 Permission Denied
The authenticated account (gabagent00@gmail.com) needs Editor access to the doc. Shared docs default to Viewer — the doc owner must grant edit permission.
