1---2name: google-workspace3description: Google Workspace via gog CLI — Gmail, Calendar, Drive, Contacts, Sheets, and Docs. Use when: the user asks to send/search Gmail, check calendar, manage Drive files, read or edit Sheets, export Docs, or look up contacts. NOT for: Google Cloud APIs, Firebase, or services outside Workspace.4---5# Google Workspace (gog CLI)67Powered by [gog](https://github.com/steipete/gogcli) — a Google Workspace CLI for Gmail, Calendar, Drive, Contacts, Sheets, and Docs.89## When to Use1011- [ ] Search Gmail, send email, read or manage messages12- [ ] List or create calendar events13- [ ] Search, list, or download Drive files14- [ ] Read or edit Google Sheets (get, append, update, clear)15- [ ] Export or read Google Docs content16- [ ] List or search Contacts1718## When NOT to Use1920- [ ] Google Cloud Platform APIs (compute, storage, etc.)21- [ ] Firebase or other non-Workspace services22- [ ] Tasks that don't involve Gmail, Calendar, Drive, Sheets, Docs, or Contacts23- [ ] In-place editing of Google Docs (gog supports read/export only)2425## Setup26271. Install gog:28 ```bash29 brew install steipete/tap/gogcli30 ```31322. Create OAuth credentials at [Google Cloud Console](https://console.cloud.google.com/apis/credentials) (Desktop App), download `client_secret.json`.33343. Authenticate:35 ```bash36 gog auth credentials /path/to/client_secret.json37 gog auth add you@gmail.com --services gmail,calendar,drive,contacts,sheets,docs38 ```39404. Optionally set `GOG_ACCOUNT=you@gmail.com` to skip `--account` on each call.4142## Usage/Commands4344### Gmail4546| Action | Command |47|--------|---------|48| Search mail | `gog gmail search 'newer_than:7d' --max 10` |49| Send email | `gog gmail send --to user@example.com --subject "Hi" --body "Hello"` |50| Read message | `gog gmail read <message_id>` |51| Mark as read | `gog gmail labels modify <message_id> --remove UNREAD` |52| List labels | `gog gmail labels list` |5354### Calendar5556| Action | Command |57|--------|---------|58| List events | `gog calendar events --from 2026-02-23 --to 2026-02-28` |59| Create event | `gog calendar create --title "Meeting" --start "2026-02-24T10:00" --end "2026-02-24T11:00"` |6061### Drive6263| Action | Command |64|--------|---------|65| Search files | `gog drive search "query" --max 10` |66| List files | `gog drive list --max 20` |67| Download | `gog drive download <file_id> --out /tmp/file.pdf` |6869### Google Sheets7071| Action | Command |72|--------|---------|73| Get data | `gog sheets get <spreadsheet_id> "Sheet1!A1:D10" --json` |74| Metadata | `gog sheets metadata <spreadsheet_id> --json` |75| Append rows | `gog sheets append <spreadsheet_id> "Sheet1!A:C" --values-json '[["x","y","z"]]'` |76| Update cells | `gog sheets update <spreadsheet_id> "Sheet1!A1:B2" --values-json '[["A","B"],["1","2"]]'` |77| Clear range | `gog sheets clear <spreadsheet_id> "Sheet1!A2:Z"` |7879### Google Docs8081| Action | Command |82|--------|---------|83| Read content | `gog docs cat <document_id>` |84| Export | `gog docs export <document_id> --format txt --out /tmp/doc.txt` |85| Copy | `gog docs copy <document_id> --title "Copy of Doc"` |8687### Contacts8889| Action | Command |90|--------|---------|91| List contacts | `gog contacts list --max 20` |92| Search | `gog contacts search "name"` |9394## Notes9596- **Always confirm** before sending emails or creating calendar events97- For automation, use `--json` and `--no-input` flags98- Set `GOG_ACCOUNT` env var to skip `--account` on every command99- Use `gog auth list` to check configured accounts