Docs, Sheets, Slides

Google Docs Editing

Google Docs Editing

read_when:

  • Editing Google Docs content, tabs, formatting, comments, or raw Docs output.
  • Reviewing Docs write, format, find-replace, or tab commands.

Docs commands cover document creation, export, content writes, find/replace, comments, tabs, formatting, and raw API inspection.

#Write Markdown

Append Markdown and convert it to Google Docs formatting:

gog docs write <docId> --append --markdown --text '## Status'

Replace the document body with Markdown from a file:

gog docs write <docId> --replace --markdown --content-file README.md

Command pages:

#Format Text

Apply text or paragraph formatting:

gog docs format <docId> --match Status --bold --font-size 18
gog docs format <docId> --match "Action item" --text-color '#b00020'
gog docs format <docId> --match Heading --alignment center --line-spacing 120

Use --match-all when every occurrence should be formatted.

Command page:

#Tabs

Manage Google Docs tabs:

gog docs list-tabs <docId>
gog docs add-tab <docId> --title "Notes"
gog docs rename-tab <docId> <tabId> "Archive"
gog docs delete-tab <docId> <tabId> --force

Tab-aware commands accept --tab by title or ID:

gog docs write <docId> --append --tab "Notes" --text "Follow-up"
gog docs find-replace <docId> old new --tab "Notes" --dry-run

Command pages:

#Find and Replace

gog docs find-replace <docId> old new --dry-run
gog docs find-replace <docId> old '' --first
gog docs find-replace <docId> PLACEHOLDER --content-file replacement.md --format markdown

--dry-run is read-only and reports match counts. Empty replacement strings are allowed and delete matches.

Command page:

#Raw Docs Output

Use raw output when a script needs the Google Docs API object:

gog docs raw <docId> --pretty

See Raw API Dumps for lossless-output safety notes.