buildoak/fieldwork-skills/google-workspace-ops

Claude Code and agent skill by buildoak/fieldwork-skills

Trust tier 3
  • community
Source check pending

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-ops

SKILL.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

bash
brew tap steipete/tap
brew install gogcli
gog login YOUR_EMAIL --services all
  • 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:

bash
gog auth status
gog gmail search "is:unread" --max 5 --json --no-input
gog gmail thread get THREAD_ID --json --no-input

Use this baseline pattern for automation:

  • read/list/search: --json --no-input
  • send/create/modify/delete: run --dry-run first, then ask user approval

Decision Tree: When to Use gog

text
Need to interact with Google Workspace?
|
+-- Is it email? (read, search, send, labels, drafts)
| YES --> gog gmail ...
|
+-- Is it calendar? (events, create, conflicts, freebusy)
| YES --> gog calendar ...
|
+-- Is it files? (search, upload, download, share)
| YES --> gog drive ...
|
+-- Is it document editing? (create, read, write Google Docs)
| YES --> gog docs ...
|
+-- Is it presentations? (create from markdown, export)
| YES --> gog slides ...
|
+-- Is it spreadsheets? (read cells, update, append)
| YES --> gog sheets ...
|
+-- Is it people? (contacts, directory search, tasks)
YES --> gog contacts / gog tasks / gog people ...

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 TypeExamplesAutonomous?
Read / List / Searchgmail messages list, drive ls, calendar list, docs catYES — run freely
Send / Creategmail send, docs create, calendar create, drive uploadNO — ask user first
Modify / Updategmail modify, sheets update, docs write, contacts updateNO — ask user first
Delete / Trashgmail trash, drive trash, tasks deleteNO — ask user first
Draftgmail drafts createYES — 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.

FlagShortPurposeWhen to Use
--json-jJSON output to stdoutAlways for agent use -- structured, parseable
--plain-pTSV output (no colors)When piping to awk/cut
--results-onlyDrop envelope (nextPageToken etc.)Cleaner JSON for single-page results
--select=FIELDSPick only needed fields (dot paths)Reduce token cost on large responses
--account=EMAIL-aTarget specific accountMulti-account setups
--dry-run-nPreview without executingAlways before destructive ops
--force-ySkip confirmationsNon-interactive pipelines
--no-inputFail instead of promptingAgent automation (never interactive)
--verbose-vDebug loggingTroubleshooting

Agent-critical pattern: use --json --no-input for automation. JSON keeps automation deterministic. --no-input prevents prompt hangs.

Services Overview

ServiceCommandAliasesKey Operations
Gmailgog gmailmail, emailsearch, get, send, thread, labels, drafts, batch
Calendargog calendarcalevents, create, search, conflicts, freebusy
Drivegog drivedrvls, search, upload, download, share, mkdir
Docsgog docsdoccreate, cat, write, insert, find-replace
Slidesgog slidesslidecreate, create-from-markdown, export, read-slide
Sheetsgog sheetssheetget, update, append, clear, format, metadata
Contactsgog contactscontactsearch, list, create, update
Tasksgog taskstasklists, list, add, done, update
Chatgog chatspaces, messages, threads, dm
Peoplegog peoplepersonme, search, get, relations
Formsgog formsformget, create, responses
Groupsgog groupsgrouplist, members
Classroomgog classroomclasscourses, students, coursework, submissions
Apps Scriptgog appscriptscriptget, content, run, create
Keepgog keeplist, get, search (Workspace only)

Top-level shortcuts (save keystrokes):

ShortcutExpands To
gog sendgog gmail send
gog lsgog drive ls
gog searchgog drive search
gog downloadgog drive download
gog uploadgog drive upload
gog logingog auth add
gog logoutgog auth remove
gog statusgog auth status
gog me / gog whoamigog people me

10x Workflows

These are the highest-leverage patterns. Use these before inventing new scripts.

