gogcli
Script-friendly CLI for Gmail, Calendar, Drive, and 12+ Google services
Description
gogcli (gog) is a fast, script-friendly command-line interface for Google Suite services including Gmail, Calendar, Chat, Classroom, Drive, Docs, Slides, Sheets, Forms, Apps Script, Contacts, Tasks, People, Groups, and Keep. It supports OAuth2 and service account authentication, multiple accounts, JSON output for scripting, and least-privilege scoping.
Install
brew install steipete/tap/gogcligit clone https://github.com/steipete/gogcli && cd gogcli && makeAI Summary
Comprehensive CLI for 15+ Google services (Gmail, Calendar, Drive, Sheets, etc.) with JSON output, multi-account support, OAuth2/service-account auth, and least-privilege scoping for scripting and agent workflows.
Capabilities
- + Gmail: search threads/messages, send emails, manage labels, drafts, filters, delegation, and vacation settings
- + Calendar: list/create/update events, detect conflicts, manage invitations
- + Drive: list/search/upload/download files, manage permissions and comments
- + Sheets: read/write/update spreadsheets, insert rows/columns, format cells
- + Docs/Slides: export to PDF, DOCX, PPTX
- + Tasks: manage tasklists with repeat schedules, create/update/complete tasks
- + Contacts: search/create/update contacts, access Workspace directory
- + Chat: list/find/create spaces, send messages and DMs (Workspace only)
- + Forms, Apps Script, Classroom, Groups, Keep support
- + Multi-account management with aliases and command allowlists for sandboxed runs
- + JSON-first output for scripting, TSV for piping, human-friendly tables by default
Use When
- → Automating Google Workspace operations from scripts or AI agents
- → Searching and managing Gmail from the command line
- → Creating or querying Google Calendar events programmatically
- → Uploading/downloading files from Google Drive in batch
- → Reading or writing Google Sheets data in automation pipelines
Avoid When
- x Working with non-Google cloud services
- x Simple file sharing tasks that Google Drive web UI handles more easily
- x Tasks requiring Google APIs not yet supported by gogcli
Usage Patterns
List Gmail labels
gog gmail labels list Lists all Gmail labels for the configured account
Search Gmail
gog gmail search "from:boss subject:urgent" --json Searches Gmail with standard query syntax and outputs JSON
List today's calendar events
gog calendar events list --json Lists calendar events in JSON format
Upload a file to Drive
gog drive upload ./report.pdf --parent FOLDER_ID Uploads a local file to a specific Google Drive folder
Read a spreadsheet
gog sheets read SPREADSHEET_ID "Sheet1!A1:D10" --json Reads a range from a Google Sheet and outputs JSON
Input / Output
0 Success 1 Error Typical Pipelines
gog gmail search "is:unread" --json | jq ".[].subject" gog calendar events list --json | jq '.[] | select(.date == "today")' gog drive list --json | jq '.[] | select(.mimeType | contains("pdf"))'