buildoak/fieldwork-skills/google-workspace-ops
Claude Code and agent skill by buildoak/fieldwork-skills
- community
Checking that the SKILL.md file is still in the repository.
Google Workspace CLI automation via gogcli. Gmail, Calendar, Drive, Docs, Slides, Sheets, and 9 more services. JSON-first output, composable pipelines.
Install
npx vskill@latest install buildoak/fieldwork-skills/google-workspace-opsSKILL.md
Google Workspace Ops
Automates Google Workspace work using the gog CLI with machine-parseable JSON output, from email and calendar operations to Drive/docs/sheets workflows. Use it when you need repeatable workspace automation, but avoid it for non-Google services or ad hoc UI workflows.
Terminology used in this file:
- OAuth: Google's delegated login/authorization flow used to grant CLI access without sharing your password.
- GCP: Google Cloud Platform, where you create the project and OAuth credentials.
- RFC3339: Standard date-time format used by Google APIs (for example,
2026-02-18T09:00:00+00:00).
Setup
- Claude Code: copy this skill folder into
.claude/skills/google-workspace-ops/ - Codex CLI: append this SKILL.md content to your project's root
AGENTS.md
For the full installation walkthrough (prerequisites, OAuth setup, verification, troubleshooting), see references/installation-guide.md.
Credential management: GOG_KEYRING_PASSWORD is required for all gog operations using the file-based keyring (headless/SSH environments, or desktop when opting out of system keychain). We strongly recommend managing it via the vault skill -- see references/auth-setup.md for all options including vault, custom secret managers, and plain export.
Staying Updated
This skill ships with an UPDATES.md changelog and UPDATE-GUIDE.md for your AI agent.
After installing, tell your agent: "Check UPDATES.md in the google-workspace-ops skill for any new features or changes."
When updating, tell your agent: "Read UPDATE-GUIDE.md and apply the latest changes from UPDATES.md."
Follow UPDATE-GUIDE.md so customized local files are diffed before any overwrite.
Quick Start
Run one read-only Gmail flow end-to-end:
Use this baseline pattern for automation:
- read/list/search:
--json --no-input - send/create/modify/delete: run
--dry-runfirst, then ask user approval
Decision Tree: When to Use gog
Rule of thumb: if it touches Google Workspace, gog is the right entry point.
Security: Approval Rules
State-modifying operations require explicit user approval before execution.
| Operation Type | Examples | Autonomous? | |
|---|---|---|---|
| Read / List / Search | gmail messages list, drive ls, calendar list, docs cat | YES — run freely | |
| Send / Create | gmail send, docs create, calendar create, drive upload | NO — ask user first | |
| Modify / Update | gmail modify, sheets update, docs write, contacts update | NO — ask user first | |
| Delete / Trash | gmail trash, drive trash, tasks delete | NO — ask user first | |
| Draft | gmail drafts create | YES — drafts are safe, not sent |
The rule is simple: if an action changes workspace state visible to others or is hard to undo, get approval first. Reading is okay.
Automation and scripts should present intent (recipient, subject, summary, account, target IDs) and wait for explicit confirmation before send/modify/delete operations.
Global Flags (All Commands)
Every gog command accepts these flags. Know them -- they control output format and safety.
| Flag | Short | Purpose | When to Use | |
|---|---|---|---|---|
--json | -j | JSON output to stdout | Always for agent use -- structured, parseable | |
--plain | -p | TSV output (no colors) | When piping to awk/cut | |
--results-only | Drop envelope (nextPageToken etc.) | Cleaner JSON for single-page results | ||
--select=FIELDS | Pick only needed fields (dot paths) | Reduce token cost on large responses | ||
--account=EMAIL | -a | Target specific account | Multi-account setups | |
--dry-run | -n | Preview without executing | Always before destructive ops | |
--force | -y | Skip confirmations | Non-interactive pipelines | |
--no-input | Fail instead of prompting | Agent automation (never interactive) | ||
--verbose | -v | Debug logging | Troubleshooting |
Agent-critical pattern: use --json --no-input for automation. JSON keeps automation deterministic. --no-input prevents prompt hangs.
Services Overview
| Service | Command | Aliases | Key Operations | |
|---|---|---|---|---|
| Gmail | gog gmail | mail, email | search, get, send, thread, labels, drafts, batch | |
| Calendar | gog calendar | cal | events, create, search, conflicts, freebusy | |
| Drive | gog drive | drv | ls, search, upload, download, share, mkdir | |
| Docs | gog docs | doc | create, cat, write, insert, find-replace | |
| Slides | gog slides | slide | create, create-from-markdown, export, read-slide | |
| Sheets | gog sheets | sheet | get, update, append, clear, format, metadata | |
| Contacts | gog contacts | contact | search, list, create, update | |
| Tasks | gog tasks | task | lists, list, add, done, update | |
| Chat | gog chat | spaces, messages, threads, dm | ||
| People | gog people | person | me, search, get, relations | |
| Forms | gog forms | form | get, create, responses | |
| Groups | gog groups | group | list, members | |
| Classroom | gog classroom | class | courses, students, coursework, submissions | |
| Apps Script | gog appscript | script | get, content, run, create | |
| Keep | gog keep | list, get, search (Workspace only) |
Top-level shortcuts (save keystrokes):
| Shortcut | Expands To | |
|---|---|---|
gog send | gog gmail send | |
gog ls | gog drive ls | |
gog search | gog drive search | |
gog download | gog drive download | |
gog upload | gog drive upload | |
gog login | gog auth add | |
gog logout | gog auth remove | |
gog status | gog auth status | |
gog me / gog whoami | gog people me |
10x Workflows
These are the highest-leverage patterns. Use these before inventing new scripts.
1. Read and Summarize Recent Emails
2. Send Email (with Safety)
3. Today's Calendar at a Glance
4. Create Calendar Event from Natural Language
5. Search Drive and Get Links
6. Create a Google Doc from Markdown
7. Read a Google Doc as Plain Text
8. Create Slides from Markdown
9. Spreadsheet Operations
10. Multi-Service Pipeline
Output Modes
gog supports three output modes. Choose based on consumer.
| Mode | Flag | Best For | |
|---|---|---|---|
| Human | (default) | Terminal, interactive use, colored tables | |
| JSON | --json | Automation, scripting, jq pipelines | |
| TSV | --plain | awk, cut, spreadsheet import |
For automation: always `--json`. Add --results-only to trim envelopes.
Field selection reduces token use:
Exit Codes
Stable exit codes for automation.
| Code | Name | Meaning | |
|---|---|---|---|
| 0 | ok | Success | |
| 1 | error | General error | |
| 2 | usage | Invalid arguments / bad syntax | |
| 3 | empty_results | No results found (use with --fail-empty) | |
| 4 | auth_required | OAuth token missing or expired | |
| 5 | not_found | Resource not found | |
| 6 | permission_denied | Insufficient permissions | |
| 7 | rate_limited | Google API rate limit hit | |
| 8 | retryable | Transient error, retry is safe | |
| 10 | config | Configuration problem | |
| 130 | cancelled | User cancelled (Ctrl-C) |
Agent error handling pattern:
Multi-Account
gog supports multiple Google accounts. Use -a EMAIL to target a specific account.
Common Gotchas
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/google-workspace-ops/SKILL.md
Popularity
- Repository stars
- 15
- Repository forks
- 1
- 7-day trend score
- 14
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/buildoak/fieldwork-skills/google-workspace-ops)