gog (gogcli) cloud
Fast CLI for Gmail, Calendar, Drive and Google Workspace
gog is a fast, script-friendly CLI for Google Workspace services including Gmail, Calendar, Drive, Docs, Sheets, Slides, Forms, Chat, Tasks, Contacts, and more. It features JSON-first output, multiple account support, and flexible OAuth authentication — making it ideal for automation and AI agent integration.
Features
- Access 15+ Google services from a single CLI
- JSON and TSV output modes for scripting and piping
- Multiple account management with simultaneous access
- Secure credential storage via OS keyring
- Command allowlist for sandboxed agent runs via
--enable-commands
Install
brew: brew install gogcliaur: yay -S gogclisource: git clone https://github.com/steipete/gogcli.git && cd gogcli && make Commands
| Command | Syntax | Description |
|---|---|---|
gmail search | gog gmail search 'query' --max 10 | Search Gmail messages with Gmail query syntax |
calendar events | gog calendar events primary --today | List today's calendar events |
drive search | gog drive search 'query' --max 20 | Search files across Google Drive |
docs cat | gog docs cat <docId> | Read a Google Doc's content as plain text |
sheets get | gog sheets get <spreadsheetId> 'Sheet1!A1:B10' | Read cell values from a Google Sheet |
Links
Agent Usage Example
Use cases:
- Search and read Gmail messages to gather context for tasks
- Check calendar availability and create events for scheduling workflows
- Search and download files from Google Drive for analysis
- Read and update Google Sheets data as a structured data source
- Send Gmail messages or Chat notifications as part of automated pipelines
Example workflow:
gog gmail search 'from:client newer_than:1d' --json --max 5 | jq '.[0].threadId' | xargs -I{} gog gmail thread get {} --include-body