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.
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.mdCommand pages:
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 120Promote an existing paragraph to a heading or title style with
--heading-level N (1..6 shortcut) or --named-style NAME (full enum:
NORMAL_TEXT, TITLE, SUBTITLE, HEADING_1..HEADING_6,
case-insensitive). Both set paragraphStyle.namedStyleType on the same
update so they compose with --alignment and --line-spacing:
gog docs format <docId> --match "Status" --heading-level 2
gog docs format <docId> --match "Overview" --named-style title --alignment centerUse --match-all when every occurrence should be formatted.
Command page:
Markdown has no native page-break construct, so multi-page deliverables need a direct Docs API call. Insert a page break at a specific index or append one at end-of-doc:
gog docs insert-page-break <docId> --at-end
gog docs insert-page-break <docId> --index 250 --tab "Notes"--index and --at-end are mutually exclusive; omit both to default to
end-of-doc. Aliases: page-break, pb.
Command page:
Insert a native Google Docs table directly via the Docs API, bypassing the Markdown writer:
gog docs insert-table <docId> --rows 3 --cols 2 --at-end
gog docs insert-table <docId> --rows 2 --cols 2 --index 1 \
--values-json '[["A","B"],["C","D"]]'--values-json takes a JSON 2D string array whose dimensions must match
--rowsx--cols; omit it to insert an empty table structure. Use --at-end
to append at the end of the document (or the selected --tab), or --index N
to insert at a specific document index. Prefer this primitive when you want a
guaranteed native table rather than relying on the Markdown writer's table
rendering (see gog docs write --markdown).
Command page:
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> --forceTab-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-runRe-render an entire tab from a markdown source-of-truth file with
--replace --markdown --tab:
gog docs write <docId> --replace --markdown --tab "Gold list" --file gold.mdDrive's markdown converter is whole-document-only, so this path wipes the
targeted tab's content via DeleteContentRange and re-renders the markdown
locally through the Docs API. Other tabs are untouched.
Command pages:
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 fully offline and reports the intended replacement without
opening the document. Empty replacement strings are allowed and delete matches.
Command page:
Use raw output when a script needs the Google Docs API object:
gog docs raw <docId> --prettySee Raw API Dumps for lossless-output safety notes.