home / skills / steveclarke / dotfiles / gog-cli

gog-cli skill

/ai/skills/gog-cli

This skill lets you manage Google Workspace via command line, enabling Gmail, Calendar, Drive, Sheets, Docs, Contacts, Tasks, and more.

npx playbooks add skill steveclarke/dotfiles --skill gog-cli

Review the files below or copy the command above to add this skill to your agents.

Files (10)
SKILL.md
2.4 KB
---
name: gog-cli
description: Interact with Google Workspace services via command line using gog-cli. Use when user wants to work with Gmail (search, send, labels, filters), Calendar (events, scheduling, availability), Drive (upload, download, share), Sheets (read, write, format), Docs/Slides (create, export), Contacts, Tasks, Chat, or Classroom. Triggers on "Google", "Gmail", "Calendar", "Drive", "Sheets", "Docs", "Slides", "Contacts", "Tasks", "Google Chat", "Classroom", or any gog command.
---

# gog-cli - Google Workspace CLI

Command-line tool for interacting with Google Workspace services.

## Service References

Load only the reference file for the service you need:

- **Email operations** - See [references/gmail.md](references/gmail.md)
- **Calendar & scheduling** - See [references/calendar.md](references/calendar.md)
- **File storage** - See [references/drive.md](references/drive.md)
- **Spreadsheets** - See [references/sheets.md](references/sheets.md)
- **Documents & presentations** - See [references/docs-slides.md](references/docs-slides.md)
- **Contact management** - See [references/contacts.md](references/contacts.md)
- **Task lists** - See [references/tasks.md](references/tasks.md)
- **Team messaging** - See [references/chat.md](references/chat.md)
- **Education/courses** - See [references/classroom.md](references/classroom.md)

## Global Options

Apply to any command:

| Option | Description |
|--------|-------------|
| `--account <email\|alias>` | Specify account to use |
| `--json` | Machine-readable JSON output |
| `--plain` | Tab-separated plaintext |
| `--force` | Skip confirmation prompts |
| `--no-input` | Fail rather than prompt (CI-friendly) |
| `--verbose` | Show API requests/responses |

## Quick Examples

```bash
# Gmail: search recent emails
gog gmail search 'newer_than:7d' --max 10

# Calendar: today's events
gog calendar events primary --today

# Drive: list files
gog drive ls --max 20

# Sheets: read cells
gog sheets get <spreadsheetId> 'Sheet1!A1:B10'

# Tasks: list task lists
gog tasks lists
```

## Utility Commands

```bash
# Current time
gog time now
gog time now --timezone America/New_York

# Auth status
gog auth list --check
gog auth status
```

## Tips

- Use `--json` for scripting and piping to jq
- Most IDs can be found in Google URLs (e.g., spreadsheet ID in sheets URL)
- Gmail search uses Google's search syntax (from:, to:, subject:, newer_than:, etc.)
- Calendar accepts "primary" as calendarId for main calendar

Overview

This skill provides a command-line interface to interact with Google Workspace services using gog-cli. It consolidates Gmail, Calendar, Drive, Sheets, Docs, Slides, Contacts, Tasks, Chat, and Classroom operations into simple terminal commands. Use it to automate, script, and integrate Google Workspace workflows across machines.

How this skill works

gog-cli exposes subcommands for each Google service (gmail, calendar, drive, sheets, docs-slides, contacts, tasks, chat, classroom) and global options for account selection, output format, and verbosity. Each service loads a small reference file with the available actions and arguments; commands return plain text or machine-readable JSON for pipelines. Utilities include time and auth helpers for CI and multi-account setups.

When to use it

  • Automating email searches, sends, label and filter management from scripts
  • Scheduling events, checking availability, and exporting calendar data from the terminal
  • Uploading, downloading, listing, and sharing Drive files in automated workflows
  • Reading/writing spreadsheet ranges and exporting data for batch processing
  • Creating or exporting Docs and Slides, or managing Classroom and Chat resources
  • Integrating Google actions into CI/CD, cron jobs, or cross-device sync scripts

Best practices

  • Use --json for scripting and pipe to jq or other parsers for reliable automation
  • Specify --account when working with multiple Google identities to avoid accidental actions
  • Use --no-input in CI jobs to fail fast instead of waiting for prompts
  • Use --verbose only when debugging to avoid logging sensitive data
  • Keep IDs (file, spreadsheet, calendar) in environment variables or config to simplify repeatable commands

Example use cases

  • Search recent Gmail messages and export metadata as JSON for analytics
  • Create a calendar event from a script that checks participant availability before booking
  • Batch upload a folder to Drive and set sharing permissions for a team
  • Extract a range from a spreadsheet and convert it to CSV for downstream processing
  • Generate a slide deck from templates and export PDFs as part of a reporting pipeline
  • List task lists and sync items with a local todo app

FAQ

How do I script commands reliably across machines?

Use --json for machine-readable output, store service IDs in environment variables, and include --account and --no-input in CI to ensure consistent behavior.

Can I run gog-cli in CI or headless servers?

Yes. Use --no-input to fail rather than prompt, and configure OAuth or service account credentials beforehand so commands can run unattended.