read_when:
- Working with Gmail content, filters, watches, labels, or agent-safe reads.
- Reviewing Gmail commands that cross from read-only into send or modify flows.
Gmail is one of gog's broadest surfaces. Use command-specific pages for exact flags, and use this page to choose the right workflow shape.
gog gmail search 'newer_than:7d' --max 10 --json
gog gmail get <messageId> --json
gog gmail thread get <threadId> --jsonFor agents, logs, or issue reports, prefer sanitized content:
gog gmail get <messageId> --sanitize-content --json
gog gmail thread get <threadId> --sanitize-content --json--sanitize-content strips unsafe/raw payload details while keeping useful
message text for automation.
Export filters as Gmail WebUI-compatible XML:
gog gmail settings filters export --out filters.xmlKeep API JSON when a script needs the Gmail API shape:
gog gmail settings filters export --format json --jsonCommand pages:
gog gmail settings filters exportgog gmail settings filters listgog gmail settings filters creategog gmail settings filters delete
Block send operations globally for one run:
gog --gmail-no-send gmail send --to [email protected] --subject test --text bodyOr use the environment variable in agent shells:
export GOG_GMAIL_NO_SEND=1For account-specific send blocking, use the no-send config commands:
Gmail watch/PubSub workflows are documented in Gmail watch.
Key command pages:
Open tracking is documented in Email Tracking and Email Tracking Worker.
Use gog gmail raw when you need the underlying
Gmail API Message object. See Raw API Dumps for safety notes.