[BREAKGLASS] Google Suite CLI: Gmail, GCal, GDrive, GContacts.
https://gogcli.sh/
| .github/workflows | ||
| cmd/gog | ||
| docs | ||
| internal | ||
| scripts | ||
| .gitignore | ||
| .golangci.yml | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| Makefile | ||
| package.json | ||
| README.md | ||
gogcli
Minimal Google (Gmail/Calendar/Drive/Contacts) CLI in Go.
Setup
- Create OAuth credentials in Google Cloud Console (Desktop app) and enable the APIs you need.
- Store credentials:
gog auth credentials ~/path/to/credentials.json
- 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=textwrites plain text to stdout (designed to be script-friendly).--output=jsonwrites JSON to stdout (best for scripting).- Human-facing hints/progress go to stderr.
Environment
GOG_ACCOUNT=you@gmail.com(used if--accountis omitted)GOG_COLOR=auto|always|never(defaultauto)GOG_OUTPUT=text|json(defaulttext)
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 pnpm’s silent mode:
pnpm -s gog --output=json gmail search "from:me" | jq .