Google Workspace (gog)
Google Workspace CLI for Gmail, Calendar, Drive, Contacts, Sheets, and Docs. Full OAuth-based access to Google services.
Tags: google, gmail, calendar, drive, sheets, productivity
Category: Productivity
Use Cases
- Morning email briefing: check unread emails via OpenClaw heartbeat
- Calendar conflict detection before scheduling meetings
- Automated report generation: create Sheets/Docs from data
- Send emails with AI-generated content
- Upload files to Drive as part of automation workflows
- Manage contacts: add people you meet to Google Contacts from chat
- Task management: create and complete Google Tasks from the terminal
- Export data: download Docs as Markdown, Sheets as CSV
Tips
- Set `GOG_ACCOUNT=you@gmail.com` as an env var to avoid typing `--account` every time
- Use `gog auth manage` to set a default account for all commands
- Use `--readonly` for read-only access when you don't need write permissions
- Combine with OpenClaw cron for automated email summaries and calendar checks
- Use `--json` output with jq for all automation workflows
- Re-auth with `--force-consent` if you add new scopes and Google doesn't return a refresh token
- For headless servers, use `gog auth add --manual` for a copy-paste auth flow
- Use an established Google account — don't create new accounts just for API access
Known Issues & Gotchas
- Requires Google Cloud OAuth2 credentials setup — follow the quickstart carefully
- Brand-new Google accounts with immediate API activity may get suspended by Google's bot detection
- OAuth consent screen starts in 'testing' mode — limited to 100 users until published
- Keep commands require Workspace admin + domain-wide delegation (not available for personal accounts)
- Some features (Chat, Admin, Groups) are Workspace-only — won't work with personal Gmail
- Token refresh happens automatically but initial auth requires a browser flow
- Rate limits vary by Google API — Gmail is 250 quota units/user/second
- Email tracking feature requires deploying a Cloudflare Worker backend
Alternatives
- Google Workspace CLI (official)
- himalaya (email)
- gcalcli
- rclone (Drive)
- Google Apps Script
Community Feedback
OpenClaw + GogCLI = Google Account Suspension. A brand-new account followed almost immediately by API activation and automated interactions could easily look suspicious from Google's perspective. Use an established account.
— Reddit r/openclaw
The gogcli tool developed by the OpenClaw team is incredible — Gmail, Calendar, Drive, Contacts, Tasks under one CLI with JSON output. Perfect for agent automation.
— Twitter/X
Google is working to give OpenClaw easier access to Google Workspace. The gogcli tool has become the de facto CLI interface for Gmail, Calendar, and Drive automation.
— Android Authority
Released gog: A CLI for Gmail, Calendar, Drive, Contacts, and more. JSON-first, multi-account, flexible auth. Google in your terminal.
— Twitter/X (Peter Friese)
Configuration Examples
Initial setup
# Install
brew install gogcli
# Store OAuth credentials
gog auth credentials ~/Downloads/client_secret_....json
# Authorize your account
gog auth add you@gmail.com
# Set default account
export GOG_ACCOUNT=you@gmail.comGmail operations
# Search recent emails
gog gmail search 'newer_than:1d is:unread' --max 10 --json | jq
# Send an email
gog gmail send --to 'colleague@example.com' --subject 'Meeting notes' --body 'Here are the notes from today...'
# List labels
gog gmail labels listCalendar management
# Today's events
gog calendar events --max 10 --json | jq '.events[] | {summary, start, end}'
# Check free/busy
gog calendar free-busy --start tomorrow --end 'tomorrow 18:00'
# Create an event
gog calendar events create --summary 'Team standup' --start '2026-03-22T09:00:00' --end '2026-03-22T09:30:00'Drive and Docs
# List recent files
gog drive ls --max 10 --json | jq '.files[] | {name, mimeType}'
# Upload a file
gog drive upload ./report.pdf --folder 'Reports'
# Export a Doc as Markdown
gog docs export <doc-id> --format markdown -o report.mdInstallation
brew install steipete/tap/gogcliHomepage: https://gogcli.sh
Source: bundled