
Gog Cli
- 685 installs
- 279 repo stars
- Updated April 25, 2026
- intellectronica/agent-skills
gog-cli is an authentication reference skill that configures Google OAuth and least-privilege scopes for gogcli so coding agents can access Gmail, Calendar, Drive, Docs, and related Google user APIs safely.
About
gog-cli documents gogcli installation, credential management, and account authorization for Google Desktop OAuth clients. Commands include brew install gogcli, gog auth credentials set with a client_secret JSON, gog auth add with comma-separated services like gmail,calendar,drive, plus gog auth list --check and gog auth status for verification. The skill stresses enabling only required Google Cloud APIs and checking live service names via gog auth services before prescribing scopes. Developers invoke gog-cli when diagnosing auth failures, picking credential modes, or wiring least-privilege agent access to Google Workspace user data.
- Documents brew install, credentials JSON placement, and gog auth add/list/status flows.
- Requires Google Cloud Desktop app OAuth client JSON with APIs enabled for the task only.
- Lists current user vs workspace service-account service names and scope gotchas (Docs/Slides/Sheets + Drive).
- Explains --services user vs all alias and when to re-run --force-consent for refresh tokens.
- Provides least-privilege examples: gmail readonly, drive readonly, drive file scope.
Gog Cli by the numbers
- 685 all-time installs (skills.sh)
- +18 installs in the week ending Jul 25, 2026 (Skillselion tracking)
- Ranked #359 of 2,742 Automation & Workflows skills by installs in the Skillselion catalog
- Security screen: HIGH risk (skills.sh audit)
- Data as of Jul 25, 2026 (Skillselion catalog sync)
npx skills add https://github.com/intellectronica/agent-skills --skill gog-cliAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 685 |
|---|---|
| repo stars | ★ 279 |
| Security audit | 3 / 3 scanners passed |
| Last updated | April 25, 2026 |
| Repository | intellectronica/agent-skills ↗ |
How do you configure gogcli OAuth for agent Gmail access?
Configure Google OAuth and least-privilege scopes for gogcli so agents can reach Gmail, Calendar, Drive, Docs, and related user APIs safely.
Who is it for?
Developers connecting coding agents to Google Gmail, Calendar, Drive, or Docs via gogcli with minimal OAuth scopes.
Skip if: Service-account-only server backends, non-Google providers, or deployments that forbid Desktop OAuth client flows.
When should I use this skill?
The user needs gogcli auth setup, OAuth scope selection, credential errors, or Google API access for agents.
What you get
Authenticated gogcli account with verified scopes and working Google API access for selected services.
- authenticated gogcli profile
- verified scope list
Files
gogcli (gog)
gog is a fast, script-friendly CLI for Google services. It is JSON-first, supports multiple accounts/OAuth clients, and has explicit guardrails for agent and CI usage.
Authoritative upstream: https://github.com/steipete/gogcli
This skill was refreshed against upstream gog v0.13.0 (2026-04-20). When exact syntax matters, run gog <command> --help or gog schema --json; the command surface moves quickly, rather inconveniently for anyone fond of stale notes.
Operating rules
- Prefer
gog --json ... | jq ...for inspection and scripting. - Use
--plainonly when stable TSV is more convenient than JSON. - Use
--dry-runfor supported mutating operations when preparing a change or when user intent is ambiguous. - Use
--no-inputin automation so commands fail instead of prompting. - Use
--forceonly when the user asked for the destructive/public/send/admin operation or after you have clearly explained the effect. - Do not repair OAuth, consent, keyring, or Workspace delegation problems silently. Show the exact command the user should run.
- Do not export tokens, print secrets, open public shares, add delegates/forwarding, send mail, suspend users, or permanently delete data unless the user explicitly requested that action.
- For agent runs that must not send mail, add
--gmail-no-send, setGOG_GMAIL_NO_SEND=1, or configuregog config no-send set <account>.
Install and auth
brew install gogcli
gog auth credentials set ~/Downloads/client_secret_....json
gog auth add you@example.com --services gmail,calendar,drive
gog auth list --checkNotes:
- Homebrew now uses
brew install gogcli; old tap examples are obsolete. gog auth adddefaults to--services user. Request the services needed for the task.--services allis accepted only as a backwards-compatible alias foruser; do not use it when you need every API.- Use
--readonly,--drive-scope readonly|file|full, and--gmail-scope readonly|fullfor least privilege. - Keep and Admin require Workspace service-account/domain-wide delegation. Google Chat, Groups, directory, and Classroom also have Workspace restrictions.
- For headless/CI, consider
--manual,--remote,--access-token, orGOG_AUTH_MODE=adc.
Read references/authentication.md for full auth patterns.
Global flags
--account, -a <email|alias|auto> # account selection
--client <name> # named OAuth client/token bucket
--access-token <token> # direct short-lived token; also GOG_ACCESS_TOKEN
--json, -j # machine-readable JSON
--plain, -p # stable TSV
--results-only # JSON primary result only
--select <fields> # best-effort JSON projection
--dry-run, -n # preview supported writes
--force, -y # skip confirmations
--no-input # never prompt
--enable-commands <csv> # allowlist top-level or dotted commands
--disable-commands <csv> # denylist top-level or dotted commands
--gmail-no-send # block Gmail send operations
--verbose, -v # debug loggingUseful command aliases:
gog send ... # alias for gog gmail send
gog ls # alias for gog drive ls
gog search "budget" # alias for gog drive search
gog download <fileId> # alias for gog drive download
gog upload ./file.pdf # alias for gog drive upload
gog me # alias for gog people me
gog status # alias for gog auth status
gog open <id-or-url> # best-effort Google web URL, offlineHigh-value workflows
Account selection
gog auth alias set work you@company.com
gog --account work gmail search 'is:unread newer_than:2d'
GOG_ACCOUNT=work gog calendar events primary --today
gog --client work auth credentials set ~/Downloads/work-client.json
gog --client work auth add you@company.com --services gmail,calendarGmail
gog --json gmail search 'is:unread newer_than:7d' | jq -r '.threads[].id'
gog gmail messages search 'from:alice@example.com has:attachment' --include-body
gog gmail messages search 'subject:report newer_than:30d' --full
gog gmail thread get <threadId> --download --out-dir ./attachments
gog gmail labels modify <threadId> --add Project --remove INBOX
gog gmail messages modify <messageId> --add STARRED
gog gmail send --to user@example.com --subject "Hello" --body-file ./body.txt
gog gmail forward <messageId> --to user@example.com --note "FYI"For forwarding, autoreply, watch/Pub/Sub, filters, delegates, send-as, label colours, batch operations, and tracking, read references/gmail.md.
Calendar
gog calendar calendars
gog calendar events primary --today --weekday
gog calendar events --all --from "2026-04-25T00:00:00+02:00" --to "2026-04-26T00:00:00+02:00"
gog calendar freebusy --cal primary --from "2026-04-25T09:00:00+02:00" --to "2026-04-25T17:00:00+02:00"
gog calendar create primary --summary "Planning" --from "2026-04-25T14:00:00+02:00" --to "2026-04-25T14:30:00+02:00" --attendees "alice@example.com,bob@example.com" --with-meet
gog calendar respond primary <eventId> --status accepted --send-updates allUse RFC3339 with timezone offsets for generated datetimes. Read references/calendar.md for aliases, subscriptions, secondary calendars, extended properties, Focus Time, OOO, working locations, team calendars, and conflict detection.
Drive, Docs, Sheets, Slides, Forms, Apps Script
gog drive search "invoice filetype:pdf" --max 20
gog drive upload ./report.md --convert-to doc --parent <folderId>
gog drive upload ./deck.pdf --replace <fileId> --name "Board Deck.pdf"
gog drive share <fileId> --to user --email editor@example.com --role commenter
gog docs write <docId> --file ./brief.md --replace --markdown
gog docs sed <docId> 's/status/{b c=green}approved/g' --dry-run
gog sheets update <spreadsheetId> 'Sheet1!A1' '[["Name","Score"],["Ada",98]]'
gog sheets chart list <spreadsheetId>
gog slides thumbnail <presentationId> <slideId> --out ./slide.png
gog forms responses list <formId> --max 20
gog appscript run <scriptId> myFunction --params '["arg1", 123]'Read references/drive-docs.md for current file/content commands. For Docs sed formatting, read references/sedmat.md.
Other services
gog contacts search "Ada"
gog tasks lists
gog tasks add <tasklistId> --title "Weekly review" --due "2026-04-27" --repeat weekly
gog chat messages send spaces/<spaceId> --text "Build complete"
gog groups members engineering@example.com
gog admin users list --domain example.com
gog keep search "receipt"Read references/other-services.md for Chat, Classroom, Contacts, Tasks, People, Groups, Admin, Keep, and time utilities.
Scripting patterns
# Inspect shape first
gog --json gmail search 'is:unread' --max 3 | jq .
# Use pagination/all-pages where available
gog --json calendar events primary --from today --to tomorrow --all-pages
# Fail cleanly when a supported list command has no results
gog --json calendar events primary --query "unlikely query" --fail-empty
# Batch with xargs after checking output
gog --json gmail search 'older_than:1y label:newsletter' --max 200 | \
jq -r '.threads[].id' | \
xargs -n 50 gog gmail labels modify --remove INBOX
# Agent-safe command surface
GOG_ENABLE_COMMANDS=calendar.events,calendar.freebusy,tasks \
gog --no-input --json calendar events primary --todayReference map
references/command-reference.md- generated command index fromgog schema --jsonreferences/authentication.md- OAuth clients, service accounts, scopes, keyrings, headless authreferences/configuration.md- config keys, environment variables, output modes, safety switchesreferences/gmail.md- Gmail search, read, send, labels, settings, watch, tracking, autoreplyreferences/calendar.md- Calendar listing, event writes, scheduling, special events, aliasesreferences/drive-docs.md- Drive, Docs, Sheets, Slides, Forms, Apps Scriptreferences/sedmat.md- Docs sed/formatting DSLreferences/other-services.md- Chat, Classroom, Contacts, Tasks, People, Groups, Admin, Keep
gogcli Authentication Reference
Use this when configuring accounts, diagnosing auth failures, or selecting the right credential mode.
Install and credentials
brew install gogcli
gog auth credentials set ~/Downloads/client_secret_....json
gog auth credentials list
gog auth add you@example.com --services gmail,calendar,drive
gog auth list --check
gog auth statusOAuth client credentials must be a Google Cloud "Desktop app" client JSON. Enable only the APIs needed for the task.
Services and scopes
Check the live service list before prescribing scopes:
gog auth services
gog auth services --markdownCurrent user-service names include:
gmail, calendar, chat, classroom, drive, docs, slides, contacts,
tasks, sheets, people, forms, appscript, adsWorkspace-only service-account services include:
groups, keep, adminImportant details:
gog auth adddefaults to--services user.--services allis a backwards-compatible alias foruser, not "every Google API".- Docs uses Docs plus Drive scopes; Slides and Sheets also rely on Drive for copy/export flows.
- Re-run with
--force-consentwhen adding services or changing scope shape and Google does not return a new refresh token.
Least-privilege examples:
gog auth add you@example.com --services gmail --gmail-scope readonly
gog auth add you@example.com --services drive --drive-scope readonly
gog auth add you@example.com --services drive --drive-scope file
gog auth add you@example.com --services gmail,drive --readonly
gog auth add you@example.com --services gmail --extra-scopes https://www.googleapis.com/auth/gmail.labelsOAuth clients and account selection
Use named clients for separate Google Cloud projects, organisations, or consent screens:
gog --client work auth credentials set ~/Downloads/work-client.json
gog --client work auth add you@company.com --services gmail,calendar
gog --client work gmail search 'is:unread'Domain mapping auto-selects a client for matching account emails:
gog --client work auth credentials set ~/Downloads/work.json --domain company.comClient resolution order:
1. --client or GOG_CLIENT 2. account_clients config mapping 3. client_domains config mapping 4. credentials file named after the email domain 5. default
Account aliases:
gog auth alias set work you@company.com
gog --account work calendar events primary --today
gog auth alias list
gog auth alias unset work--account auto asks gog to use the default account or the single stored token.
Browser, manual, remote, and proxy auth
Normal local browser flow:
gog auth add you@example.com --services gmail,calendarManual flow for headless systems:
gog auth add you@example.com --services gmail --manualRemote two-step flow:
gog auth add you@example.com --services gmail --remote --step 1
gog auth add you@example.com --services gmail --remote --step 2 --auth-url 'http://127.0.0.1:<port>/oauth2/callback?code=...&state=...'Proxy/tunnel callback:
gog auth add you@example.com --listen-addr 0.0.0.0:8080 --redirect-host gog.example.com
gog auth manage --listen-addr 0.0.0.0:8080 --redirect-host gog.example.comThe redirect URI must match the OAuth client configuration.
Direct tokens and ADC
Direct short-lived token:
gog --access-token "$(gcloud auth print-access-token)" gmail labels list
GOG_ACCESS_TOKEN="$(gcloud auth print-access-token)" gog drive lsApplication Default Credentials mode is useful for Workload Identity, Cloud Run, and local gcloud ADC flows:
GOG_AUTH_MODE=adc gog --json drive lsDirect access tokens expire in about an hour and do not use stored refresh tokens.
Keyring backend
Tokens are stored in a keyring backend:
auto- platform defaultkeychain- macOS Keychainfile- encrypted on-disk store
gog auth keyring
gog auth keyring keychain
gog auth keyring file
gog auth keyring autoEnvironment overrides:
export GOG_KEYRING_BACKEND=file
export GOG_KEYRING_PASSWORD='...'
export GOG_KEYRING_SERVICE_NAME=gogcliUse GOG_KEYRING_PASSWORD for non-interactive file-backend runs.
Service accounts
Workspace domain-wide delegation is required for Admin and Keep and useful for unattended Workspace automation.
Setup outline:
1. Create a Google Cloud service account. 2. Enable domain-wide delegation. 3. Enable the APIs needed. 4. Add the service account client ID and comma-separated scopes in Workspace Admin Console. 5. Store the JSON key for the impersonated subject.
gog auth service-account set admin@example.com --key ~/Downloads/service-account.json
gog auth service-account status admin@example.com
gog --account admin@example.com admin users list --domain example.comRemove a key:
gog auth service-account unset admin@example.comKeep can also accept per-command service-account flags:
gog keep --service-account ~/service-account.json --impersonate user@example.com listAccount and token management
gog auth list
gog auth list --check
gog auth status
gog auth remove you@example.com
gog auth credentials remove work
gog auth tokens list
gog auth tokens delete you@example.comToken export/import contains secrets. Do not use it unless the user explicitly requested it:
gog auth tokens export you@example.com --out token.json
gog auth tokens import token.jsonTroubleshooting
| Symptom | Likely cause | Next command |
|---|---|---|
no credentials | OAuth client JSON not stored | gog auth credentials set <client.json> |
insufficient scopes or 403 | Token lacks service/scope | gog auth add <email> --services <service> --force-consent |
| Keychain prompts or headless failures | Backend cannot unlock | gog auth keyring file plus GOG_KEYRING_PASSWORD |
| Wrong account/client | Alias or client auto-selection | gog auth status; retry with --account and --client |
| Workspace endpoint fails for Gmail.com | Consumer account unsupported | Use Workspace account/admin delegation |
Calendar Operations Reference
Use this for listing calendars, events, availability, scheduling, RSVP, calendar aliases, subscriptions, secondary calendars, team calendars, and Workspace scheduling helpers.
Calendar discovery and aliases
gog calendar calendars
gog calendar calendars --json
gog calendar calendars --all-pages
gog calendar alias list
gog calendar alias set team team@group.calendar.google.com
gog calendar alias unset team
gog calendar events team --todaySubscribe to shared calendars:
gog calendar subscribe user@example.com
gog calendar subscribe team@group.calendar.google.com --color-id 9 --selectedCreate secondary calendars:
gog calendar create-calendar "Project Calendar" \
--description "Launch planning" \
--timezone Europe/Zurich \
--location "Zurich"Access control:
gog calendar acl primary
gog calendar colorsListing events
gog calendar events primary
gog calendar events primary --today --weekday
gog calendar events primary --tomorrow
gog calendar events primary --week --week-start mon
gog calendar events primary --days 14
gog calendar events primary --from "2026-04-25T00:00:00+02:00" --to "2026-04-26T00:00:00+02:00"
gog calendar events --all --from today --to tomorrow
gog calendar events --cal primary --cal team --today
gog calendar events primary --query "planning"
gog calendar events primary --private-prop-filter "source=gog"
gog calendar events primary --fields "id,summary,start,end"Pagination and failure handling:
gog --json calendar events primary --today --max 10
gog --json calendar events primary --today --all-pages
gog calendar events primary --query "unlikely query" --fail-emptyEvent details
gog calendar event primary <eventId>
gog calendar get primary <eventId>
gog calendar search "roadmap" --from today --days 30Create events
Prefer explicit RFC3339 timestamps with timezone offsets.
gog calendar create primary \
--summary "Team Sync" \
--from "2026-04-25T14:00:00+02:00" \
--to "2026-04-25T14:30:00+02:00" \
--attendees "alice@example.com,bob@example.com" \
--with-meet \
--send-updates allDetails:
gog calendar create primary \
--summary "Project Review" \
--description "Quarterly review" \
--location "Room 3" \
--from "2026-04-25T10:00:00+02:00" \
--to "2026-04-25T11:00:00+02:00" \
--event-color 2 \
--visibility private \
--transparency busyAll-day:
gog calendar create primary \
--summary "Company Holiday" \
--from "2026-05-01" \
--to "2026-05-02" \
--all-dayRecurrence and reminders:
gog calendar create primary \
--summary "Weekly Standup" \
--from "2026-04-27T09:00:00+02:00" \
--to "2026-04-27T09:30:00+02:00" \
--rrule "RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR" \
--reminder popup:10m \
--reminder email:1dExtended properties and attachments:
gog calendar create primary \
--summary "Imported Event" \
--from "2026-04-25T12:00:00+02:00" \
--to "2026-04-25T13:00:00+02:00" \
--source-url "https://example.com/event" \
--source-title "Source" \
--private-prop source=gog \
--shared-prop project=alpha \
--attachment "https://drive.google.com/file/d/<fileId>/view"Update, delete, RSVP
gog calendar update primary <eventId> --summary "Updated Title"
gog calendar update primary <eventId> --from "2026-04-25T15:00:00+02:00" --to "2026-04-25T16:00:00+02:00"
gog calendar update primary <eventId> --add-attendee new@example.com
gog calendar update primary <eventId> --attendees "only@example.com"
gog calendar delete primary <eventId>Recurring-event updates/deletes can have scope flags in current builds. Check gog calendar update --help and gog calendar delete --help before altering a series.
Respond:
gog calendar respond primary <eventId> --status accepted --send-updates all
gog calendar respond primary <eventId> --status tentative
gog calendar respond primary <eventId> --status declined --send-updates nonePropose a time:
gog calendar propose-time primary <eventId> \
--from "2026-04-26T14:00:00+02:00" \
--to "2026-04-26T15:00:00+02:00"Availability and conflicts
gog calendar freebusy primary --from "2026-04-25T09:00:00+02:00" --to "2026-04-25T17:00:00+02:00"
gog calendar freebusy --cal primary --cal team --from "2026-04-25T09:00:00+02:00" --to "2026-04-25T17:00:00+02:00"
gog calendar freebusy --all --from "2026-04-25T09:00:00+02:00" --to "2026-04-25T17:00:00+02:00"
gog calendar conflicts --today --all
gog calendar conflicts --from today --to tomorrow --cal primaryWorkspace helpers:
gog calendar users --max 50
gog calendar team engineering@example.com --from today --days 7Special event types
Focus Time:
gog calendar focus-time primary \
--summary "Deep Work" \
--from "2026-04-25T09:00:00+02:00" \
--to "2026-04-25T12:00:00+02:00" \
--auto-decline all \
--decline-message "Focus block" \
--chat-status doNotDisturbOut of Office:
gog calendar out-of-office primary \
--from "2026-05-01T00:00:00+02:00" \
--to "2026-05-05T00:00:00+02:00" \
--auto-decline all \
--decline-message "Away until May 5"Working Location:
gog calendar working-location primary --from "2026-04-25" --to "2026-04-26" --type home
gog calendar working-location primary --from "2026-04-25" --to "2026-04-26" --type office --office-label "HQ" --building-id HQ --floor-id 3 --desk-id 42
gog calendar working-location primary --from "2026-04-25" --to "2026-04-26" --type custom --custom-label "Client site"Equivalent generic event creation is also available with --event-type focus-time|out-of-office|working-location and related --focus-*, --ooo-*, and --working-* flags.
Time input
Accepted formats include:
| Kind | Example |
|---|---|
| RFC3339 | 2026-04-25T14:00:00Z |
| RFC3339 with offset | 2026-04-25T14:00:00+02:00 |
| ISO offset without colon | 2026-04-25T14:00:00+0200 |
| Local datetime | 2026-04-25 14:00:00 |
| Date only | 2026-04-25 |
| Relative ranges | today, tomorrow, monday, next friday |
Generated automation should use RFC3339 with explicit timezone offsets.
Command Reference
Generated from gog schema --json.
gog <command> [flags]- Google CLI for Gmail/Calendar/Chat/Classroom/Drive/Contacts/Tasks/Sheets/Docs/Slides/People/Forms/App Script/Ads/Groups/Admin/Keepgog admin <command> [flags]- Google Workspace Admin (Directory API) - requires domain-wide delegationgog admin groups <command>- Manage Workspace groupsgog admin groups list (ls) [flags]- List groups in a domaingog admin groups members <command>- Manage group membersgog admin groups members add (invite) <groupEmail> <memberEmail> [flags]- Add a member to a groupgog admin groups members list (ls) <groupEmail> [flags]- List group membersgog admin groups members remove (rm,del,delete) <groupEmail> <memberEmail>- Remove a member from a groupgog admin users <command>- Manage Workspace usersgog admin users create (add,new) <email> [flags]- Create a new usergog admin users get (info,show) <userEmail>- Get user detailsgog admin users list (ls) [flags]- List users in a domaingog admin users suspend <userEmail>- Suspend a user accountgog agent <command> [flags]- Agent-friendly helpersgog agent exit-codes (exitcodes,exit-code)- Print stable exit codes for automationgog appscript (script,apps-script) <command> [flags]- Google Apps Scriptgog appscript (script,apps-script) content (cat) <scriptId>- Get Apps Script project contentgog appscript (script,apps-script) create (new) --title=STRING [flags]- Create an Apps Script projectgog appscript (script,apps-script) get (info,show) <scriptId>- Get Apps Script project metadatagog appscript (script,apps-script) run <scriptId> <function> [flags]- Run a deployed Apps Script functiongog auth <command> [flags]- Auth and credentialsgog auth add <email> [flags]- Authorize and store a refresh tokengog auth alias <command>- Manage account aliasesgog auth alias list- List account aliasesgog auth alias set <alias> <email>- Set an account aliasgog auth alias unset <alias>- Remove an account aliasgog auth credentials <command>- Manage OAuth client credentialsgog auth credentials list- List stored OAuth client credentialsgog auth credentials remove [<client>]- Remove stored OAuth client credentialsgog auth credentials set <credentials> [flags]- Store OAuth client credentialsgog auth keep --key=STRING <email>- Configure service account for Google Keep (Workspace only)gog auth keyring [<backend> [<backend2>]]- Configure keyring backendgog auth list [flags]- List stored accountsgog auth manage (login) [flags]- Open accounts manager in browsergog auth remove <email>- Remove a stored refresh tokengog auth service-account <command>- Configure service account (Workspace only; domain-wide delegation)gog auth service-account set --key=STRING <email>- Store a service account key for impersonationgog auth service-account status <email>- Show stored service account key statusgog auth service-account unset <email>- Remove stored service account keygog auth services [flags]- List supported auth services and scopesgog auth status- Show auth configuration and keyring backendgog auth tokens <command>- Manage stored refresh tokensgog auth tokens delete <email>- Delete a stored refresh tokengog auth tokens export <email> [flags]- Export a refresh token to a file (contains secrets)gog auth tokens import <inPath>- Import a refresh token file into keyring (contains secrets)gog auth tokens list- List stored tokens (by key only)gog calendar (cal) <command> [flags]- Google Calendargog calendar (cal) acl (permissions,perms) <calendarId> [flags]- List calendar ACLgog calendar (cal) alias <command>- Manage calendar aliasesgog calendar (cal) alias list- List calendar aliasesgog calendar (cal) alias set <alias> <calendarId>- Set a calendar aliasgog calendar (cal) alias unset <alias>- Remove a calendar aliasgog calendar (cal) calendars [flags]- List calendarsgog calendar (cal) colors- Show calendar colorsgog calendar (cal) conflicts [flags]- Find conflictsgog calendar (cal) create (add,new) <calendarId> [flags]- Create an eventgog calendar (cal) create-calendar (new-calendar) <summary> [flags]- Create a new secondary calendargog calendar (cal) delete (rm,del,remove) <calendarId> <eventId> [flags]- Delete an eventgog calendar (cal) event (get,info,show) <calendarId> <eventId>- Get eventgog calendar (cal) events (list,ls) [<calendarId>] [flags]- List events from a calendar or all calendarsgog calendar (cal) focus-time (focus) --from=STRING --to=STRING [<calendarId>] [flags]- Create a Focus Time blockgog calendar (cal) freebusy [<calendarIds>] [flags]- Get free/busygog calendar (cal) out-of-office (ooo) --from=STRING --to=STRING [<calendarId>] [flags]- Create an Out of Office eventgog calendar (cal) propose-time <calendarId> <eventId> [flags]- Generate URL to propose a new meeting time (browser-only feature)gog calendar (cal) respond (rsvp,reply) <calendarId> <eventId> [flags]- Respond to an event invitationgog calendar (cal) search (find,query) <query> [flags]- Search eventsgog calendar (cal) subscribe (sub,add-calendar) <calendarId> [flags]- Add a calendar to your calendar listgog calendar (cal) team <group-email> [flags]- Show events for all members of a Google Groupgog calendar (cal) time [flags]- Show server timegog calendar (cal) update (edit,set) <calendarId> <eventId> [flags]- Update an eventgog calendar (cal) users [flags]- List workspace users (use their email as calendar ID)gog calendar (cal) working-location (wl) --from=STRING --to=STRING --type=STRING [<calendarId>] [flags]- Set working location (home/office/custom)gog chat <command> [flags]- Google Chatgog chat dm <command>- Direct messagesgog chat dm send (create,post) <email> [flags]- Send a direct messagegog chat dm space (find,setup) <email>- Find or create a DM spacegog chat messages <command>- Chat messagesgog chat messages list (ls) <space> [flags]- List messagesgog chat messages react <message> <emoji> [flags]- Add an emoji reaction to a messagegog chat messages reactions (reaction) <command>- Manage emoji reactions on a messagegog chat messages reactions (reaction) create (add) <message> <emoji> [flags]- Add an emoji reaction to a messagegog chat messages reactions (reaction) delete (remove,rm) <reaction>- Delete a reactiongog chat messages reactions (reaction) list (ls) <message> [flags]- List reactions on a messagegog chat messages send (create,post) <space> [flags]- Send a messagegog chat spaces <command>- Chat spacesgog chat spaces create (add,new) <displayName> [flags]- Create a spacegog chat spaces find (search,query) <displayName> [flags]- Find spaces by display namegog chat spaces list (ls) [flags]- List spacesgog chat threads <command>- Chat threadsgog chat threads list <space> [flags]- List threads in a spacegog classroom (class) <command> [flags]- Google Classroomgog classroom (class) announcements (announcement,ann) <command>- Announcementsgog classroom (class) announcements (announcement,ann) assignees (assign) <courseId> <announcementId> [flags]- Modify announcement assigneesgog classroom (class) announcements (announcement,ann) create (add,new) --text=STRING <courseId> [flags]- Create an announcementgog classroom (class) announcements (announcement,ann) delete (rm,del,remove) <courseId> <announcementId>- Delete an announcementgog classroom (class) announcements (announcement,ann) get (info,show) <courseId> <announcementId>- Get an announcementgog classroom (class) announcements (announcement,ann) list (ls) <courseId> [flags]- List announcementsgog classroom (class) announcements (announcement,ann) update (edit,set) <courseId> <announcementId> [flags]- Update an announcementgog classroom (class) courses (course) <command>- Coursesgog classroom (class) courses (course) archive (arch) <courseId>- Archive a coursegog classroom (class) courses (course) create (add,new) --name=STRING [flags]- Create a coursegog classroom (class) courses (course) delete (rm,del,remove) <courseId>- Delete a coursegog classroom (class) courses (course) get (info,show) <courseId>- Get a coursegog classroom (class) courses (course) join (enroll) <courseId> [flags]- Join a coursegog classroom (class) courses (course) leave (unenroll) <courseId> [flags]- Leave a coursegog classroom (class) courses (course) list (ls) [flags]- List coursesgog classroom (class) courses (course) unarchive (unarch,restore) <courseId>- Unarchive a coursegog classroom (class) courses (course) update (edit,set) <courseId> [flags]- Update a coursegog classroom (class) courses (course) url (link) <courseId> ...- Print Classroom web URLs for coursesgog classroom (class) coursework (work) <command>- Courseworkgog classroom (class) coursework (work) assignees (assign) <courseId> <courseworkId> [flags]- Modify coursework assigneesgog classroom (class) coursework (work) create (add,new) --title=STRING <courseId> [flags]- Create courseworkgog classroom (class) coursework (work) delete (rm,del,remove) <courseId> <courseworkId>- Delete courseworkgog classroom (class) coursework (work) get (info,show) <courseId> <courseworkId>- Get courseworkgog classroom (class) coursework (work) list (ls) <courseId> [flags]- List courseworkgog classroom (class) coursework (work) update (edit,set) <courseId> <courseworkId> [flags]- Update courseworkgog classroom (class) guardian-invitations (guardian-invites) <command>- Guardian invitationsgog classroom (class) guardian-invitations (guardian-invites) create (add,new) --email=STRING <studentId>- Create a guardian invitationgog classroom (class) guardian-invitations (guardian-invites) get (info,show) <studentId> <invitationId>- Get a guardian invitationgog classroom (class) guardian-invitations (guardian-invites) list (ls) <studentId> [flags]- List guardian invitationsgog classroom (class) guardians (guardian) <command>- Guardiansgog classroom (class) guardians (guardian) delete (rm,del,remove) <studentId> <guardianId>- Delete a guardiangog classroom (class) guardians (guardian) get (info,show) <studentId> <guardianId>- Get a guardiangog classroom (class) guardians (guardian) list (ls) <studentId> [flags]- List guardiansgog classroom (class) invitations (invitation,invites) <command>- Invitationsgog classroom (class) invitations (invitation,invites) accept (join) <invitationId>- Accept an invitationgog classroom (class) invitations (invitation,invites) create (add,new) --role=STRING <courseId> <userId>- Create an invitationgog classroom (class) invitations (invitation,invites) delete (rm,del,remove) <invitationId>- Delete an invitationgog classroom (class) invitations (invitation,invites) get (info,show) <invitationId>- Get an invitationgog classroom (class) invitations (invitation,invites) list (ls) [flags]- List invitationsgog classroom (class) materials (material) <command>- Coursework materialsgog classroom (class) materials (material) create (add,new) --title=STRING <courseId> [flags]- Create coursework materialgog classroom (class) materials (material) delete (rm,del,remove) <courseId> <materialId>- Delete coursework materialgog classroom (class) materials (material) get (info,show) <courseId> <materialId>- Get coursework materialgog classroom (class) materials (material) list (ls) <courseId> [flags]- List coursework materialsgog classroom (class) materials (material) update (edit,set) <courseId> <materialId> [flags]- Update coursework materialgog classroom (class) profile (me) <command>- User profilesgog classroom (class) profile (me) get [<userId>]- Get a user profilegog classroom (class) roster (members) <courseId> [flags]- Course roster (students + teachers)gog classroom (class) students (student) <command>- Course studentsgog classroom (class) students (student) add (create,new) <courseId> <userId> [flags]- Add a studentgog classroom (class) students (student) get (info,show) <courseId> <userId>- Get a studentgog classroom (class) students (student) list (ls) <courseId> [flags]- List studentsgog classroom (class) students (student) remove (delete,rm,del,remove) <courseId> <userId>- Remove a studentgog classroom (class) submissions (submission) <command>- Student submissionsgog classroom (class) submissions (submission) get (info,show) <courseId> <courseworkId> <submissionId>- Get a student submissiongog classroom (class) submissions (submission) grade (set,edit) <courseId> <courseworkId> <submissionId> [flags]- Set draft/assigned gradesgog classroom (class) submissions (submission) list (ls) <courseId> <courseworkId> [flags]- List student submissionsgog classroom (class) submissions (submission) reclaim (undo) <courseId> <courseworkId> <submissionId>- Reclaim a submissiongog classroom (class) submissions (submission) return (send) <courseId> <courseworkId> <submissionId>- Return a submissiongog classroom (class) submissions (submission) turn-in (turnin) <courseId> <courseworkId> <submissionId>- Turn in a submissiongog classroom (class) teachers (teacher) <command>- Course teachersgog classroom (class) teachers (teacher) add (create,new) <courseId> <userId>- Add a teachergog classroom (class) teachers (teacher) get (info,show) <courseId> <userId>- Get a teachergog classroom (class) teachers (teacher) list (ls) <courseId> [flags]- List teachersgog classroom (class) teachers (teacher) remove (delete,rm,del,remove) <courseId> <userId>- Remove a teachergog classroom (class) topics (topic) <command>- Topicsgog classroom (class) topics (topic) create (add,new) --name=STRING <courseId>- Create a topicgog classroom (class) topics (topic) delete (rm,del,remove) <courseId> <topicId>- Delete a topicgog classroom (class) topics (topic) get (info,show) <courseId> <topicId>- Get a topicgog classroom (class) topics (topic) list (ls) <courseId> [flags]- List topicsgog classroom (class) topics (topic) update (edit,set) --name=STRING <courseId> <topicId>- Update a topicgog completion <shell> [flags]- Generate shell completion scriptsgog config <command> [flags]- Manage configurationgog config get (show) <key>- Get a config valuegog config keys (list-keys,names)- List available config keysgog config list (ls,all)- List all config valuesgog config no-send (nosend) <command>- Manage per-account Gmail no-send guardsgog config no-send (nosend) list (ls)- List accounts with no-send guardsgog config no-send (nosend) remove (rm,del,delete,unset,disable) <account>- Remove an account no-send guardgog config no-send (nosend) set (add,enable) <account>- Block Gmail send operations for an accountgog config path (where)- Print config file pathgog config set (add,update) <key> <value>- Set a config valuegog config unset (rm,del,remove) <key>- Unset a config valuegog contacts (contact) <command> [flags]- Google Contactsgog contacts (contact) create (add,new) [flags]- Create a contactgog contacts (contact) delete (rm,del,remove) <resourceName>- Delete a contactgog contacts (contact) directory <command>- Directory contactsgog contacts (contact) directory list [flags]- List people from the Workspace directorygog contacts (contact) directory search <query> ... [flags]- Search people in the Workspace directorygog contacts (contact) get (info,show) <resourceName>- Get a contactgog contacts (contact) list (ls) [flags]- List contactsgog contacts (contact) other <command>- Other contactsgog contacts (contact) other delete <resourceName>- Delete an other contactgog contacts (contact) other list [flags]- List other contactsgog contacts (contact) other search <query> ... [flags]- Search other contactsgog contacts (contact) search <query> ... [flags]- Search contacts by name/email/phonegog contacts (contact) update (edit,set) <resourceName> [flags]- Update a contactgog docs (doc) <command> [flags]- Google Docs (export via Drive)gog docs (doc) cat (text,read) <docId> [flags]- Print a Google Doc as plain textgog docs (doc) clear <docId>- Clear all content from a Google Docgog docs (doc) comments <command>- Manage comments on filesgog docs (doc) comments add (create,new) <docId> <content> [flags]- Add a comment to a Google Docgog docs (doc) comments delete (rm,del,remove) <docId> <commentId>- Delete a commentgog docs (doc) comments get (info,show) <docId> <commentId>- Get a comment by IDgog docs (doc) comments list (ls) <docId> [flags]- List comments on a Google Docgog docs (doc) comments reply (respond) <docId> <commentId> <content>- Reply to a commentgog docs (doc) comments resolve <docId> <commentId> [flags]- Resolve a comment (mark as done)gog docs (doc) copy (cp,duplicate) <docId> <title> [flags]- Copy a Google Docgog docs (doc) create (add,new) <title> [flags]- Create a Google Docgog docs (doc) delete --start=INT-64 --end=INT-64 <docId> [flags]- Delete text range from documentgog docs (doc) edit <docId> <find> <replace> [flags]- Find and replace text in a Google Docgog docs (doc) export (download,dl) <docId> [flags]- Export a Google Doc (pdf|docx|txt|md)gog docs (doc) find-replace <docId> <find> [<replace>] [flags]- Find and replace text. Supports plain text or markdown with images; use --first for a single occurrence.gog docs (doc) info (get,show) <docId>- Get Google Doc metadatagog docs (doc) insert <docId> [<content>] [flags]- Insert text at a specific positiongog docs (doc) list-tabs <docId>- List all tabs in a Google Docgog docs (doc) sed <docId> [<expression>] [flags]- Regex find/replace (sed-style: s/pattern/replacement/g)gog docs (doc) structure (struct) <docId> [flags]- Show document structure with numbered paragraphsgog docs (doc) update <docId> [flags]- Insert text at a specific index in a Google Docgog docs (doc) write <docId> [flags]- Write content to a Google Docgog download (dl) <fileId> [flags]- Download a Drive file (alias for 'drive download')gog drive (drv) <command> [flags]- Google Drivegog drive (drv) comments <command>- Manage comments on filesgog drive (drv) comments create (add,new) <fileId> <content> [flags]- Create a comment on a filegog drive (drv) comments delete (rm,del,remove) <fileId> <commentId>- Delete a commentgog drive (drv) comments get (info,show) <fileId> <commentId>- Get a comment by IDgog drive (drv) comments list (ls) <fileId> [flags]- List comments on a filegog drive (drv) comments reply (respond) <fileId> <commentId> <content>- Reply to a commentgog drive (drv) comments update (edit,set) <fileId> <commentId> <content>- Update a commentgog drive (drv) copy <fileId> <name> [flags]- Copy a filegog drive (drv) delete (rm,del) <fileId> [flags]- Move a file to trash (use --permanent to delete forever)gog drive (drv) download <fileId> [flags]- Download a file (exports Google Docs formats)gog drive (drv) drives [flags]- List shared drives (Team Drives)gog drive (drv) get <fileId>- Get file metadatagog drive (drv) ls [flags]- List files in a folder (default: root)gog drive (drv) mkdir <name> [flags]- Create a foldergog drive (drv) move <fileId> [flags]- Move a file to a different foldergog drive (drv) permissions <fileId> [flags]- List permissions on a filegog drive (drv) rename <fileId> <newName>- Rename a file or foldergog drive (drv) search <query> ... [flags]- Full-text search across Drivegog drive (drv) share <fileId> [flags]- Share a file or foldergog drive (drv) unshare <fileId> <permissionId>- Remove a permission from a filegog drive (drv) upload <localPath> [flags]- Upload a filegog drive (drv) url <fileId> ...- Print web URLs for filesgog exit-codes (exitcodes) [flags]- Print stable exit codes (alias for 'agent exit-codes')gog forms (form) <command> [flags]- Google Formsgog forms (form) add-question (add-q,aq) --title=STRING <formId> [flags]- Add a question to a formgog forms (form) create (new) --title=STRING [flags]- Create a formgog forms (form) delete-question (delete-q,dq,rm-q) <formId> <index>- Delete a question by indexgog forms (form) get (info,show) <formId>- Get a formgog forms (form) move-question (move-q,mq) <formId> <oldIndex> <newIndex>- Move a question to a new positiongog forms (form) responses <command>- Form responsesgog forms (form) responses get (info,show) <formId> <responseId>- Get a form responsegog forms (form) responses list (ls) <formId> [flags]- List form responsesgog forms (form) update (edit) <formId> [flags]- Update form title, description, or settingsgog forms (form) watch (watches) <command>- Response watches (push notifications)gog forms (form) watch (watches) create (new,add) --topic=STRING <formId> [flags]- Create a watch for new responsesgog forms (form) watch (watches) delete (rm,remove) <formId> <watchId>- Delete a watchgog forms (form) watch (watches) list (ls) <formId>- List active watchesgog forms (form) watch (watches) renew (refresh) <formId> <watchId>- Renew a watch (extends 7 days)gog gmail (mail,email) <command> [flags]- Gmailgog gmail (mail,email) archive [<messageId> ...] [flags]- Archive messages (remove from inbox)gog gmail (mail,email) attachment <messageId> <attachmentId> [flags]- Download a single attachmentgog gmail (mail,email) autoreply <query> ... [flags]- Reply once to matching messagesgog gmail (mail,email) batch <command>- Batch operationsgog gmail (mail,email) batch delete (rm,del,remove) <messageId> ...- Permanently delete multiple messagesgog gmail (mail,email) batch modify (update,edit,set) <messageId> ... [flags]- Modify labels on multiple messagesgog gmail (mail,email) drafts (draft) <command>- Draft operationsgog gmail (mail,email) drafts (draft) create (add,new) [flags]- Create a draftgog gmail (mail,email) drafts (draft) delete (rm,del,remove) <draftId>- Delete a draftgog gmail (mail,email) drafts (draft) get (info,show) <draftId> [flags]- Get draft detailsgog gmail (mail,email) drafts (draft) list (ls) [flags]- List draftsgog gmail (mail,email) drafts (draft) send (post) <draftId>- Send a draftgog gmail (mail,email) drafts (draft) update (edit,set) <draftId> [flags]- Update a draftgog gmail (mail,email) forward (fwd) --to=STRING <messageId> [flags]- Forward a message to new recipientsgog gmail (mail,email) get (info,show) <messageId> [flags]- Get a message (full|metadata|raw)gog gmail (mail,email) history [flags]- Gmail historygog gmail (mail,email) labels (label) <command>- Label operationsgog gmail (mail,email) labels (label) create (add,new) <name>- Create a new labelgog gmail (mail,email) labels (label) delete (rm,del) <labelIdOrName>- Delete a labelgog gmail (mail,email) labels (label) get (info,show) <labelIdOrName>- Get label details (including counts)gog gmail (mail,email) labels (label) list (ls)- List labelsgog gmail (mail,email) labels (label) modify (update,edit,set) <threadId> ... [flags]- Modify labels on threadsgog gmail (mail,email) labels (label) rename (mv) <labelIdOrName> <newName>- Rename a labelgog gmail (mail,email) labels (label) style (color,colour) <labelIdOrName> [flags]- Change a user label color or visibilitygog gmail (mail,email) mark-read (read-messages) [<messageId> ...] [flags]- Mark messages as readgog gmail (mail,email) messages (message,msg,msgs) <command>- Message operationsgog gmail (mail,email) messages (message,msg,msgs) modify (update,edit,set) <messageId> [flags]- Modify labels on a single messagegog gmail (mail,email) messages (message,msg,msgs) search (find,query,ls,list) <query> ... [flags]- Search messages using Gmail query syntaxgog gmail (mail,email) search (find,query,ls,list) <query> ... [flags]- Search threads using Gmail query syntaxgog gmail (mail,email) send [flags]- Send an emailgog gmail (mail,email) settings <command>- Settings and admingog gmail (mail,email) settings autoforward <command>- Auto-forwarding settingsgog gmail (mail,email) settings autoforward get (info,show)- Get current auto-forwarding settingsgog gmail (mail,email) settings autoforward update (edit,set) [flags]- Update auto-forwarding settingsgog gmail (mail,email) settings delegates <command>- Delegate operationsgog gmail (mail,email) settings delegates add (create,new) <delegateEmail>- Add a delegategog gmail (mail,email) settings delegates get (info,show) <delegateEmail>- Get a specific delegate's informationgog gmail (mail,email) settings delegates list (ls)- List all delegatesgog gmail (mail,email) settings delegates remove (delete,rm,del) <delegateEmail>- Remove a delegategog gmail (mail,email) settings filters <command>- Filter operationsgog gmail (mail,email) settings filters create (add,new) [flags]- Create a new email filtergog gmail (mail,email) settings filters delete (rm,del,remove) <filterId>- Delete a filtergog gmail (mail,email) settings filters export [flags]- Export filters as JSONgog gmail (mail,email) settings filters get (info,show) <filterId>- Get a specific filtergog gmail (mail,email) settings filters list (ls)- List all email filtersgog gmail (mail,email) settings forwarding <command>- Forwarding addressesgog gmail (mail,email) settings forwarding create (add,new) <forwardingEmail>- Create/add a forwarding addressgog gmail (mail,email) settings forwarding delete (rm,del,remove) <forwardingEmail>- Delete a forwarding addressgog gmail (mail,email) settings forwarding get (info,show) <forwardingEmail>- Get a specific forwarding addressgog gmail (mail,email) settings forwarding list (ls)- List all forwarding addressesgog gmail (mail,email) settings sendas <command>- Send-as settingsgog gmail (mail,email) settings sendas create (add,new) <email> [flags]- Create a new send-as aliasgog gmail (mail,email) settings sendas delete (rm,del,remove) <email>- Delete a send-as aliasgog gmail (mail,email) settings sendas get (info,show) <email>- Get details of a send-as aliasgog gmail (mail,email) settings sendas list (ls)- List send-as aliasesgog gmail (mail,email) settings sendas update (edit,set) <email> [flags]- Update a send-as aliasgog gmail (mail,email) settings sendas verify (resend) <email>- Resend verification email for a send-as aliasgog gmail (mail,email) settings vacation <command>- Vacation respondergog gmail (mail,email) settings vacation get (info,show)- Get current vacation responder settingsgog gmail (mail,email) settings vacation update (edit,set) [flags]- Update vacation responder settingsgog gmail (mail,email) settings watch <command>- Manage Gmail watchgog gmail (mail,email) settings watch renew (update) [flags]- Renew Gmail watch using stored configgog gmail (mail,email) settings watch serve [flags]- Run Pub/Sub push handlergog gmail (mail,email) settings watch start (begin) [flags]- Start Gmail watch for Pub/Subgog gmail (mail,email) settings watch status (ls) [flags]- Show stored watch stategog gmail (mail,email) settings watch stop (rm,delete)- Stop Gmail watch and clear stored stategog gmail (mail,email) thread (threads,read) <command>- Thread operations (get, modify)gog gmail (mail,email) thread (threads,read) attachments (files) <threadId> [flags]- List all attachments in a threadgog gmail (mail,email) thread (threads,read) get (info,show) <threadId> [flags]- Get a thread with all messages (optionally download attachments)gog gmail (mail,email) thread (threads,read) modify (update,edit,set) <threadId> [flags]- Modify labels on all messages in a threadgog gmail (mail,email) track <command>- Email open trackinggog gmail (mail,email) track opens [<tracking-id>] [flags]- Query email opensgog gmail (mail,email) track setup [flags]- Set up email tracking (deploy Cloudflare Worker)gog gmail (mail,email) track status- Show tracking configuration statusgog gmail (mail,email) trash [<messageId> ...] [flags]- Move messages to trashgog gmail (mail,email) unread (mark-unread) [<messageId> ...] [flags]- Mark messages as unreadgog gmail (mail,email) url <threadId> ...- Print Gmail web URLs for threadsgog groups (group) <command> [flags]- Google Groupsgog groups (group) list (ls) [flags]- List groups you belong togog groups (group) members <groupEmail> [flags]- List members of a groupgog keep <command> [flags]- Google Keep (Workspace only)gog keep attachment <attachmentName> [flags]- Download an attachmentgog keep create [flags]- Create a new notegog keep delete <noteId> [flags]- Delete a notegog keep get <noteId> [flags]- Get a notegog keep list [flags]- List notesgog keep search <query> [flags]- Search notes by text (client-side)gog login <email> [flags]- Authorize and store a refresh token (alias for 'auth add')gog logout <email> [flags]- Remove a stored refresh token (alias for 'auth remove')gog ls (list) [flags]- List Drive files (alias for 'drive ls')gog me [flags]- Show your profile (alias for 'people me')gog open (browse) <target> [flags]- Print a best-effort web URL for a Google URL/ID (offline)gog people (person) <command> [flags]- Google Peoplegog people (person) get (info,show) <userId>- Get a user profile by IDgog people (person) me- Show your profile (people/me)gog people (person) relations [<userId>] [flags]- Get user relationsgog people (person) search (find,query) <query> ... [flags]- Search the Workspace directorygog schema (help-json,helpjson) [<command> ...] [flags]- Machine-readable command/flag schemagog search (find) <query> ... [flags]- Search Drive files (alias for 'drive search')gog send [flags]- Send an email (alias for 'gmail send')gog sheets (sheet) <command> [flags]- Google Sheetsgog sheets (sheet) add-tab (add-sheet) <spreadsheetId> <tabName> [flags]- Add a new tab/sheet to a spreadsheetgog sheets (sheet) append (add) <spreadsheetId> <range> [<values> ...] [flags]- Append values to a rangegog sheets (sheet) clear <spreadsheetId> <range>- Clear values in a rangegog sheets (sheet) copy (cp,duplicate) <spreadsheetId> <title> [flags]- Copy a Google Sheetgog sheets (sheet) create (new) <title> [flags]- Create a new spreadsheetgog sheets (sheet) delete-tab (delete-sheet) <spreadsheetId> <tabName>- Delete a tab/sheet from a spreadsheet (use --force to skip confirmation)gog sheets (sheet) export (download,dl) <spreadsheetId> [flags]- Export a Google Sheet (pdf|xlsx|csv) via Drivegog sheets (sheet) find-replace <spreadsheetId> <find> <replace> [flags]- Find and replace text across a spreadsheetgog sheets (sheet) format <spreadsheetId> <range> [flags]- Apply cell formatting to a rangegog sheets (sheet) freeze <spreadsheetId> [flags]- Freeze rows and columns on a sheetgog sheets (sheet) get (read,show) <spreadsheetId> <range> [flags]- Get values from a rangegog sheets (sheet) insert <spreadsheetId> <sheet> <dimension> <start> [flags]- Insert empty rows or columns into a sheetgog sheets (sheet) links (hyperlinks) <spreadsheetId> <range>- Get cell hyperlinks from a rangegog sheets (sheet) merge <spreadsheetId> <range> [flags]- Merge cells in a rangegog sheets (sheet) metadata (info) <spreadsheetId>- Get spreadsheet metadatagog sheets (sheet) named-ranges (namedranges,nr) <command>- Manage named rangesgog sheets (sheet) named-ranges (namedranges,nr) add (create,new) <spreadsheetId> <name> <range>- Add a named rangegog sheets (sheet) named-ranges (namedranges,nr) delete (rm,remove,del) <spreadsheetId> <nameOrId>- Delete a named rangegog sheets (sheet) named-ranges (namedranges,nr) get (show,info) <spreadsheetId> <nameOrId>- Get a named rangegog sheets (sheet) named-ranges (namedranges,nr) list <spreadsheetId>- List named rangesgog sheets (sheet) named-ranges (namedranges,nr) update (edit,set) <spreadsheetId> <nameOrId> [flags]- Update a named rangegog sheets (sheet) notes <spreadsheetId> <range>- Get cell notes from a rangegog sheets (sheet) number-format <spreadsheetId> <range> [flags]- Apply number format to a rangegog sheets (sheet) read-format (get-format,format-read) <spreadsheetId> <range> [flags]- Read cell formatting from a rangegog sheets (sheet) rename-tab (rename-sheet) <spreadsheetId> <oldName> <newName>- Rename a tab/sheet in a spreadsheetgog sheets (sheet) resize-columns <spreadsheetId> <columns> [flags]- Resize sheet columnsgog sheets (sheet) resize-rows <spreadsheetId> <rows> [flags]- Resize sheet rowsgog sheets (sheet) unmerge <spreadsheetId> <range>- Unmerge cells in a rangegog sheets (sheet) update (edit,set) <spreadsheetId> <range> [<values> ...] [flags]- Update values in a rangegog sheets (sheet) update-note (set-note) <spreadsheetId> <range> [flags]- Set or clear a cell notegog slides (slide) <command> [flags]- Google Slidesgog slides (slide) add-slide <presentationId> <image> [flags]- Add a slide with a full-bleed image and optional speaker notesgog slides (slide) copy (cp,duplicate) <presentationId> <title> [flags]- Copy a Google Slides presentationgog slides (slide) create (add,new) <title> [flags]- Create a Google Slides presentationgog slides (slide) create-from-markdown <title> [flags]- Create a Google Slides presentation from markdowngog slides (slide) create-from-template <templateId> <title> [flags]- Create a presentation from template with text replacementsgog slides (slide) delete-slide <presentationId> <slideId>- Delete a slide by object IDgog slides (slide) export (download,dl) <presentationId> [flags]- Export a Google Slides deck (pdf|pptx)gog slides (slide) info (get,show) <presentationId>- Get Google Slides presentation metadatagog slides (slide) list-slides <presentationId>- List all slides with their object IDsgog slides (slide) read-slide <presentationId> <slideId>- Read slide content: speaker notes, text elements, and imagesgog slides (slide) replace-slide <presentationId> <slideId> <image> [flags]- Replace the image on an existing slide in-placegog slides (slide) thumbnail (thumb) <presentationId> <slideId> [flags]- Get or download a rendered thumbnail for a slidegog slides (slide) update-notes <presentationId> <slideId> [flags]- Update speaker notes on an existing slidegog status (st) [flags]- Show auth/config status (alias for 'auth status')gog tasks (task) <command> [flags]- Google Tasksgog tasks (task) add (create) <tasklistId> [flags]- Add a taskgog tasks (task) clear <tasklistId>- Clear completed tasksgog tasks (task) delete (rm,del,remove) <tasklistId> <taskId>- Delete a taskgog tasks (task) done (complete) <tasklistId> <taskId>- Mark task completedgog tasks (task) get (info,show) <tasklistId> <taskId>- Get a taskgog tasks (task) list (ls) <tasklistId> [flags]- List tasksgog tasks (task) lists <command>- List task listsgog tasks (task) lists create (add,new) <title> ...- Create a task listgog tasks (task) lists list [flags]- List task listsgog tasks (task) undo (uncomplete,undone) <tasklistId> <taskId>- Mark task needs actiongog tasks (task) update (edit,set) <tasklistId> <taskId> [flags]- Update a taskgog time <command> [flags]- Local time utilitiesgog time now [flags]- Show current timegog upload (up,put) <localPath> [flags]- Upload a file to Drive (alias for 'drive upload')gog version [flags]- Print versiongog whoami (who-am-i) [flags]- Show your profile (alias for 'people me')
gogcli Configuration Reference
Config files
Configuration is JSON5 in the platform config directory:
| Platform | Path |
|---|---|
| macOS | ~/Library/Application Support/gogcli/config.json |
| Linux | ~/.config/gogcli/config.json |
| Windows | %AppData%\gogcli\config.json |
gog config path
gog config list
gog config keys
gog config get default_timezone
gog config set default_timezone Europe/Zurich
gog config unset default_timezoneCommon config keys
gog config set default_account you@example.com
gog config set default_timezone Europe/Zurich
gog auth keyring fileUseful structured config:
{
keyring_backend: "auto",
default_timezone: "Europe/Zurich",
default_account: "you@example.com",
account_clients: {
"you@company.com": "work",
},
client_domains: {
"company.com": "work",
},
}Prefer gog auth alias ... and gog --client ... auth credentials set --domain ... over hand-editing aliases/client mappings.
Environment variables
Account/auth:
export GOG_ACCOUNT=you@example.com
export GOG_CLIENT=work
export GOG_ACCESS_TOKEN="$(gcloud auth print-access-token)"
export GOG_AUTH_MODE=adcOutput:
export GOG_JSON=1
export GOG_PLAIN=1
export GOG_COLOR=never
export NO_COLOR=1Time and calendar:
export GOG_TIMEZONE=Europe/Zurich
export GOG_CALENDAR_WEEKDAY=1Keyring:
export GOG_KEYRING_BACKEND=file
export GOG_KEYRING_PASSWORD='...'
export GOG_KEYRING_SERVICE_NAME=gogcliAgent safety:
export GOG_ENABLE_COMMANDS=calendar.events,calendar.freebusy,tasks
export GOG_DISABLE_COMMANDS=gmail.send,gmail.drafts.send,drive.share
export GOG_GMAIL_NO_SEND=1Output modes
Default text output is for humans. For agents and scripts, use JSON first:
gog --json gmail search 'is:unread' | jq '.threads'
gog --json --results-only drive search "budget" | jq .
gog --json --select id,name,mimeType drive lsUse TSV when shell tools are enough:
gog --plain gmail search 'is:unread' | cut -f1Errors, hints, and progress are intended for stderr so stdout remains parseable.
Pagination and empty results
List commands commonly support --max, --page, and sometimes --all-pages or --all.
gog --json gmail search 'newer_than:7d' --max 10 | jq -r '.nextPageToken'
gog --json calendar events primary --today --all-pages
gog --json calendar events primary --query "unlikely query" --fail-empty--fail-empty exits with a stable non-zero code when no results are found on commands that support it.
Dates and times
Agent guidance:
- Generate RFC3339 datetimes with explicit timezone offsets for event-like fields.
- Use
YYYY-MM-DDonly for date-only fields. - Calendar ranges also accept relative values such as
today,tomorrow,yesterday,monday, andnext friday.
Examples:
gog calendar events primary --from "2026-04-25T00:00:00+02:00" --to "2026-04-26T00:00:00+02:00"
gog calendar events primary --today
gog tasks add <tasklistId> --title "Renew" --due "2026-05-01"Safety controls
For read-only or constrained automation:
GOG_ENABLE_COMMANDS=calendar.events,calendar.freebusy,drive.search \
gog --no-input --json calendar events primary --today
GOG_DISABLE_COMMANDS=gmail.send,gmail.forward,drive.share \
gog --no-input --json drive search "report"
gog --gmail-no-send gmail send --to user@example.com --subject "Test" --body "Blocked"Per-account send guard:
gog config no-send set you@example.com
gog config no-send list
gog config no-send remove you@example.comStable exit-code help:
gog agent exit-codes
gog exit-codesDiscovering current syntax
gog --help
GOG_HELP=full gog --help
gog <service> --help
gog <service> <command> --help
gog schema --json | jq .The generated local reference is references/command-reference.md.
Drive, Docs, Sheets, Slides, Forms, and Apps Script Reference
Use this for Google Drive files and Google editor content operations.
Drive
List/search:
gog drive ls
gog drive ls --parent <folderId>
gog drive ls --all
gog drive ls --query "mimeType='application/pdf' and trashed=false"
gog drive search "quarterly report" --max 20
gog drive search "invoice filetype:pdf" --json
gog drive get <fileId>
gog drive url <fileId1> <fileId2>Download/export:
gog drive download <fileId> --out ./file.pdf
gog drive download <docFileId> --format pdf --out ./doc.pdf
gog drive download <sheetFileId> --format xlsx --out ./sheet.xlsx
gog drive download <slideFileId> --format pptx --out ./deck.pptxUpload/create/replace:
gog drive upload ./report.pdf --parent <folderId>
gog drive upload ./report.pdf --name "Q2 Report.pdf"
gog drive upload ./report.md --convert-to doc --parent <folderId>
gog drive upload ./data.csv --convert-to sheet
gog drive upload ./deck.pptx --convert-to slides
gog drive upload ./report.md --convert-to doc --keep-frontmatter
gog drive upload ./updated.pdf --replace <fileId> --name "Updated.pdf"
gog drive mkdir "New Folder" --parent <folderId>--replace preserves the Drive file ID, shared link, and permissions.
File operations:
gog drive copy <fileId> "Copy Name" --parent <folderId>
gog drive move <fileId> --parent <newFolderId>
gog drive rename <fileId> "New Name"
gog drive delete <fileId>
gog drive delete <fileId> --permanentPrefer normal delete, which moves to trash. Use --permanent only when explicitly requested.
Sharing:
gog drive share <fileId> --to user --email user@example.com --role writer
gog drive share <fileId> --to user --email user@example.com --role commenter
gog drive share <fileId> --to domain --domain example.com --role reader
gog drive share <fileId> --to anyone --role reader
gog drive permissions <fileId>
gog drive unshare <fileId> <permissionId>Public/domain sharing may prompt or require --force; explain the effect first.
Shared drives and comments:
gog drive drives
gog drive drives --query "name contains 'Team'"
gog drive comments list <fileId>
gog drive comments get <fileId> <commentId>
gog drive comments create <fileId> "Please review"
gog drive comments update <fileId> <commentId> "Updated comment"
gog drive comments reply <fileId> <commentId> "Done"
gog drive comments delete <fileId> <commentId>Drive query examples:
gog drive ls --query "name contains 'Report'"
gog drive ls --query "'<folderId>' in parents and trashed=false"
gog drive ls --query "mimeType='application/vnd.google-apps.spreadsheet'"
gog drive ls --query "modifiedTime > '2026-04-01T00:00:00'"Docs
Create/copy/read/export:
gog docs create "Meeting Notes"
gog docs copy <docId> "Copy of Meeting Notes"
gog docs info <docId>
gog docs cat <docId>
gog docs cat <docId> -N
gog docs export <docId> --format pdf --out ./doc.pdf
gog docs export <docId> --format docx --out ./doc.docx
gog docs export <docId> --format md --out ./doc.md
gog docs export <docId> --format html --out ./doc.htmlWrite/import:
gog docs write <docId> --text "Plain text"
gog docs write <docId> --file ./brief.txt --replace
gog docs write <docId> --file ./brief.md --replace --markdown
gog docs write <docId> --file - --replace
gog docs write <docId> --file ./appendix.md --append --markdown
gog docs create "Brief" --file ./brief.md --pagelessTabs and structure:
gog docs list-tabs <docId>
gog docs structure <docId>
gog docs write <docId> --file ./tab.md --replace --markdown --tab-id <tabId>Edit text:
gog docs find-replace <docId> "{{NAME}}" "Ada"
gog docs find-replace <docId> "{{BODY}}" --content-file ./body.md --format markdown
gog docs find-replace <docId> "{{LOGO}}" --content-file ./logo.md --format markdown --first
gog docs insert <docId> "Intro text" --index 1
gog docs delete <docId> --start 10 --end 20
gog docs clear <docId>Sed-style rich editing:
gog docs sed <docId> 's/status/{b c=green}approved/g' --dry-run
gog docs sed <docId> -f edits.sed
echo 's/title/{h=1}Quarterly Report/' | gog docs sed <docId>Read references/sedmat.md for the full sedmat DSL: bold/italic, colours, links, images, headings, tables, checkboxes, and regex captures.
Docs comments:
gog docs comments list <docId>
gog docs comments add <docId> "Please revise this paragraph"
gog docs comments reply <docId> <commentId> "Updated"
gog docs comments resolve <docId> <commentId>
gog docs comments delete <docId> <commentId>Sheets
Create/copy/export:
gog sheets create "Budget 2026" --sheets "Q1,Q2"
gog sheets create "Budget 2026" --parent <folderId>
gog sheets copy <spreadsheetId> "Budget Copy"
gog sheets export <spreadsheetId> --format xlsx --out ./budget.xlsx
gog sheets metadata <spreadsheetId>Values:
gog sheets get <spreadsheetId> 'Sheet1!A1:D10'
gog sheets update <spreadsheetId> 'Sheet1!A1:B2' '[["Name","Age"],["Ada",30]]'
gog sheets append <spreadsheetId> 'Sheet1!A:B' '[["Grace",35]]'
gog sheets clear <spreadsheetId> 'Sheet1!A1:D10'Formatting and layout:
gog sheets format <spreadsheetId> 'Sheet1!A1:D1' --bold --bg-color '#FFCC00' --h-align center
gog sheets number-format <spreadsheetId> 'Sheet1!B2:B100' --pattern '$#,##0.00'
gog sheets merge <spreadsheetId> 'Sheet1!A1:D1'
gog sheets unmerge <spreadsheetId> 'Sheet1!A1:D1'
gog sheets freeze <spreadsheetId> --sheet Sheet1 --rows 1 --cols 0
gog sheets resize-columns <spreadsheetId> 'Sheet1!A:C' --width 160
gog sheets resize-rows <spreadsheetId> 'Sheet1!1:10' --height 36
gog sheets read-format <spreadsheetId> 'Sheet1!A1:B2'
gog sheets read-format <spreadsheetId> 'Sheet1!A1:B2' --effectiveRows, columns, tabs:
gog sheets insert <spreadsheetId> Sheet1 rows 2 --count 3
gog sheets insert <spreadsheetId> Sheet1 cols 3 --after
gog sheets add-tab <spreadsheetId> "Summary" --index 0
gog sheets rename-tab <spreadsheetId> "Sheet1" "Raw"
gog sheets delete-tab <spreadsheetId> "Old" --forceNotes, links, find/replace:
gog sheets notes <spreadsheetId> 'Sheet1!A1:B10'
gog sheets update-note <spreadsheetId> 'Sheet1!A1' --note "Check this"
gog sheets update-note <spreadsheetId> 'Sheet1!A1' --note ''
gog sheets links <spreadsheetId> 'Sheet1!A1:B10'
gog sheets find-replace <spreadsheetId> "old" "new" --sheet Sheet1Named ranges:
gog sheets named-ranges list <spreadsheetId>
gog sheets named-ranges get <spreadsheetId> MyRange
gog sheets named-ranges add <spreadsheetId> MyRange 'Sheet1!A1:B2'
gog sheets named-ranges update <spreadsheetId> MyRange --name BetterRange
gog sheets named-ranges delete <spreadsheetId> BetterRangeCharts:
gog sheets chart list <spreadsheetId>
gog sheets chart get <spreadsheetId> <chartId> --json > chart.json
gog sheets chart create <spreadsheetId> --spec-json @chart.json --sheet Sheet1 --anchor E10
gog sheets chart update <spreadsheetId> <chartId> --spec-json '{"title":"New Title"}'
gog sheets chart delete <spreadsheetId> <chartId>A1 range reminders:
| Format | Meaning |
|---|---|
Sheet1!A1 | one cell |
Sheet1!A1:B2 | rectangular range |
Sheet1!A:A | column |
Sheet1!1:1 | row |
Sheet1 | whole sheet |
A1:B2 | default sheet |
Slides
Create/copy/export:
gog slides create "Q2 Review"
gog slides copy <presentationId> "Q2 Review Copy"
gog slides info <presentationId>
gog slides export <presentationId> --format pptx --out ./deck.pptx
gog slides export <presentationId> --format pdf --out ./deck.pdfGenerate/edit decks:
gog slides create-from-markdown "Status Deck" --content-file ./deck.md
gog slides create-from-template <templateId> "Monthly Report" --replace "month=April" --replace "revenue=$1.2M"
gog slides create-from-template <templateId> "Monthly Report" --replacements replacements.json
gog slides add-slide <presentationId> ./slide.png --notes "Speaker notes"
gog slides replace-slide <presentationId> <slideId> ./replacement.png
gog slides update-notes <presentationId> <slideId> --notes-file ./notes.txtInspect/render:
gog slides list-slides <presentationId>
gog slides read-slide <presentationId> <slideId>
gog slides read-slide <presentationId> <slideId> --recursive --json
gog slides thumbnail <presentationId> <slideId>
gog slides thumbnail <presentationId> <slideId> --out ./slide.png
gog slides thumbnail <presentationId> <slideId> --size medium --format jpeg --out ./slide.jpg
gog slides delete-slide <presentationId> <slideId>Forms
gog forms create --title "Weekly Check-in" --description "Friday async update"
gog forms get <formId>
gog forms update <formId> --title "Weekly Sync" --quiz true
gog forms add-question <formId> --title "What shipped?" --type paragraph --required
gog forms move-question <formId> 3 1
gog forms delete-question <formId> 2 --force
gog forms responses list <formId> --max 20
gog forms responses get <formId> <responseId>
gog forms watch create <formId> --topic projects/<project>/topics/<topic>
gog forms watch list <formId>
gog forms watch renew <formId> <watchId>
gog forms watch delete <formId> <watchId>Apps Script
gog appscript create --title "Automation Helpers"
gog appscript create --title "Bound Script" --parent-id <driveFileId>
gog appscript get <scriptId>
gog appscript content <scriptId>
gog appscript run <scriptId> myFunction --params '["arg1", 123, true]'
gog appscript run <scriptId> myFunction --dev-modeScripting examples
Download every PDF in a folder:
gog --json drive ls --parent <folderId> --query "mimeType='application/pdf'" | \
jq -r '.files[].id' | \
xargs -n 1 -I {} gog drive download {} --out ./pdfs/Export all docs returned by a query:
gog --json drive ls --query "mimeType='application/vnd.google-apps.document' and trashed=false" | \
jq -r '.files[] | @tsv "\(.id)\t\(.name)"' | \
while IFS=$'\t' read -r id name; do
gog docs export "$id" --format pdf --out "./pdfs/${name}.pdf"
doneGmail Operations Reference
Use this for Gmail search, reading, organization, sending, forwarding, autoreply, settings, watches, tracking, and batch mail workflows.
Search syntax
Gmail queries use normal Gmail search operators:
| Operator | Example |
|---|---|
| sender/recipient | from:alice@example.com, to:me |
| subject/body | subject:invoice, "exact phrase" |
| state | is:unread, is:starred, is:important |
| labels/location | label:Project, in:inbox, in:sent, in:trash |
| attachments | has:attachment, filename:pdf |
| dates | after:2026/04/01, before:2026/05/01, newer_than:7d, older_than:1m |
| size | larger:10M, smaller:1M |
| exclusion | -label:newsletters, -from:noreply@example.com |
Reading mail
Thread search:
gog gmail search 'is:unread newer_than:7d'
gog --json gmail search 'from:boss@example.com has:attachment' --max 20
gog --json gmail search 'older_than:1y' --max 200 | jq -r '.threads[].id'Message search:
gog gmail messages search 'from:alice@example.com'
gog gmail messages search 'is:unread' --include-body
gog gmail messages search 'subject:report newer_than:30d' --fullRetrieve:
gog gmail thread get <threadId>
gog gmail thread get <threadId> --full
gog gmail thread get <threadId> --download --out-dir ./attachments
gog gmail get <messageId> --format full
gog gmail get <messageId> --format metadata --headers Subject,From,Date
gog gmail get <messageId> --format raw
gog gmail url <threadId1> <threadId2>Attachments:
gog gmail thread attachments <threadId>
gog gmail attachment <messageId> <attachmentId> --out ./attachments/
gog gmail attachment <messageId> <attachmentId> --name report.pdfHistory:
gog gmail history --since <historyId>Sending and drafts
Before sending from an agent, verify the user asked to actually send. Use --dry-run where possible or configure no-send guards when preparing content.
gog gmail send --to recipient@example.com --subject "Hello" --body "Plain text"
gog gmail send --to recipient@example.com --subject "Report" --body-file ./body.txt --attach ./report.pdf
gog gmail send --to user@example.com --subject "HTML" --body-html '<p>Hello</p>'
gog gmail send --to user@example.com --subject "Alias" --from alias@example.com --body-file ./body.txtReplies:
gog gmail send --reply-to-message-id <messageId> --reply-all --subject "Re: Topic" --body-file ./reply.txt
gog gmail send --thread-id <threadId> --reply-all --quote --subject "Re: Topic" --body-file ./reply.txtForwarding:
gog gmail forward <messageId> --to user@example.com
gog gmail forward <messageId> --to user@example.com --note "FYI" --from alias@example.comDrafts:
gog gmail drafts list --max 10
gog gmail drafts get <draftId> --download
gog gmail drafts create --to user@example.com --subject "Draft" --body-file ./draft.txt
gog gmail drafts update <draftId> --subject "Updated" --body-file ./draft.txt
gog gmail drafts send <draftId>
gog gmail drafts delete <draftId>Tracking:
gog gmail track setup --worker-url https://your-worker.workers.dev
gog gmail send --to user@example.com --subject "Tracked" --body-html '<p>Hello</p>' --track
gog gmail send --to a@example.com --to b@example.com --subject "Tracked" --body-html '<p>Hello</p>' --track-split
gog gmail track status
gog gmail track opens <trackingId>
gog gmail track opens --recipient user@example.comLabels and organization
Labels:
gog gmail labels list
gog gmail labels get INBOX
gog gmail labels create "Project/Subproject"
gog gmail labels rename "Old Label" "New Label"
gog gmail labels style "Project" --text-color "#ffffff" --background-color "#16a34a"
gog gmail labels style "Project" --label-list-visibility labelShow --message-list-visibility show
gog gmail labels delete "Project/Old"Thread/message label changes:
gog gmail thread modify <threadId> --add Project --remove INBOX
gog gmail labels modify <threadId1> <threadId2> --add Done --remove UNREAD
gog gmail messages modify <messageId> --add STARRED
gog gmail batch modify <messageId1> <messageId2> --remove UNREADConvenience actions:
gog gmail archive <messageId1> <messageId2>
gog gmail mark-read <messageId>
gog gmail unread <messageId>
gog gmail trash <messageId>
gog gmail batch delete <messageId1> <messageId2>Use care: batch delete permanently deletes messages.
Batch patterns:
gog --json gmail search 'from:noreply@example.com' --max 200 | \
jq -r '.threads[].id' | \
xargs -n 50 gog gmail labels modify --remove INBOX
gog --json gmail messages search 'older_than:90d label:updates' --max 500 | \
jq -r '.messages[].id' | \
xargs -n 50 gog gmail batch modify --add UpdatesArchive --remove INBOXAutoreply
gog gmail autoreply is a one-shot command intended for cron/launchd or agent workflows. It replies once to matching messages, then labels them for dedupe.
gog gmail autoreply \
'to:support@example.com in:inbox -label:AutoReplied' \
--body-file ./support-autoreply.txt \
--label AutoReplied \
--archive \
--mark-readUseful flags:
--max 20
--subject "Re: ..."
--body / --body-file / --body-html
--from alias@example.com
--reply-to support@example.com
--label AutoReplied
--archive
--mark-read
--skip-bulk
--allow-selfIt adds Auto-Submitted: auto-replied and skips common bulk/list/auto-generated mail by default.
Gmail settings
Most settings commands work both as gog gmail <group> ... and gog gmail settings <group> ....
Filters:
gog gmail filters list
gog gmail filters get <filterId>
gog gmail filters create --from newsletters@example.com --add-label Newsletters --remove-label INBOX
gog gmail filters export --out filters.json
gog gmail filters delete <filterId>Forwarding and auto-forward:
gog gmail forwarding list
gog gmail forwarding create forward@example.com
gog gmail forwarding delete forward@example.com
gog gmail autoforward get
gog gmail autoforward update --enabled --email forward@example.com --disposition archiveDelegates:
gog gmail delegates list
gog gmail delegates get assistant@example.com
gog gmail delegates add assistant@example.com
gog gmail delegates remove assistant@example.comSend-as aliases:
gog gmail sendas list
gog gmail sendas get alias@example.com
gog gmail sendas create alias@example.com --display-name "Ada Example"
gog gmail sendas verify alias@example.com
gog gmail sendas update alias@example.com --reply-to support@example.com
gog gmail sendas delete alias@example.comVacation responder:
gog gmail vacation get
gog gmail vacation update --enabled --subject "Out of office" --body "Back Monday"
gog gmail vacation update --disabledSettings that create forwarding, delegates, or public-ish automation may prompt or require --force in non-interactive contexts. Explain the effect first.
Pub/Sub watch
gog gmail watch start --topic projects/my-project/topics/gmail-notifications
gog gmail watch start --topic projects/my-project/topics/gmail-notifications --label INBOX --label IMPORTANT
gog gmail watch status
gog gmail watch renew
gog gmail watch stopHandler:
gog gmail watch serve --bind 0.0.0.0 --port 8080 --path /webhook
gog gmail watch serve --bind 0.0.0.0 --port 8080 --path /webhook --include-body --max-bytes 20000Recent versions also support history-type filtering on watch serve. Check gog gmail watch serve --help before relying on exact flags.
Auth/scopes
Readonly mail:
gog auth add you@example.com --services gmail --gmail-scope readonlyFull Gmail automation/settings:
gog auth add you@example.com --services gmail --gmail-scope full --force-consentSettings commands need Gmail settings scopes. If a settings/filter/delegate command fails with insufficient scopes, re-auth with --services gmail --force-consent.
Other Services Reference
Use this for Chat, Classroom, Contacts, Tasks, People, Groups, Admin, Keep, and local time helpers.
Chat (Workspace)
Chat commands require Google Workspace; consumer Gmail accounts are not supported.
Spaces:
gog chat spaces list
gog chat spaces find "Engineering"
gog chat spaces find "Engineering" --exact
gog chat spaces create "Project Room" --member alice@example.com --member bob@example.comMessages and threads:
gog chat messages list spaces/<spaceId> --max 50
gog chat messages list spaces/<spaceId> --thread spaces/<spaceId>/threads/<threadId>
gog chat messages list spaces/<spaceId> --unread
gog chat messages send spaces/<spaceId> --text "Build complete"
gog chat messages send spaces/<spaceId> --text "Reply" --thread spaces/<spaceId>/threads/<threadId>
gog chat threads list spaces/<spaceId>Reactions:
gog chat messages reactions list spaces/<spaceId>/messages/<messageId>
gog chat messages react spaces/<spaceId>/messages/<messageId> <emoji>
gog chat messages reactions create spaces/<spaceId>/messages/<messageId> <emoji>
gog chat messages reactions delete spaces/<spaceId>/messages/<messageId>/reactions/<reactionId>Direct messages:
gog chat dm space user@example.com
gog chat dm send user@example.com --text "Ping"
gog chat dm send user@example.com --text "Reply" --thread spaces/<spaceId>/threads/<threadId>Classroom
Classroom commands generally require Google Workspace for Education. Personal accounts have limited support.
Courses:
gog classroom courses list
gog classroom courses list --role teacher
gog classroom courses get <courseId>
gog classroom courses create --name "Physics 101" --owner me --state ACTIVE
gog classroom courses update <courseId> --name "Physics 102"
gog classroom courses archive <courseId>
gog classroom courses unarchive <courseId>
gog classroom courses delete <courseId>
gog classroom courses url <courseId>Roster:
gog classroom roster <courseId>
gog classroom roster <courseId> --students
gog classroom roster <courseId> --teachers
gog classroom students list <courseId>
gog classroom students get <courseId> <userId>
gog classroom students add <courseId> <userId>
gog classroom students remove <courseId> <userId>
gog classroom teachers list <courseId>
gog classroom teachers add <courseId> <userId>
gog classroom teachers remove <courseId> <userId>Coursework and materials:
gog classroom coursework list <courseId>
gog classroom coursework list <courseId> --state PUBLISHED --topic <topicId>
gog classroom coursework get <courseId> <courseworkId>
gog classroom coursework create <courseId> --title "Homework 1" --type ASSIGNMENT --state PUBLISHED --due "2026-05-01T23:59:59Z" --max-points 100
gog classroom coursework update <courseId> <courseworkId> --title "Updated"
gog classroom coursework assignees <courseId> <courseworkId> --mode INDIVIDUAL_STUDENTS --add-student <studentId>
gog classroom coursework delete <courseId> <courseworkId>
gog classroom materials list <courseId>
gog classroom materials get <courseId> <materialId>
gog classroom materials create <courseId> --title "Syllabus" --state PUBLISHED
gog classroom materials update <courseId> <materialId> --title "Updated"
gog classroom materials delete <courseId> <materialId>Submissions:
gog classroom submissions list <courseId> <courseworkId>
gog classroom submissions list <courseId> <courseworkId> --state TURNED_IN
gog classroom submissions get <courseId> <courseworkId> <submissionId>
gog classroom submissions grade <courseId> <courseworkId> <submissionId> --grade 95
gog classroom submissions return <courseId> <courseworkId> <submissionId>
gog classroom submissions turn-in <courseId> <courseworkId> <submissionId>
gog classroom submissions reclaim <courseId> <courseworkId> <submissionId>Announcements, topics, invitations, guardians, profile:
gog classroom announcements list <courseId>
gog classroom announcements create <courseId> --text "Welcome"
gog classroom announcements update <courseId> <announcementId> --text "Updated"
gog classroom announcements assignees <courseId> <announcementId> --mode INDIVIDUAL_STUDENTS --add-student <studentId>
gog classroom announcements delete <courseId> <announcementId>
gog classroom topics list <courseId>
gog classroom topics create <courseId> --name "Unit 1"
gog classroom topics update <courseId> <topicId> --name "Unit 2"
gog classroom topics delete <courseId> <topicId>
gog classroom invitations list
gog classroom invitations create <courseId> <userId> --role student
gog classroom invitations accept <invitationId>
gog classroom invitations delete <invitationId>
gog classroom guardians list <studentId>
gog classroom guardians get <studentId> <guardianId>
gog classroom guardians delete <studentId> <guardianId>
gog classroom guardian-invitations list <studentId>
gog classroom guardian-invitations create <studentId> --email parent@example.com
gog classroom profile get
gog classroom profile get <userId>Contacts
Search/list/get:
gog contacts search "Ada"
gog contacts list --max 100
gog contacts get people/c1234567890
gog contacts get ada@example.comCreate/update:
gog contacts create --given "Ada" --family "Lovelace" --email ada@example.com --phone "+41441234567"
gog contacts create --given "Ada" --org "Analytical Engines Ltd" --title "Programmer" --url https://example.com --custom source=gog
gog contacts create --given "Ada" --address "street=1 Main St;city=Zurich;country=CH" --relation manager=Grace
gog contacts update people/c1234567890 --given "Ada" --email ada@new.example
gog contacts update people/c1234567890 --birthday "1815-12-10"
gog contacts update people/c1234567890 --from-file contact.json
gog contacts update people/c1234567890 --from-file - --ignore-etag
gog contacts delete people/c1234567890Workspace directory and other contacts:
gog contacts directory list
gog contacts directory search "smith"
gog contacts other list
gog contacts other search "jane"
gog contacts other delete people/other...For bulk or precise People API payload updates, prefer contacts update --from-file after inspecting contacts get --json.
Tasks
Task lists:
gog tasks lists
gog tasks lists create "Personal"Tasks:
gog tasks list <tasklistId>
gog tasks get <tasklistId> <taskId>
gog tasks add <tasklistId> --title "Buy groceries"
gog tasks add <tasklistId> --title "Project deadline" --notes "Submit final report" --due "2026-05-01"
gog tasks update <tasklistId> <taskId> --title "Updated title"
gog tasks update <tasklistId> <taskId> --due ""
gog tasks done <tasklistId> <taskId>
gog tasks undo <tasklistId> <taskId>
gog tasks delete <tasklistId> <taskId>
gog tasks clear <tasklistId>Repeating tasks materialize occurrences:
gog tasks add <tasklistId> --title "Weekly review" --due "2026-04-27" --repeat weekly
gog tasks add <tasklistId> --title "Monthly report" --due "2026-05-01" --repeat monthly --repeat-count 12
gog tasks add <tasklistId> --title "Daily standup" --due "2026-04-25" --repeat daily --repeat-until "2026-05-01"
gog tasks add <tasklistId> --title "Every other week" --due "2026-04-27" --recur-rrule "FREQ=WEEKLY;INTERVAL=2"Subtasks/order:
gog tasks add <tasklistId> --title "Subtask" --parent <parentTaskId>
gog tasks add <tasklistId> --title "Next task" --previous <previousTaskId>People
gog people me
gog people get people/<userId>
gog people get user@example.com
gog people search "Ada Lovelace" --max 5
gog people relations
gog people relations people/<userId> --type managerpeople search is for Workspace directory/profile-style lookup; use contacts search for personal contacts.
Groups
Groups commands use Cloud Identity and require Workspace scopes.
gog groups list
gog groups members engineering@example.comIf scopes are missing:
gog auth add you@example.com --services groups --force-consentAdmin (Workspace)
Admin commands require a Workspace service account with domain-wide delegation and Admin SDK scopes.
Users:
gog admin users list --domain example.com
gog admin users get user@example.com
gog admin users create user@example.com --given Ada --family Lovelace --password 'TempPass123!'
gog admin users suspend user@example.comGroups:
gog admin groups list --domain example.com
gog admin groups members list engineering@example.com
gog admin groups members add engineering@example.com user@example.com --role MEMBER
gog admin groups members remove engineering@example.com user@example.comTreat Admin writes as high impact. Use --dry-run when supported and require explicit user intent.
Keep (Workspace)
Google Keep requires Workspace service-account access/domain-wide delegation.
gog keep --service-account ~/service-account.json --impersonate user@example.com list
gog keep --service-account ~/service-account.json --impersonate user@example.com search "receipt"
gog keep --service-account ~/service-account.json --impersonate user@example.com get <noteId>
gog keep --service-account ~/service-account.json --impersonate user@example.com create --title "Shopping" --text "Milk\nEggs"
gog keep --service-account ~/service-account.json --impersonate user@example.com create --title "Todo" --item "Task 1" --item "Task 2"
gog keep --service-account ~/service-account.json --impersonate user@example.com attachment <attachmentName> --out ./file.bin
gog keep --service-account ~/service-account.json --impersonate user@example.com delete <noteId>If a service account is configured for the impersonated account, normal account selection can be enough:
gog auth service-account set user@example.com --key ~/service-account.json
gog --account user@example.com keep listTime utilities
gog time now
gog time now --timezone UTC
gog time now --timezone Europe/Zurich
gog time now --timezone America/New_YorkUse this for quick local/UTC conversions in scripts.
Sedmat: Sed-like Document Formatting
Sedmat is a sed-inspired DSL for formatting Google Docs. It uses brace syntax {key=value} as its canonical format, with legacy Markdown shortcuts for convenience.
Full spec: sedmat.org
gog docs sed <DOC_ID> '<expression>' # single expression
gog docs sed <DOC_ID> -f expressions.sed # batch from file
gog docs sed <DOC_ID> -f seed.txt -p # paste seed content
gog docs sed <DOC_ID> '<expr>' --dry-run # preview without applying
echo 's/foo/{b}bar/' | gog docs sed <DOC_ID> # pipe from stdin
gog docs sed <DOC_ID> <<'EOF' # heredoc
s/title/{h=t}My Report/
s/draft/{b c=green}final/
EOF---
Brace Syntax (Canonical)
The brace DSL is the primary way to format text. Braces go before the text by default:
s/text/{b}hello/ # braces before (default)
s/text/hello{b}/ # braces after - same result
s/text/{c=red}warning{b}/ # before and afterBoolean Flags
| Key | Long | Effect |
|---|---|---|
b | bold | Bold |
i | italic | Italic |
_ | underline | Underline |
- | strike | ~~Strikethrough~~ |
# | code | Monospace (Courier New + grey bg) |
^ | sup | Superscript |
, | sub | Subscript |
w | smallcaps | Small Caps |
Negate with !: {!b} removes bold, {!i} removes italic.
s/hello/{b}hello/ # bold
s/world/{i _}world/ # italic + underline
s/note/{b i}note/ # bold + italic
s/draft/{-}draft/ # strikethrough
s/code/{#}code/ # monospace
s/TM/{^}TM/ # superscript
s/H2O/H2O - {,}2/ # subscript
s/Title/{w}Title/ # small caps
s/loud/{!b}loud/ # remove boldKey=Value Properties
| Key | Long | Value | Effect |
|---|---|---|---|
c | color | hex/name | Text color |
z | bg | hex/name | Background/highlight |
f | font | name | Font family |
s | size | pt | Font size |
u | url | URL | Hyperlink |
h | heading | 1-6/t/s | Heading level (t=title, s=subtitle) |
a | align | left/center/right | Paragraph alignment |
l | leading | pt | Line spacing |
n | indent | pt | Indentation |
o | opacity | 0-100 | Text opacity |
k | kerning | pt | Letter spacing |
p | spacing | before,after | Paragraph spacing (pt) |
e | effect | name | Text effect |
x | width | px | Image width |
y | height | px | Image height |
s/error/{c=red}error/ # red text
s/warning/{z=#FFFF00}warning/ # yellow highlight
s/title/{f=Georgia s=24}title/ # Georgia 24pt
s/heading/{h=2}heading/ # Heading 2
s/TITLE/{h=t}TITLE/ # Title style
s/click here/{u=https:\/\/example.com}click here/ # hyperlink
s/para/{a=center}para/ # center align
s/note/{p=12,6}note/ # 12pt before, 6pt after
s/fine/{o=50}fine/ # 50% opacityCombos
Combine any flags and properties in one brace block:
s/heading/{b f=Montserrat s=18}heading/
s/title/{h=3 f=Playfair+Display s=22 c=#333333}title/
s/link/{b i u=https:\/\/example.com}link/Clear Formatting
s/messy/{0}messy/ # strip all formattingBookmarks & Internal Links
s/Chapter 1/{@=ch1}Chapter 1/ # create bookmark anchor
s/see chapter 1/{u=#ch1}see chapter 1/ # link to bookmark---
Structural Commands (Brace)
Breaks
s/PAGEBREAK/{+=p}PAGEBREAK/ # page break
s/COLBREAK/{+=c}COLBREAK/ # column break
s/SECBREAK/{+=s}SECBREAK/ # section breakTables
s/placeholder/{T=4x3}placeholder/ # 4 rows x 3 cols
s/placeholder/{T=4x3:header}placeholder/ # with header rowCheckboxes
s/task/{check}task/ # unchecked checkbox
s/done/{check=y}done/ # checked
s/todo/{check=n}todo/ # explicitly uncheckedImages
s/placeholder/{img=https:\/\/example.com\/photo.jpg}placeholder/
s/placeholder/{img=https:\/\/example.com\/photo.jpg x=400}placeholder/
s/placeholder/{img=https:\/\/example.com\/photo.jpg x=200 y=68}placeholder/---
Legacy Markdown Syntax
Markdown shortcuts are supported for convenience. The brace syntax is preferred.
Headings
s/text/# Heading 1/
s/text/## Heading 2/
s/text/### Heading 3/
s/text/#### Heading 4/
s/text/##### Heading 5/
s/text/###### Heading 6/Inline Styles
s/text/**bold**/
s/text/*italic*/
s/text/***bold italic***/
s/text/~~strikethrough~~/
s/text/`monospace`/
s/text/__underline__/
s/text/^{superscript}/
s/text/~{subscript}/Links & Images
s/text/[link text](https:\/\/example.com)/
s/placeholder//
s/placeholder//Lists
s/text/- bullet item/
s/text/1. numbered item/
s/text/ - nested bullet (2 spaces per level)/
s/text/- [ ] unchecked checkbox/
s/text/- [x] checked checkbox/Blocks
s/text/---/ # horizontal rule
s/text/> blockquote text/Code Blocks
```bash s/text/`\ncode line 1\ncode line 2\n`/ ```
Footnotes
s/text/Some claim[^1]/
s/FOOTNOTE/[^1]: Source citation/Pipe Tables
s/placeholder/| Col A | Col B |\n| data1 | data2 |/---
Sed Commands
Substitution
s/pattern/replacement/ # first match
s/pattern/replacement/g # all matches (global)
s/pattern/replacement/i # case-insensitive
s/pattern/replacement/2 # nth match only
s/pattern/replacement/m # multiline (^/$ match line boundaries)
s/pattern/replacement/gi # combine flagsDelete, Append, Insert, Transliterate
d/pattern/ # delete lines matching pattern
a/pattern/new text/ # append text after matching lines
i/pattern/new text/ # insert text before matching lines
y/abc/xyz/ # transliterate a->x, b->y, c->zBack-references
s/(important)/{b}$1/ # capture + format
s/([A-Z]{2,})/{b}$1/g # bold all caps words
s/"([^"]+)"/{i}$1/g # italicize quoted text
s/hello/{b}&/ # & = whole matchPositional Insert
s/^$/Initial content/ # empty doc only
s/^/Prepended text\n/ # beginning of doc
s/$/\nAppended text/ # end of doc---
Table Operations
Tables are numbered in document order (1-indexed). Use |-1| for last, |*| for all.
Cell References
s/|1|[1,1]/{b}Header/ # row 1, col 1
s/|1|[2,3]/value/ # row 2, col 3
s/|1|[1,*]/{b}&/ # bold entire row (wildcard)
s/|1|[*,2]/data/ # set entire columnAdd Rows & Columns
s/|1|[+1,0]// # append row
s/|1|[0,+1]// # append columnMerge & Split
s/|1|[1,1:1,3]/merge/ # merge cells row1 col1-3
s/|1|[2,2]/split/ # split merged cellDelete Tables
s/|1|// # delete first table
s/|*|// # delete all tables---
Image References
s/!(1)/!(https:\/\/new.png)/ # replace 1st image
s/!(-1)// # delete last image
s/!(*)/!(https:\/\/placeholder.png)/g # replace all images
s/![logo]/!(https:\/\/new-logo.png)/ # match by alt text---
Paragraph Addressing
Target specific paragraphs by number using address prefixes. Use gog docs structure to see paragraph numbers.
# Introspection - see paragraph numbers, types, and content
gog docs structure <DOC_ID> # show numbered structure
gog docs cat <DOC_ID> -N # cat with [N] prefixes
# Delete by paragraph number
gog docs sed <DOC_ID> '5d' # delete paragraph 5
gog docs sed <DOC_ID> '3,7d' # delete paragraphs 3-7
gog docs sed <DOC_ID> '$d' # delete last paragraph
# Substitute within addressed paragraphs
gog docs sed <DOC_ID> '5s/.*/New text/' # replace all text in paragraph 5
gog docs sed <DOC_ID> '3,7s/old/new/g' # replace within paragraphs 3-7
# Insert/Append around addressed paragraphs
gog docs sed <DOC_ID> '5a/New line/' # append after paragraph 5
gog docs sed <DOC_ID> '3i/Before text/' # insert before paragraph 3
gog docs sed <DOC_ID> '$a/Last line/' # append after last paragraphAddress Syntax
| Address | Meaning |
|---|---|
N | Paragraph number N (1-based) |
N,M | Range from paragraph N to M |
$ | Last paragraph |
N,$ | From paragraph N to end |
Multi-Tab Support
gog docs structure <DOC_ID> --tab "Sheet1"
gog docs sed <DOC_ID> --tab "Sheet1" '3d'---
Batch Mode
Create a .sed file with one expression per line. Comments start with #.
# format-doc.sed
s/QQQ_TITLE/{h=t}Report Title/
s/QQQ_AUTHOR/{i c=gray}John Doe/
s/QQQ_DATE/2026-02-22/
# Apply
gog docs sed <DOC_ID> -a <account> -f format-doc.sedSeed + Format Workflow
1. Clear the doc: gog docs clear <DOC_ID> -a <account> 2. Insert seed via positional insert: gog docs sed <DOC_ID> -f seed.sed -a <account> 3. Format it: gog docs sed <DOC_ID> -f format.sed -a <account>
---
Options
| Flag | Effect |
|---|---|
-f <file> | Read expressions from file (batch mode) |
-p | Paste mode (insert file content as text) |
-n / --dry-run | Preview without applying changes |
-a <account> | Google account to use |
---
See Also
gog docs clear- Clear all content from a documentgog docs edit- Simple find/replace without regexgog docs get- Export document contentgog docs images list- List images in document- sedmat.org - Full Sedmat specification
Related skills
How it compares
Use gog-cli for user-delegated Google API access via gogcli; use a service-account skill for unattended server-to-server Google Cloud jobs.
FAQ
What OAuth client type does gog-cli require?
gog-cli requires Google Cloud Desktop app OAuth client credentials exported as client_secret JSON. Enable only the Google APIs needed for the selected gog auth services before authorizing accounts.
How do you verify gogcli authentication?
gog-cli recommends gog auth list --check and gog auth status after gog auth add you@example.com --services gmail,calendar,drive. Use gog auth services to confirm live service names and scopes.
Is Gog Cli safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.