gogcli - Google in your terminal
Overview
gog is a script-friendly CLI for Google services with JSON-first output, multiple accounts, and flexible authentication. This skill is for agents that need to inspect or automate Google Workspace and Gmail workflows safely.
Core areas:
- Gmail: search, read, send, drafts, labels, filters, watch webhooks, tracking
- Calendar: events, invites, team calendars, free/busy, conflicts, special event types
- Drive: list/search/upload/download/share/move/delete, shared drives
- Docs / Slides / Sheets: create, copy, export, update, formatting helpers
- Contacts / People / Tasks
- Chat, Classroom, Forms, Apps Script
- Groups, Admin, Keep in Workspace environments
Installation
See references/installation.md.
Authentication Quick Start
For first-time setup, see references/oauth.md and references/apis.md.
Minimal happy path:
gog auth credentials ~/Downloads/client_secret_*.json
gog auth add you@gmail.com
gog auth list
export GOG_ACCOUNT=you@gmail.com
gog auth status
gog gmail labels list
gog auth status only shows the current/selected account context. To confirm which accounts are authenticated at all, check gog auth list.
Authentication Model
gog supports:
- Multiple accounts via
--account / GOG_ACCOUNT
- Account aliases via
gog auth alias ...
- Multiple OAuth clients via
--client / GOG_CLIENT
- Keyring backends:
auto, keychain, file
- Least-privilege auth with
--readonly, --drive-scope, --gmail-scope
- Workspace service accounts with domain-wide delegation
See details in references/oauth.md.
Workspace service accounts
For Workspace-only flows such as Keep or Admin, verify service-account configuration before acting.
Quick check:
gog --account you@yourdomain.com auth status
See full setup in references/oauth.md.
Output and automation conventions
- Default output is human-readable.
- Use
--json for machine-readable scripting.
- Use
--plain for stable TSV-like output.
- Human hints/progress go to stderr.
- Prefer read-only discovery before mutating commands.
Recommended preflight pattern:
gog auth status --json
gog gmail labels list --json
gog calendar calendars --json
gog drive ls --max 5 --json
Common command patterns
See references/commands.md.
Agent guidance
- First confirm the target account with
gog auth status or explicit --account.
- Use
--json whenever downstream parsing matters.
- Prefer the smallest scope set that can accomplish the task.
- For Workspace-only commands, verify service-account/domain-wide-delegation status first.
- For Gmail watch/tracking flows, verify external webhook URLs and auth before enabling writes.
- Do not assume consumer Gmail accounts can use Chat, Admin, Groups, or Keep service-account flows.
References
1---2name: gogcli3description: Fast, script-friendly CLI for Google services via `gog`. Use this skill whenever the user needs to work with Gmail, Google Calendar, Drive, Docs, Sheets, Slides, Forms, Apps Script, Contacts, Tasks, People, Chat, Classroom, Groups, Admin, or Keep from the terminal, especially for Google Workspace automation, account setup, OAuth/client configuration, service accounts, domain-wide delegation, or JSON/scriptable workflows. Prefer this skill even when the user does not mention `gog` explicitly but is clearly trying to automate or inspect Google services from a CLI or agent workflow.4---56# gogcli - Google in your terminal78## Overview910`gog` is a script-friendly CLI for Google services with JSON-first output, multiple accounts, and flexible authentication. This skill is for agents that need to inspect or automate Google Workspace and Gmail workflows safely.1112Core areas:1314- Gmail: search, read, send, drafts, labels, filters, watch webhooks, tracking15- Calendar: events, invites, team calendars, free/busy, conflicts, special event types16- Drive: list/search/upload/download/share/move/delete, shared drives17- Docs / Slides / Sheets: create, copy, export, update, formatting helpers18- Contacts / People / Tasks19- Chat, Classroom, Forms, Apps Script20- Groups, Admin, Keep in Workspace environments2122## Installation2324See `references/installation.md`.2526## Authentication Quick Start2728For first-time setup, see `references/oauth.md` and `references/apis.md`.2930Minimal happy path:3132```bash33gog auth credentials ~/Downloads/client_secret_*.json34gog auth add you@gmail.com3536gog auth list37export GOG_ACCOUNT=you@gmail.com38gog auth status39gog gmail labels list40```4142`gog auth status` only shows the current/selected account context. To confirm which accounts are authenticated at all, check `gog auth list`.4344## Authentication Model4546`gog` supports:4748- Multiple accounts via `--account` / `GOG_ACCOUNT`49- Account aliases via `gog auth alias ...`50- Multiple OAuth clients via `--client` / `GOG_CLIENT`51- Keyring backends: `auto`, `keychain`, `file`52- Least-privilege auth with `--readonly`, `--drive-scope`, `--gmail-scope`53- Workspace service accounts with domain-wide delegation5455See details in `references/oauth.md`.5657## Workspace service accounts5859For Workspace-only flows such as Keep or Admin, verify service-account configuration before acting.6061Quick check:6263```bash64gog --account you@yourdomain.com auth status65```6667See full setup in `references/oauth.md`.6869## Output and automation conventions7071- Default output is human-readable.72- Use `--json` for machine-readable scripting.73- Use `--plain` for stable TSV-like output.74- Human hints/progress go to stderr.75- Prefer read-only discovery before mutating commands.7677Recommended preflight pattern:7879```bash80gog auth status --json81gog gmail labels list --json82gog calendar calendars --json83gog drive ls --max 5 --json84```8586## Common command patterns8788See `references/commands.md`.8990## Agent guidance9192- First confirm the target account with `gog auth status` or explicit `--account`.93- Use `--json` whenever downstream parsing matters.94- Prefer the smallest scope set that can accomplish the task.95- For Workspace-only commands, verify service-account/domain-wide-delegation status first.96- For Gmail watch/tracking flows, verify external webhook URLs and auth before enabling writes.97- Do not assume consumer Gmail accounts can use Chat, Admin, Groups, or Keep service-account flows.9899## References100101- Upstream repo: https://github.com/steipete/gogcli102- Upstream auth clients doc: https://github.com/steipete/gogcli/blob/main/docs/auth-clients.md103- Upstream Gmail watch doc: https://github.com/steipete/gogcli/blob/main/docs/watch.md104- Local references: `references/installation.md`, `references/oauth.md`, `references/apis.md`, `references/commands.md`, `references/troubleshooting.md`