1. Read and Summarize Recent Emails
bash
# Get last 5 unread emails with full content
gog gmail search "is:unread" --max 5 --json | jq '.[].messages[0] | {subject: .subject, from: .from, snippet: .snippet}'
# Get a specific thread with all messages
gog gmail thread get THREAD_ID --json
2. Send Email (with Safety)
bash
# Preview first (dry-run)
gog send --to "person@example.com" --subject "Meeting notes" --body "Here are the notes..." --dry-run
# Then send
gog send --to "person@example.com" --subject "Meeting notes" --body "Here are the notes..." --no-input
3. Today's Calendar at a Glance
bash
# Today's events across all calendars
gog cal events --today --all --json
# This week
gog cal events --week --json
# Next 3 days
gog cal events --days 3 --json
4. Create Calendar Event from Natural Language
bash
# The agent translates natural language to RFC3339 times
gog cal create primary \
--summary "Team standup" \
--from "2026-02-18T09:00:00+00:00" \
--to "2026-02-18T09:30:00+00:00" \
--description "Daily sync" \
--with-meet \
--json
5. Search Drive and Get Links
bash
# Full-text search
gog search "quarterly report" --max 5 --json | jq '.[].webViewLink'
# List files in a folder
gog ls --parent FOLDER_ID --json
6. Create a Google Doc from Markdown
bash
# Create doc with markdown content
gog docs create "Meeting Notes 2026-02-17" --file notes.md --json
# Or write markdown to existing doc
gog docs write DOC_ID --file notes.md --replace --markdown
7. Read a Google Doc as Plain Text
bash
# Dump doc as text (great for agent consumption)
gog docs cat DOC_ID
# Read specific tab
gog docs cat DOC_ID --tab "Notes"
# All tabs
gog docs cat DOC_ID --all-tabs
8. Create Slides from Markdown
bash
# One command: markdown -> Google Slides
gog slides create-from-markdown "Q1 Review" --content-file presentation.md --json
9. Spreadsheet Operations
bash
# Read a range
gog sheets get SHEET_ID "Sheet1!A1:D10" --json
# Append a row
gog sheets append SHEET_ID "Sheet1!A:D" "value1" "value2" "value3" "value4"
# Update specific cells
gog sheets update SHEET_ID "Sheet1!B2" "new value"
10. Multi-Service Pipeline
bash
# Find a doc, read it, email a summary
DOC_ID=$(gog search "project brief" --max 1 --json | jq -r '.[0].id')
CONTENT=$(gog docs cat "$DOC_ID")
gog send --to "team@example.com" --subject "Project Brief Summary" --body "$CONTENT" --no-input

Output Modes

gog supports three output modes. Choose based on consumer.

ModeFlagBest For
Human(default)Terminal, interactive use, colored tables
JSON--jsonAutomation, scripting, jq pipelines
TSV--plainawk, cut, spreadsheet import

For automation: always `--json`. Add --results-only to trim envelopes.

Field selection reduces token use:

bash
# Only get subject and date from emails
gog gmail search "is:unread" --json --select "subject,date,from"

Exit Codes

Stable exit codes for automation.

CodeNameMeaning
0okSuccess
1errorGeneral error
2usageInvalid arguments / bad syntax
3empty_resultsNo results found (use with --fail-empty)
4auth_requiredOAuth token missing or expired
5not_foundResource not found
6permission_deniedInsufficient permissions
7rate_limitedGoogle API rate limit hit
8retryableTransient error, retry is safe
10configConfiguration problem
130cancelledUser cancelled (Ctrl-C)

Agent error handling pattern:

bash
gog gmail search "is:unread" --json --fail-empty
EXIT=$?
if [ $EXIT -eq 3 ]; then echo "No unread emails"; fi
if [ $EXIT -eq 4 ]; then echo "Auth expired -- run: gog login EMAIL"; fi
if [ $EXIT -eq 7 ]; then sleep 5 && retry; fi

Multi-Account

gog supports multiple Google accounts. Use -a EMAIL to target a specific account.

bash
# List authenticated accounts
gog auth list
# Target specific account
gog gmail search "is:unread" -a work@company.com --json
gog cal events --today -a personal@gmail.com --json
# Set default account
gog config set default_account work@company.com

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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/buildoak/fieldwork-skills/google-workspace-ops/badge)](https://verified-skill.com/skills/buildoak/fieldwork-skills/google-workspace-ops)

Something wrong with this skill or its page? Tell us.