Install
openclaw skills install gog-restrictedGoogle Workspace CLI for Gmail, Calendar, and Auth (restricted via security wrapper).
openclaw skills install gog-restrictedGoogle Workspace CLI. Runs through a security wrapper — only whitelisted commands are allowed, everything else is hard-blocked.
--account unless overriding--json for parseable output--no-input to avoid interactive promptsRun script/setup.sh to install the security wrapper. This moves the real gog binary to .gog-real and replaces it with a wrapper that enforces the allowlist below. The script is idempotent — safe to run more than once.
gog --version — print version and exitgog --help — show top-level helpgog auth status — show auth configuration and keyring backendgog auth list — list stored accountsgog auth services — list supported auth services and scopesgog gmail search '<query>' --max N --json — search threads using Gmail query syntaxgog gmail read <messageId> — read a message (alias for gmail thread)gog gmail get <messageId> --json — get a message (full|metadata|raw)gog gmail thread <threadId> --json — get a thread with all messagesgog gmail thread attachments <threadId> — list all attachments in a threadgog gmail messages search '<query>' --max N --json — search messages using Gmail query syntaxgog gmail attachment <messageId> <attachmentId> — download a single attachmentgog gmail url <threadId> — print Gmail web URL for a threadgog gmail history — Gmail change historyOrganize operations use label modification. For example, to trash a message, add the TRASH label via thread modify; to archive, remove the INBOX label; to mark as read, remove the UNREAD label.
gog gmail thread modify <threadId> --add <label> --remove <label> — modify labels on a threadgog gmail batch modify <messageId> ... --add <label> --remove <label> — modify labels on multiple messagesgog gmail labels list --json — list all labelsgog gmail labels get <labelIdOrName> — get label details (including counts)gog gmail labels create <name> — create a new labelgog gmail labels add <messageId> --label <name> — add label to a messagegog gmail labels remove <messageId> --label <name> — remove label from a messagegog gmail labels modify <threadId> ... --add <label> --remove <label> — modify labels on threadsgog calendar list --json — list events (alias for calendar events)gog calendar events [<calendarId>] --json — list events from a calendar or all calendarsgog calendar get <eventId> --json — get an event (alias for calendar event)gog calendar event <calendarId> <eventId> — get a single eventgog calendar calendars --json — list available calendarsgog calendar search '<query>' --json — search events by querygog calendar freebusy <calendarIds> --json — get free/busy infogog calendar conflicts --json — find scheduling conflictsgog calendar colors — show calendar color palettegog calendar time — show server timegog calendar acl <calendarId> --json — list calendar access controlgog calendar users --json — list workspace usersgog calendar team <group-email> --json — show events for all members of a Google Groupgog calendar create <calendarId> --summary '...' --from '...' --to '...' --json — create an eventThe following flags are blocked by the wrapper to prevent egress (Google sends invitation emails to attendees):
--attendees — sends invitation emails to listed addresses--send-updates — controls notification sending--with-meet — creates a Google Meet link--guests-can-invite — lets attendees propagate the invite--guests-can-modify — lets attendees modify the event--guests-can-see-others — exposes attendee listSafe flags: --summary, --from, --to, --description, --location, --all-day, --rrule, --reminder, --event-color, --visibility, --transparency.
gog auth --help — show auth subcommandsgog gmail --help — show gmail subcommandsgog gmail messages --help — show messages subcommandsgog gmail labels --help — show labels subcommandsgog gmail thread --help — show thread subcommandsgog gmail batch --help — show batch subcommandsgog calendar --help — show calendar subcommandsgog gmail send — sending emailgog gmail reply — replying to emailgog gmail forward — forwarding emailgog gmail drafts — creating/editing draftsgog gmail track — email open tracking (inserts tracking pixels)gog gmail vacation — vacation auto-reply sends automatic responsesgog gmail filters — creating mail filters (could set up auto-forwarding)gog gmail delegation — delegating account accessgog gmail settings — changing Gmail settings (filters, forwarding, delegation)gog gmail batch delete — permanently delete multiple messagesgog calendar update — update an eventgog calendar delete — delete an eventgog calendar respond — RSVP sends response to organizergog calendar propose-time — propose new meeting timegog calendar focus-time — create focus time blockgog calendar out-of-office — create OOO eventgog calendar working-location — set working locationgog drive — Google Drivegog docs — Google Docsgog sheets — Google Sheetsgog slides — Google Slidesgog contacts — Google Contactsgog people — Google Peoplegog chat — Google Chatgog groups — Google Groupsgog classroom — Google Classroomgog tasks — Google Tasksgog keep — Google Keepgog config — CLI configurationpending-review label instead.--max N on search and list commands to limit results. Start small (--max 10) and paginate if needed.from:alice after:2025/01/01) rather than broad searches.--from and --to to bound the date range. Prefer --today or --days N over open-ended listing.gmail get <messageId> when you need a single message over gmail thread <threadId> which fetches all messages in the thread.--json for structured output — it's faster to parse and less error-prone than text output.Commands that return lists (gmail search, gmail messages search, calendar events) support pagination via --max and --page:
gog gmail search 'label:inbox' --max 10 --jsonnextPageToken field.gog gmail search 'label:inbox' --max 10 --page '<nextPageToken>' --jsonnextPageToken is absent (no more results).Keep --max small (10–25) to avoid large responses and reduce API quota usage. Stop paginating once you have enough results — do not fetch all pages by default.