gog
Use gog for Gmail/Calendar/Drive/Contacts/Sheets/Docs. Requires OAuth setup.
Setup (once)
hybridclaw skill install gog gog
hybridclaw auth login google --client-id <id> --client-secret <secret> --account you@gmail.com
hybridclaw auth status google
HybridClaw stores the Google OAuth client secret and refresh token in encrypted runtime secrets, mints a short-lived access token on the host, and injects only GOG_ACCESS_TOKEN, GOOGLE_WORKSPACE_CLI_TOKEN, and GOG_ACCOUNT into the agent runtime for Google Workspace CLIs.
Common commands
gog supports the commands: calendar, chat, contacts, docs, drive, forms, gmail, groups, people,
slides, tasks, sheets
Help about a gog command: gog <command> --help
Gmail search: gog gmail search 'newer_than:7d' --max 10
Gmail messages search (per email, ignores threading): gog gmail messages search "in:inbox from:ryanair.com" --max 20 --account you@example.com
Gmail send (plain): gog gmail send --to a@b.com --subject "Hi" --body "Hello"
Gmail send (multi-line): gog gmail send --to a@b.com --subject "Hi" --body-file ./message.txt
Gmail send (stdin): gog gmail send --to a@b.com --subject "Hi" --body-file -
Gmail send (HTML): gog gmail send --to a@b.com --subject "Hi" --body-html "<p>Hello</p>"
Gmail draft: gog gmail drafts create --to a@b.com --subject "Hi" --body-file ./message.txt
Gmail send draft: gog gmail drafts send <draftId>
Gmail reply: gog gmail send --to a@b.com --subject "Re: Hi" --body "Reply" --reply-to-message-id <msgId>
Calendar search events: gog calendar search <calendarId> "Meeting" --from <iso> --to <iso> --max 10
Calendar list events: gog calendar events <calendarId> --from <iso> --to <iso>
Calendar create event: gog calendar create <calendarId> --summary "Title" --from <iso> --to <iso>
Calendar create with attendees: gog calendar create <calendarId> --summary "Title" --from <iso> --to <iso> --attendees a@b.com,c@d.com --send-updates all
Calendar create with color: gog calendar create <calendarId> --summary "Title" --from <iso> --to <iso> --event-color 7
Calendar update event: gog calendar update <calendarId> <eventId> --summary "New Title" --event-color 4
Calendar show colors: gog calendar colors
Drive search: gog drive search "query" --max 10
Contacts: gog contacts list --max 20
Sheets get: gog sheets get <sheetId> "Tab!A1:D10" --json
Sheets update: gog sheets update <sheetId> "Tab!A1:B2" --values-json '[["A","B"],["1","2"]]' --input USER_ENTERED
Sheets append: gog sheets append <sheetId> "Tab!A:C" --values-json '[["x","y","z"]]' --insert INSERT_ROWS
Sheets clear: gog sheets clear <sheetId> "Tab!A2:Z"
Sheets metadata: gog sheets metadata <sheetId> --json
Docs export: gog docs export <docId> --format txt --out /tmp/doc.txt
Docs cat: gog docs cat <docId>
Calendar Colors
- Use
gog calendar colors to see all available event colors (IDs 1-11)
- Add colors to events with
--event-color <id> flag
- Event color IDs (from
gog calendar colors output):
- 1: #a4bdfc
- 2: #7ae7bf
- 3: #dbadff
- 4: #ff887c
- 5: #fbd75b
- 6: #ffb878
- 7: #46d6db
- 8: #e1e1e1
- 9: #5484ed
- 10: #51b749
- 11: #dc2127
Email Formatting
Prefer plain text. Use --body-file for multi-paragraph messages (or --body-file - for stdin).
Same --body-file pattern works for drafts and replies.
--body does not unescape \n. If you need inline newlines, use a heredoc or $'Line 1\n\nLine 2'.
Use --body-html only when you need rich formatting.
HTML tags: <p> for paragraphs, <br> for line breaks, <strong> for bold, <em> for italic, <a href="url"> for links, <ul>/<li> for lists.
Example (plain text via stdin):
gog gmail send --to recipient@example.com \
--subject "Meeting Follow-up" \
--body-file - <<'EOF'
Hi Name,
Thanks for meeting today. Next steps:
- Item one
- Item two
Best regards,
Your Name
EOF
Example (HTML list):
gog gmail send --to recipient@example.com \
--subject "Meeting Follow-up" \
--body-html "<p>Hi Name,</p><p>Thanks for meeting today. Here are the next steps:</p><ul><li>Item one</li><li>Item two</li></ul><p>Best regards,<br>Your Name</p>"
Notes
- For scripting, prefer
--json plus --no-input.
- When the user asks for calendar events without naming a calendar ID,
gog searches all available calendars.
- Do not pipe
gog ... --json through ad hoc Python filters unless the JSON shape has been inspected first.
- Sheets values can be passed via
--values-json (recommended) or as inline rows.
- Docs supports export/cat/copy. In-place edits require a Docs API client (not in gog).
- Confirm before sending mail or creating events.
gog gmail search returns one row per thread; use gog gmail messages search when you need every individual email returned separately.
1---2name: gog3description: Google Workspace CLI for Gmail, Google Calendar events, meetings, schedules, availability, Drive, Contacts, Sheets, and Docs4---5# gog67Use `gog` for Gmail/Calendar/Drive/Contacts/Sheets/Docs. Requires OAuth setup.89## Setup (once)1011```bash12hybridclaw skill install gog gog13hybridclaw auth login google --client-id <id> --client-secret <secret> --account you@gmail.com14hybridclaw auth status google15```1617HybridClaw stores the Google OAuth client secret and refresh token in encrypted runtime secrets, mints a short-lived access token on the host, and injects only `GOG_ACCESS_TOKEN`, `GOOGLE_WORKSPACE_CLI_TOKEN`, and `GOG_ACCOUNT` into the agent runtime for Google Workspace CLIs.1819## Common commands2021`gog` supports the commands: calendar, chat, contacts, docs, drive, forms, gmail, groups, people,22slides, tasks, sheets2324- Help about a gog command: `gog <command> --help`2526- Gmail search: `gog gmail search 'newer_than:7d' --max 10`27- Gmail messages search (per email, ignores threading): `gog gmail messages search "in:inbox from:ryanair.com" --max 20 --account you@example.com`28- Gmail send (plain): `gog gmail send --to a@b.com --subject "Hi" --body "Hello"`29- Gmail send (multi-line): `gog gmail send --to a@b.com --subject "Hi" --body-file ./message.txt`30- Gmail send (stdin): `gog gmail send --to a@b.com --subject "Hi" --body-file -`31- Gmail send (HTML): `gog gmail send --to a@b.com --subject "Hi" --body-html "<p>Hello</p>"`32- Gmail draft: `gog gmail drafts create --to a@b.com --subject "Hi" --body-file ./message.txt`33- Gmail send draft: `gog gmail drafts send <draftId>`34- Gmail reply: `gog gmail send --to a@b.com --subject "Re: Hi" --body "Reply" --reply-to-message-id <msgId>`35- Calendar search events: `gog calendar search <calendarId> "Meeting" --from <iso> --to <iso> --max 10`36- Calendar list events: `gog calendar events <calendarId> --from <iso> --to <iso>`37- Calendar create event: `gog calendar create <calendarId> --summary "Title" --from <iso> --to <iso>`38- Calendar create with attendees: `gog calendar create <calendarId> --summary "Title" --from <iso> --to <iso> --attendees a@b.com,c@d.com --send-updates all`39- Calendar create with color: `gog calendar create <calendarId> --summary "Title" --from <iso> --to <iso> --event-color 7`40- Calendar update event: `gog calendar update <calendarId> <eventId> --summary "New Title" --event-color 4`41- Calendar show colors: `gog calendar colors`42- Drive search: `gog drive search "query" --max 10`43- Contacts: `gog contacts list --max 20`44- Sheets get: `gog sheets get <sheetId> "Tab!A1:D10" --json`45- Sheets update: `gog sheets update <sheetId> "Tab!A1:B2" --values-json '[["A","B"],["1","2"]]' --input USER_ENTERED`46- Sheets append: `gog sheets append <sheetId> "Tab!A:C" --values-json '[["x","y","z"]]' --insert INSERT_ROWS`47- Sheets clear: `gog sheets clear <sheetId> "Tab!A2:Z"`48- Sheets metadata: `gog sheets metadata <sheetId> --json`49- Docs export: `gog docs export <docId> --format txt --out /tmp/doc.txt`50- Docs cat: `gog docs cat <docId>`5152## Calendar Colors5354- Use `gog calendar colors` to see all available event colors (IDs 1-11)55- Add colors to events with `--event-color <id>` flag56- Event color IDs (from `gog calendar colors` output):57 - 1: #a4bdfc58 - 2: #7ae7bf59 - 3: #dbadff60 - 4: #ff887c61 - 5: #fbd75b62 - 6: #ffb87863 - 7: #46d6db64 - 8: #e1e1e165 - 9: #5484ed66 - 10: #51b74967 - 11: #dc21276869Email Formatting7071- Prefer plain text. Use `--body-file` for multi-paragraph messages (or `--body-file -` for stdin).72- Same `--body-file` pattern works for drafts and replies.73- `--body` does not unescape `\n`. If you need inline newlines, use a heredoc or `$'Line 1\n\nLine 2'`.74- Use `--body-html` only when you need rich formatting.75- HTML tags: `<p>` for paragraphs, `<br>` for line breaks, `<strong>` for bold, `<em>` for italic, `<a href="url">` for links, `<ul>`/`<li>` for lists.76- Example (plain text via stdin):7778 ```bash79 gog gmail send --to recipient@example.com \80 --subject "Meeting Follow-up" \81 --body-file - <<'EOF'82 Hi Name,8384 Thanks for meeting today. Next steps:85 - Item one86 - Item two8788 Best regards,89 Your Name90 EOF91 ```9293- Example (HTML list):94 ```bash95 gog gmail send --to recipient@example.com \96 --subject "Meeting Follow-up" \97 --body-html "<p>Hi Name,</p><p>Thanks for meeting today. Here are the next steps:</p><ul><li>Item one</li><li>Item two</li></ul><p>Best regards,<br>Your Name</p>"98 ```99100## Notes101- For scripting, prefer `--json` plus `--no-input`.102- When the user asks for calendar events without naming a calendar ID, `gog` searches all available calendars.103- Do not pipe `gog ... --json` through ad hoc Python filters unless the JSON shape has been inspected first.104- Sheets values can be passed via `--values-json` (recommended) or as inline rows.105- Docs supports export/cat/copy. In-place edits require a Docs API client (not in gog).106- Confirm before sending mail or creating events.107- `gog gmail search` returns one row per thread; use `gog gmail messages search` when you need every individual email returned separately.