$npx -y skills add SafeAI-Lab-X/ClawKeeper --skill gogGoogle Workspace CLI for Gmail, Calendar, Drive, Contacts, Sheets, and Docs.
| 1 | # gog |
| 2 | |
| 3 | Use `gog` for Gmail/Calendar/Drive/Contacts/Sheets/Docs. Requires OAuth setup. |
| 4 | |
| 5 | Setup (once) |
| 6 | |
| 7 | - `gog auth credentials /path/to/client_secret.json` |
| 8 | - `gog auth add you@gmail.com --services gmail,calendar,drive,contacts,docs,sheets` |
| 9 | - `gog auth list` |
| 10 | |
| 11 | Common commands |
| 12 | |
| 13 | - Gmail search: `gog gmail search 'newer_than:7d' --max 10` |
| 14 | - Gmail messages search (per email, ignores threading): `gog gmail messages search "in:inbox from:ryanair.com" --max 20 --account you@example.com` |
| 15 | - Gmail send (plain): `gog gmail send --to a@b.com --subject "Hi" --body "Hello"` |
| 16 | - Gmail send (multi-line): `gog gmail send --to a@b.com --subject "Hi" --body-file ./message.txt` |
| 17 | - Gmail send (stdin): `gog gmail send --to a@b.com --subject "Hi" --body-file -` |
| 18 | - Gmail send (HTML): `gog gmail send --to a@b.com --subject "Hi" --body-html "<p>Hello</p>"` |
| 19 | - Gmail draft: `gog gmail drafts create --to a@b.com --subject "Hi" --body-file ./message.txt` |
| 20 | - Gmail send draft: `gog gmail drafts send <draftId>` |
| 21 | - Gmail reply: `gog gmail send --to a@b.com --subject "Re: Hi" --body "Reply" --reply-to-message-id <msgId>` |
| 22 | - Calendar list events: `gog calendar events <calendarId> --from <iso> --to <iso>` |
| 23 | - Calendar create event: `gog calendar create <calendarId> --summary "Title" --from <iso> --to <iso>` |
| 24 | - Calendar create with color: `gog calendar create <calendarId> --summary "Title" --from <iso> --to <iso> --event-color 7` |
| 25 | - Calendar update event: `gog calendar update <calendarId> <eventId> --summary "New Title" --event-color 4` |
| 26 | - Calendar show colors: `gog calendar colors` |
| 27 | - Drive search: `gog drive search "query" --max 10` |
| 28 | - Contacts: `gog contacts list --max 20` |
| 29 | - Sheets get: `gog sheets get <sheetId> "Tab!A1:D10" --json` |
| 30 | - Sheets update: `gog sheets update <sheetId> "Tab!A1:B2" --values-json '[["A","B"],["1","2"]]' --input USER_ENTERED` |
| 31 | - Sheets append: `gog sheets append <sheetId> "Tab!A:C" --values-json '[["x","y","z"]]' --insert INSERT_ROWS` |
| 32 | - Sheets clear: `gog sheets clear <sheetId> "Tab!A2:Z"` |
| 33 | - Sheets metadata: `gog sheets metadata <sheetId> --json` |
| 34 | - Docs export: `gog docs export <docId> --format txt --out /tmp/doc.txt` |
| 35 | - Docs cat: `gog docs cat <docId>` |
| 36 | |
| 37 | Calendar Colors |
| 38 | |
| 39 | - Use `gog calendar colors` to see all available event colors (IDs 1-11) |
| 40 | - Add colors to events with `--event-color <id>` flag |
| 41 | - Event color IDs (from `gog calendar colors` output): |
| 42 | - 1: #a4bdfc |
| 43 | - 2: #7ae7bf |
| 44 | - 3: #dbadff |
| 45 | - 4: #ff887c |
| 46 | - 5: #fbd75b |
| 47 | - 6: #ffb878 |
| 48 | - 7: #46d6db |
| 49 | - 8: #e1e1e1 |
| 50 | - 9: #5484ed |
| 51 | - 10: #51b749 |
| 52 | - 11: #dc2127 |
| 53 | |
| 54 | Email Formatting |
| 55 | |
| 56 | - Prefer plain text. Use `--body-file` for multi-paragraph messages (or `--body-file -` for stdin). |
| 57 | - Same `--body-file` pattern works for drafts and replies. |
| 58 | - `--body` does not unescape `\n`. If you need inline newlines, use a heredoc or `$'Line 1\n\nLine 2'`. |
| 59 | - Use `--body-html` only when you need rich formatting. |
| 60 | - HTML tags: `<p>` for paragraphs, `<br>` for line breaks, `<strong>` for bold, `<em>` for italic, `<a href="url">` for links, `<ul>`/`<li>` for lists. |
| 61 | - Example (plain text via stdin): |
| 62 | |
| 63 | ```bash |
| 64 | gog gmail send --to recipient@example.com \ |
| 65 | --subject "Meeting Follow-up" \ |
| 66 | --body-file - <<'EOF' |
| 67 | Hi Name, |
| 68 | |
| 69 | Thanks for meeting today. Next steps: |
| 70 | - Item one |
| 71 | - Item two |
| 72 | |
| 73 | Best regards, |
| 74 | Your Name |
| 75 | EOF |
| 76 | ``` |
| 77 | |
| 78 | - Example (HTML list): |
| 79 | ```bash |
| 80 | gog gmail send --to recipient@example.com \ |
| 81 | --subject "Meeting Follow-up" \ |
| 82 | --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>" |
| 83 | ``` |
| 84 | |
| 85 | Notes |
| 86 | |
| 87 | - Set `GOG_ACCOUNT=you@gmail.com` to avoid repeating `--account`. |
| 88 | - For scripting, prefer `--json` plus `--no-input`. |
| 89 | - Sheets values can be passed via `--values-json` (recommended) or as inline rows. |
| 90 | - Docs supports export/cat/copy. In-place edits require a Docs API client (not in gog). |
| 91 | - Confirm before sending mail or creating events. |
| 92 | - `gog gmail search` returns one row per thread; use `gog gmail messages search` when you need every individual email returned separately. |