name: gog description: Google Workspace CLI for Gmail, Calendar, Drive, Contacts, Sheets, and Docs license: MIT compatibility: opencode metadata: audience: developers workflow: automation platform: macos, linux homepage: https://gogcli.sh install: - kind: brew formula: steipete/tap/gogcli bins: [gog]
What I do
Control Gmail, Calendar, Drive, Contacts, Sheets, and Docs from the command line using gog.
Installation
brew install steipete/tap/gogcli
Setup (one-time)
# Authenticate with OAuth
gog auth credentials /path/to/client_secret.json
# Add account with services
gog auth add you@gmail.com --services gmail,calendar,drive,contacts,sheets,docs
# List accounts
gog auth list
Environment
# Set default account to avoid --account flag
export GOG_ACCOUNT=you@gmail.com
Gmail
Search emails
gog gmail search 'newer_than:7d' --max 10
gog gmail search 'from:boss@company.com is:unread' --max 20
Send email
gog gmail send --to a@b.com --subject "Hi" --body "Hello"
Calendar
List events
gog calendar events <calendarId> --from 2024-01-01 --to 2024-01-31
Drive
Search files
gog drive search "query" --max 10
gog drive search "name contains 'report' and modifiedTime > '2024-01-01'"
Contacts
gog contacts list --max 20
Sheets
Get values
gog sheets get <sheetId> "Tab!A1:D10" --json
Update values
gog sheets update <sheetId> "Tab!A1:B2" --values-json '[["A","B"],["1","2"]]' --input USER_ENTERED
Append rows
gog sheets append <sheetId> "Tab!A:C" --values-json '[["x","y","z"]]' --insert INSERT_ROWS
Clear cells
gog sheets clear <sheetId> "Tab!A2:Z"
Get metadata
gog sheets metadata <sheetId> --json
Docs
Export
gog docs export <docId> --format txt --out /tmp/doc.txt
Cat (print contents)
gog docs cat <docId>
Tips
- Confirm before sending emails or creating events
- Use
--jsonfor scripting-friendly output - Use
--no-inputto skip confirmations in scripts - Sheets values: use
--values-jsonfor complex data - Docs: supports export/cat/copy only - in-place edits need Docs API client