[BREAKGLASS] Google Suite CLI: Gmail, GCal, GDrive, GContacts. https://gogcli.sh/
Go to file
2025-12-12 14:53:44 +00:00
.github/workflows CI: run make lint (pinned tool) 2025-12-12 14:26:30 +00:00
cmd/gog Unify Google CLI with auth, services, and CI 2025-12-12 14:18:38 +00:00
docs People API: per-endpoint scopes + other contacts scope 2025-12-12 14:44:40 +00:00
internal Directory People: add sources + request timeout 2025-12-12 14:53:44 +00:00
scripts Add pnpm gog build+run shortcut 2025-12-12 14:24:29 +00:00
.gitignore Add pnpm gog build+run shortcut 2025-12-12 14:24:29 +00:00
.golangci.yml Unify Google CLI with auth, services, and CI 2025-12-12 14:18:38 +00:00
go.mod Unify Google CLI with auth, services, and CI 2025-12-12 14:18:38 +00:00
go.sum Unify Google CLI with auth, services, and CI 2025-12-12 14:18:38 +00:00
LICENSE Initial commit 2025-12-12 12:36:45 +00:00
Makefile Unify Google CLI with auth, services, and CI 2025-12-12 14:18:38 +00:00
package.json Add pnpm gog build+run shortcut 2025-12-12 14:24:29 +00:00
README.md Document pnpm -s for clean stdout 2025-12-12 14:24:57 +00:00

gogcli

Minimal Google (Gmail/Calendar/Drive/Contacts) CLI in Go.

Setup

  1. Create OAuth credentials in Google Cloud Console (Desktop app) and enable the APIs you need.
  2. Store credentials:
    • gog auth credentials ~/path/to/credentials.json
  3. Authorize (stores a refresh token in Keychain via keyring):
    • gog auth add you@gmail.com (default: all services)
    • or: gog auth add you@gmail.com --services drive,calendar

Most API commands require --account you@gmail.com.

Output

  • --output=text writes plain text to stdout (designed to be script-friendly).
  • --output=json writes JSON to stdout (best for scripting).
  • Human-facing hints/progress go to stderr.

Environment

  • GOG_ACCOUNT=you@gmail.com (used if --account is omitted)
  • GOG_COLOR=auto|always|never (default auto)
  • GOG_OUTPUT=text|json (default text)

Integration tests (local only)

Run smoke tests against real APIs (not in CI):

  • GOG_IT_ACCOUNT=you@gmail.com go test -tags=integration ./internal/integration

Development

  • Format: make fmt
  • Lint: make lint
  • Test: make test

pnpm shortcut

If you use pnpm, you can build+run in one step:

  • pnpm gog auth add you@gmail.com

If you want clean stdout for scripting, use pnpms silent mode:

  • pnpm -s gog --output=json gmail search "from:me" | jq .