gog-advanced
Use gog (gogcli) for Google Workspace: Gmail, Calendar, Drive, Contacts, Sheets, Docs.
This skill is optimized for agent reliability:
- Prefer list/inspect first, don’t assume resource IDs.
- Prefer
--json for parsing; treat human tables as fallback.
- For “agenda / today / tomorrow / this week” questions: search across ALL calendars by default.
- For write actions (send email, create/update events, modify Drive/Sheets/Docs): confirm intent and summarize the exact action first.
Prereqs / Setup (once)
- Store OAuth client credentials:
gog auth credentials /path/to/client_secret.json
- Add an account (request only needed services):
gog auth add you@gmail.com --services gmail,calendar,drive,contacts,sheets,docs
- Make account default to avoid repeating flags:
export GOG_ACCOUNT=you@gmail.com
Notes:
- CLI help is discoverable:
gog --help, gog calendar --help, etc.
gog supports multiple accounts; use --account or GOG_ACCOUNT. (Prefer env var.)
Global agent rules (non-negotiable)
Calendar agenda queries
- If user asks “what’s on my calendar today / tomorrow / this week / next N days”:
- Run:
gog calendar events --all --today|--tomorrow|--week|--days N --json
- If results are empty, only then troubleshoot (timezone, account, auth status).
- Only use a specific calendarId if the user explicitly asks for a specific calendar or name.
Calendar identification
- If you need a calendarId (because the user wants a specific calendar):
- Run:
gog calendar calendars --json
- Match by calendar name/summary and then query that calendarId.
Timezone
- For date-scoped queries, be explicit with
--today/--tomorrow/--week/--days when possible.
- If user’s timezone matters or results look off, check with:
gog calendar time --timezone <IANA_TZ>
- Prefer returning times in user-local timezone if JSON includes localized fields.
Writes require confirmation
- Before:
gog gmail send ...
gog calendar create ...
gog calendar update ...
- any Sheets update/append/clear
- Do a “plan” message: recipients/calendar, subject/summary, time range, and ask for “yes”.
High-signal command recipes
Calendar: “What’s on my calendar today?”
Default: all calendars.
gog calendar events --all --today --json
Tomorrow / week / next 3 days:
gog calendar events --all --tomorrow --json
gog calendar events --all --week --json
gog calendar events --all --days 3 --json
Search events across time window (keyword):
gog calendar search "standup" --days 30 --json
gog calendar search "meeting" --from 2026-02-01T00:00:00Z --to 2026-03-01T00:00:00Z --max 50 --json
Specific calendar (only when asked):
- Find calendarId:
gog calendar calendars --json
- Query it:
gog calendar events <calendarId> --today --json
Gmail: search + read + send (confirm sends)
Search:
gog gmail search 'newer_than:7d' --max 10 --json
gog gmail search 'from:boss@example.com newer_than:30d' --max 20 --json
Send (REQUIRES CONFIRMATION FIRST):
gog gmail send --to a@b.com --subject "Hi" --body "Hello"
Drive: find files
gog drive search "invoice" --max 10 --json
Contacts: list/search
gog contacts list --max 50 --json
Sheets: safe read/write (confirm writes)
Read:
gog sheets get <sheetId> "Tab!A1:D10" --json
Update (REQUIRES CONFIRMATION FIRST):
gog sheets update <sheetId> "Tab!A1:B2" --values-json '[["A","B"],["1","2"]]' --input USER_ENTERED
Append (REQUIRES CONFIRMATION FIRST):
gog sheets append <sheetId> "Tab!A:C" --values-json '[["x","y","z"]]' --insert INSERT_ROWS
Clear (REQUIRES CONFIRMATION FIRST):
gog sheets clear <sheetId> "Tab!A2:Z"
Docs: export/cat
gog docs export <docId> --format txt --out /tmp/doc.txt
gog docs cat <docId>
Troubleshooting checklist (fast)
If calendar results look wrong or empty:
- Confirm account:
- List calendars to confirm visibility:
gog calendar calendars --json
- Ensure you used all-calendars for agenda:
gog calendar events --all --today --json
- If still empty, verify timezone assumptions:
gog calendar time --timezone <IANA_TZ>
1---
2name: gog-advanced
3description: Reliable Google Workspace CLI skill (gogcli). Defaults to all-calendars for agenda queries; JSON-first; safe writes.
4metadata:
5 source: https://skillmd.com/skills/modbender/gog-advanced
6 clawdbot:
7 emoji: 🗂️
8 requires:
9 bins:
10 - gog
11 install:
12 - id: brew
13 kind: brew
14 formula: steipete/tap/gogcli
15 bins:
16 - gog
17 label: Install gogcli (brew)
18---
19
20# gog-advanced
21
22Use `gog` (gogcli) for Google Workspace: Gmail, Calendar, Drive, Contacts, Sheets, Docs.
23
24This skill is optimized for **agent reliability**:
25- Prefer **list/inspect first**, don’t assume resource IDs.
26- Prefer **`--json`** for parsing; treat human tables as fallback.
27- For “agenda / today / tomorrow / this week” questions: **search across ALL calendars by default**.
28- For write actions (send email, create/update events, modify Drive/Sheets/Docs): **confirm intent** and summarize the exact action first.
29
30## Prereqs / Setup (once)
31
321) Store OAuth client credentials:
33- `gog auth credentials /path/to/client_secret.json`
34
352) Add an account (request only needed services):
36- `gog auth add you@gmail.com --services gmail,calendar,drive,contacts,sheets,docs`
37
383) Make account default to avoid repeating flags:
39- `export GOG_ACCOUNT=you@gmail.com`
40
41Notes:
42- CLI help is discoverable: `gog --help`, `gog calendar --help`, etc.
43- `gog` supports multiple accounts; use `--account` or `GOG_ACCOUNT`. (Prefer env var.)
44
45## Global agent rules (non-negotiable)
46
471) **Calendar agenda queries**
48 - If user asks “what’s on my calendar today / tomorrow / this week / next N days”:
49 - Run: `gog calendar events --all --today|--tomorrow|--week|--days N --json`
50 - If results are empty, only then troubleshoot (timezone, account, auth status).
51 - Only use a specific calendarId if the user explicitly asks for a specific calendar or name.
52
532) **Calendar identification**
54 - If you need a calendarId (because the user wants a specific calendar):
55 - Run: `gog calendar calendars --json`
56 - Match by calendar name/summary and then query that calendarId.
57
583) **Timezone**
59 - For date-scoped queries, be explicit with `--today/--tomorrow/--week/--days` when possible.
60 - If user’s timezone matters or results look off, check with:
61 - `gog calendar time --timezone <IANA_TZ>`
62 - Prefer returning times in user-local timezone if JSON includes localized fields.
63
644) **Writes require confirmation**
65 - Before:
66 - `gog gmail send ...`
67 - `gog calendar create ...`
68 - `gog calendar update ...`
69 - any Sheets update/append/clear
70 - Do a “plan” message: recipients/calendar, subject/summary, time range, and ask for “yes”.
71
72## High-signal command recipes
73
74### Calendar: “What’s on my calendar today?”
75Default: all calendars.
76- `gog calendar events --all --today --json`
77
78Tomorrow / week / next 3 days:
79- `gog calendar events --all --tomorrow --json`
80- `gog calendar events --all --week --json`
81- `gog calendar events --all --days 3 --json`
82
83Search events across time window (keyword):
84- `gog calendar search "standup" --days 30 --json`
85- `gog calendar search "meeting" --from 2026-02-01T00:00:00Z --to 2026-03-01T00:00:00Z --max 50 --json`
86
87Specific calendar (only when asked):
881) Find calendarId:
89- `gog calendar calendars --json`
902) Query it:
91- `gog calendar events <calendarId> --today --json`
92
93### Gmail: search + read + send (confirm sends)
94
95Search:
96- `gog gmail search 'newer_than:7d' --max 10 --json`
97- `gog gmail search 'from:boss@example.com newer_than:30d' --max 20 --json`
98
99Send (REQUIRES CONFIRMATION FIRST):
100- `gog gmail send --to a@b.com --subject "Hi" --body "Hello"`
101
102### Drive: find files
103- `gog drive search "invoice" --max 10 --json`
104
105### Contacts: list/search
106- `gog contacts list --max 50 --json`
107
108### Sheets: safe read/write (confirm writes)
109
110Read:
111- `gog sheets get <sheetId> "Tab!A1:D10" --json`
112
113Update (REQUIRES CONFIRMATION FIRST):
114- `gog sheets update <sheetId> "Tab!A1:B2" --values-json '[["A","B"],["1","2"]]' --input USER_ENTERED`
115
116Append (REQUIRES CONFIRMATION FIRST):
117- `gog sheets append <sheetId> "Tab!A:C" --values-json '[["x","y","z"]]' --insert INSERT_ROWS`
118
119Clear (REQUIRES CONFIRMATION FIRST):
120- `gog sheets clear <sheetId> "Tab!A2:Z"`
121
122### Docs: export/cat
123- `gog docs export <docId> --format txt --out /tmp/doc.txt`
124- `gog docs cat <docId>`
125
126## Troubleshooting checklist (fast)
127
128If calendar results look wrong or empty:
1291) Confirm account:
130- `gog auth status`
1312) List calendars to confirm visibility:
132- `gog calendar calendars --json`
1333) Ensure you used all-calendars for agenda:
134- `gog calendar events --all --today --json`
1354) If still empty, verify timezone assumptions:
136- `gog calendar time --timezone <IANA_TZ>`