Skip to content

Commit 3bed2b0

Browse files
authored
feat(docs): add document shaping helpers
Implemented the remaining Docs and Gmail triage queue. Closes #657. Closes #648. Closes #638. Closes #645. Closes #640. Validation: - make ci passed locally. - Autoreview clean on branch diff. - GitHub CI passed for PR #668, including Linux, Windows, macOS cgo, worker, and Docker image checks. - Live gog tests passed with clawdbot account for Docs page size, cell style, person/date/file smart chips, local image upload/embed/revoke, and Gmail from-contact search.
1 parent c182ced commit 3bed2b0

20 files changed

Lines changed: 1449 additions & 12 deletions

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
- Gmail: pause watch push Gmail API fetches per account while a 429 Retry-After circuit is open. (#643)
1717
- YouTube: let `videos list` and `comments list` use OAuth when `--account` is supplied, preserving the API-key fallback for unauthenticated public reads. (#664)
1818
- YouTube: add `youtube search list` / `yt search ls` for YouTube Data API search across videos, channels, and playlists. (#650, #651) — thanks @BRO3886.
19+
- Gmail: add `gmail search --from-contact` to resolve a contact's email addresses into a `from:(...)` OR query. (#657) — thanks @chrischall.
20+
- Docs: add named `--page-size` presets for `docs write` and `docs page-layout`. (#640) — thanks @sebsnyk.
21+
- Docs: add smart-chip insertion commands for person, Drive file, and date chips. (#638) — thanks @sebsnyk.
22+
- Docs: add `docs cell-style` for table-cell background color and inline cell text styling. (#645) — thanks @sebsnyk.
23+
- Docs: add `docs insert-image` to upload a local image, temporarily share it for Docs insertion, and revoke the public permission afterward. (#648) — thanks @sebsnyk.
1924
- Docs: update the bundled `gog` agent skill to preserve broad user OAuth scopes during reauth and rely on command guards for scoped execution.
2025

2126
## 0.19.0 - 2026-05-22

docs/commands.generated.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ Generated from `gog schema --json`.
220220
- [`gog docs (doc) <command> [flags]`](commands/gog-docs.md) - Google Docs (export via Drive)
221221
- [`gog docs (doc) add-tab <docId> [flags]`](commands/gog-docs-add-tab.md) - Add a tab to a Google Doc
222222
- [`gog docs (doc) cat (text,read) <docId> [flags]`](commands/gog-docs-cat.md) - Print a Google Doc as plain text
223+
- [`gog docs (doc) cell-style --row=INT --col=INT <docId> [flags]`](commands/gog-docs-cell-style.md) - Apply table cell background and text styling
223224
- [`gog docs (doc) cell-update (update-cell) --row=INT --col=INT <docId> [flags]`](commands/gog-docs-cell-update.md) - Replace or append content inside a specific table cell
224225
- [`gog docs (doc) clear <docId>`](commands/gog-docs-clear.md) - Clear all content from a Google Doc
225226
- [`gog docs (doc) comments <command>`](commands/gog-docs-comments.md) - Manage comments on files
@@ -240,7 +241,11 @@ Generated from `gog schema --json`.
240241
- [`gog docs (doc) format <docId> [flags]`](commands/gog-docs-format.md) - Apply text or paragraph formatting to a Google Doc
241242
- [`gog docs (doc) info (get,show) <docId>`](commands/gog-docs-info.md) - Get Google Doc metadata
242243
- [`gog docs (doc) insert <docId> [<content>] [flags]`](commands/gog-docs-insert.md) - Insert text at a specific position
244+
- [`gog docs (doc) insert-date-chip --date=STRING <docId> [flags]`](commands/gog-docs-insert-date-chip.md) - Insert a native date smart chip
245+
- [`gog docs (doc) insert-file-chip (insert-rich-link) --file-id=STRING <docId> [flags]`](commands/gog-docs-insert-file-chip.md) - Insert a native Drive file smart chip
246+
- [`gog docs (doc) insert-image --file=STRING <docId> [flags]`](commands/gog-docs-insert-image.md) - Upload a local image and insert it into a Google Doc
243247
- [`gog docs (doc) insert-page-break (page-break,pb) <docId> [flags]`](commands/gog-docs-insert-page-break.md) - Insert a page break at a specific position (or end-of-doc with --at-end)
248+
- [`gog docs (doc) insert-person --email=STRING <docId> [flags]`](commands/gog-docs-insert-person.md) - Insert a native person smart chip
244249
- [`gog docs (doc) insert-table --rows=INT --cols=INT <docId> [flags]`](commands/gog-docs-insert-table.md) - Insert a native table at a specific position (or end-of-doc with --at-end), optionally populated via --values-json
245250
- [`gog docs (doc) list-tabs <docId>`](commands/gog-docs-list-tabs.md) - List all tabs in a Google Doc
246251
- [`gog docs (doc) page-layout (set-page-layout,page-setup) <docId> [flags]`](commands/gog-docs-page-layout.md) - Set page layout (pageless|pages) on an existing Google Doc

docs/commands/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Every `gog` command has a generated docs page. The source of truth is the live CLI schema; run `make docs-commands` after changing command names, flags, help text, aliases, or arguments.
44

5-
Generated pages: 576.
5+
Generated pages: 581.
66

77
## Top-level Commands
88

@@ -271,6 +271,7 @@ Generated pages: 576.
271271
- [gog docs](gog-docs.md) - Google Docs (export via Drive)
272272
- [gog docs add-tab](gog-docs-add-tab.md) - Add a tab to a Google Doc
273273
- [gog docs cat](gog-docs-cat.md) - Print a Google Doc as plain text
274+
- [gog docs cell-style](gog-docs-cell-style.md) - Apply table cell background and text styling
274275
- [gog docs cell-update](gog-docs-cell-update.md) - Replace or append content inside a specific table cell
275276
- [gog docs clear](gog-docs-clear.md) - Clear all content from a Google Doc
276277
- [gog docs comments](gog-docs-comments.md) - Manage comments on files
@@ -291,7 +292,11 @@ Generated pages: 576.
291292
- [gog docs format](gog-docs-format.md) - Apply text or paragraph formatting to a Google Doc
292293
- [gog docs info](gog-docs-info.md) - Get Google Doc metadata
293294
- [gog docs insert](gog-docs-insert.md) - Insert text at a specific position
295+
- [gog docs insert-date-chip](gog-docs-insert-date-chip.md) - Insert a native date smart chip
296+
- [gog docs insert-file-chip](gog-docs-insert-file-chip.md) - Insert a native Drive file smart chip
297+
- [gog docs insert-image](gog-docs-insert-image.md) - Upload a local image and insert it into a Google Doc
294298
- [gog docs insert-page-break](gog-docs-insert-page-break.md) - Insert a page break at a specific position (or end-of-doc with --at-end)
299+
- [gog docs insert-person](gog-docs-insert-person.md) - Insert a native person smart chip
295300
- [gog docs insert-table](gog-docs-insert-table.md) - Insert a native table at a specific position (or end-of-doc with --at-end), optionally populated via --values-json
296301
- [gog docs list-tabs](gog-docs-list-tabs.md) - List all tabs in a Google Doc
297302
- [gog docs page-layout](gog-docs-page-layout.md) - Set page layout (pageless|pages) on an existing Google Doc
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# `gog docs cell-style`
2+
3+
> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.
4+
5+
Apply table cell background and text styling
6+
7+
## Usage
8+
9+
```bash
10+
gog docs (doc) cell-style --row=INT --col=INT <docId> [flags]
11+
```
12+
13+
## Parent
14+
15+
- [gog docs](gog-docs.md)
16+
17+
## Flags
18+
19+
| Flag | Type | Default | Help |
20+
| --- | --- | --- | --- |
21+
| `--access-token` | `string` | | Use provided access token directly (bypasses stored refresh tokens; token expires in ~1h) |
22+
| `-a`<br>`--account`<br>`--acct` | `string` | | Account email for API commands (gmail/calendar/chat/classroom/drive/drivelabels/docs/slides/contacts/tasks/people/sheets/forms/sites/appscript/analytics/searchconsole/ads/photos) |
23+
| `--background-color`<br>`--bg-color` | `string` | | Cell background color as #RRGGBB or #RGB |
24+
| `--bold` | `bool` | | Set cell text bold |
25+
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
26+
| `--col` | `int` | | 0-based column number |
27+
| `--col-span` | `int64` | 1 | Number of columns to style |
28+
| `--color` | `string` | auto | Color output: auto\|always\|never |
29+
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
30+
| `-n`<br>`--dry-run`<br>`--dryrun`<br>`--noop`<br>`--preview` | `bool` | | Do not make changes; print intended actions and exit successfully |
31+
| `--enable-commands` | `string` | | Comma-separated list of enabled command prefixes; dot paths allowed (restricts CLI) |
32+
| `--enable-commands-exact` | `string` | | Comma-separated list of exact enabled commands; dot paths allowed and parent commands do not enable children |
33+
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
34+
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
35+
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
36+
| `--home` | `string` | | Override gogcli config/data/state/cache root (equivalent to GOG_HOME) |
37+
| `--italic` | `bool` | | Set cell text italic |
38+
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
39+
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
40+
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
41+
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
42+
| `--row` | `int` | | 0-based row number |
43+
| `--row-span` | `int64` | 1 | Number of rows to style |
44+
| `--select`<br>`--pick`<br>`--project` | `string` | | In JSON mode, select comma-separated fields (best-effort; supports dot paths). Desire path: use --fields for most commands. |
45+
| `--tab` | `string` | | Target a specific tab by title or ID (see docs list-tabs) |
46+
| `--table-index` | `int` | 0 | 0-based table index in document order |
47+
| `--text-color` | `string` | | Text color as #RRGGBB or #RGB |
48+
| `--underline` | `bool` | | Set cell text underline |
49+
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
50+
| `--version` | `kong.VersionFlag` | | Print version and exit |
51+
| `--wrap-untrusted` | `bool` | false | In JSON/raw output, wrap fetched text fields in external untrusted-content markers |
52+
53+
## See Also
54+
55+
- [gog docs](gog-docs.md)
56+
- [Command index](README.md)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# `gog docs insert-date-chip`
2+
3+
> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.
4+
5+
Insert a native date smart chip
6+
7+
## Usage
8+
9+
```bash
10+
gog docs (doc) insert-date-chip --date=STRING <docId> [flags]
11+
```
12+
13+
## Parent
14+
15+
- [gog docs](gog-docs.md)
16+
17+
## Flags
18+
19+
| Flag | Type | Default | Help |
20+
| --- | --- | --- | --- |
21+
| `--access-token` | `string` | | Use provided access token directly (bypasses stored refresh tokens; token expires in ~1h) |
22+
| `-a`<br>`--account`<br>`--acct` | `string` | | Account email for API commands (gmail/calendar/chat/classroom/drive/drivelabels/docs/slides/contacts/tasks/people/sheets/forms/sites/appscript/analytics/searchconsole/ads/photos) |
23+
| `--at-end` | `bool` | | Insert at end-of-doc/tab (mutually exclusive with --index) |
24+
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
25+
| `--color` | `string` | auto | Color output: auto\|always\|never |
26+
| `--date` | `string` | | Date to insert as YYYY-MM-DD |
27+
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
28+
| `-n`<br>`--dry-run`<br>`--dryrun`<br>`--noop`<br>`--preview` | `bool` | | Do not make changes; print intended actions and exit successfully |
29+
| `--enable-commands` | `string` | | Comma-separated list of enabled command prefixes; dot paths allowed (restricts CLI) |
30+
| `--enable-commands-exact` | `string` | | Comma-separated list of exact enabled commands; dot paths allowed and parent commands do not enable children |
31+
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
32+
| `--format` | `string` | abbreviated | Date display format: abbreviated\|full\|iso |
33+
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
34+
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
35+
| `--home` | `string` | | Override gogcli config/data/state/cache root (equivalent to GOG_HOME) |
36+
| `--index` | `*int64` | | Character index to insert at. Omit or use --at-end for end-of-doc. |
37+
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
38+
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
39+
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
40+
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
41+
| `--select`<br>`--pick`<br>`--project` | `string` | | In JSON mode, select comma-separated fields (best-effort; supports dot paths). Desire path: use --fields for most commands. |
42+
| `--tab` | `string` | | Target a specific tab by title or ID (see docs list-tabs) |
43+
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
44+
| `--version` | `kong.VersionFlag` | | Print version and exit |
45+
| `--wrap-untrusted` | `bool` | false | In JSON/raw output, wrap fetched text fields in external untrusted-content markers |
46+
47+
## See Also
48+
49+
- [gog docs](gog-docs.md)
50+
- [Command index](README.md)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# `gog docs insert-file-chip`
2+
3+
> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.
4+
5+
Insert a native Drive file smart chip
6+
7+
## Usage
8+
9+
```bash
10+
gog docs (doc) insert-file-chip (insert-rich-link) --file-id=STRING <docId> [flags]
11+
```
12+
13+
## Parent
14+
15+
- [gog docs](gog-docs.md)
16+
17+
## Flags
18+
19+
| Flag | Type | Default | Help |
20+
| --- | --- | --- | --- |
21+
| `--access-token` | `string` | | Use provided access token directly (bypasses stored refresh tokens; token expires in ~1h) |
22+
| `-a`<br>`--account`<br>`--acct` | `string` | | Account email for API commands (gmail/calendar/chat/classroom/drive/drivelabels/docs/slides/contacts/tasks/people/sheets/forms/sites/appscript/analytics/searchconsole/ads/photos) |
23+
| `--at-end` | `bool` | | Insert at end-of-doc/tab (mutually exclusive with --index) |
24+
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
25+
| `--color` | `string` | auto | Color output: auto\|always\|never |
26+
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
27+
| `-n`<br>`--dry-run`<br>`--dryrun`<br>`--noop`<br>`--preview` | `bool` | | Do not make changes; print intended actions and exit successfully |
28+
| `--enable-commands` | `string` | | Comma-separated list of enabled command prefixes; dot paths allowed (restricts CLI) |
29+
| `--enable-commands-exact` | `string` | | Comma-separated list of exact enabled commands; dot paths allowed and parent commands do not enable children |
30+
| `--file-id` | `string` | | Drive file ID to insert as a smart chip |
31+
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
32+
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
33+
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
34+
| `--home` | `string` | | Override gogcli config/data/state/cache root (equivalent to GOG_HOME) |
35+
| `--index` | `*int64` | | Character index to insert at. Omit or use --at-end for end-of-doc. |
36+
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
37+
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
38+
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
39+
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
40+
| `--select`<br>`--pick`<br>`--project` | `string` | | In JSON mode, select comma-separated fields (best-effort; supports dot paths). Desire path: use --fields for most commands. |
41+
| `--tab` | `string` | | Target a specific tab by title or ID (see docs list-tabs) |
42+
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
43+
| `--version` | `kong.VersionFlag` | | Print version and exit |
44+
| `--wrap-untrusted` | `bool` | false | In JSON/raw output, wrap fetched text fields in external untrusted-content markers |
45+
46+
## See Also
47+
48+
- [gog docs](gog-docs.md)
49+
- [Command index](README.md)
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# `gog docs insert-image`
2+
3+
> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.
4+
5+
Upload a local image and insert it into a Google Doc
6+
7+
## Usage
8+
9+
```bash
10+
gog docs (doc) insert-image --file=STRING <docId> [flags]
11+
```
12+
13+
## Parent
14+
15+
- [gog docs](gog-docs.md)
16+
17+
## Flags
18+
19+
| Flag | Type | Default | Help |
20+
| --- | --- | --- | --- |
21+
| `--access-token` | `string` | | Use provided access token directly (bypasses stored refresh tokens; token expires in ~1h) |
22+
| `-a`<br>`--account`<br>`--acct` | `string` | | Account email for API commands (gmail/calendar/chat/classroom/drive/drivelabels/docs/slides/contacts/tasks/people/sheets/forms/sites/appscript/analytics/searchconsole/ads/photos) |
23+
| `--at` | `string` | end | Placeholder text to replace, or 'end' to append |
24+
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
25+
| `--color` | `string` | auto | Color output: auto\|always\|never |
26+
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
27+
| `-n`<br>`--dry-run`<br>`--dryrun`<br>`--noop`<br>`--preview` | `bool` | | Do not make changes; print intended actions and exit successfully |
28+
| `--enable-commands` | `string` | | Comma-separated list of enabled command prefixes; dot paths allowed (restricts CLI) |
29+
| `--enable-commands-exact` | `string` | | Comma-separated list of exact enabled commands; dot paths allowed and parent commands do not enable children |
30+
| `--file` | `string` | | Local PNG, JPEG, or GIF image to upload and insert |
31+
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
32+
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
33+
| `--height` | `float64` | | Image height in points (optional; width-only preserves aspect ratio) |
34+
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
35+
| `--home` | `string` | | Override gogcli config/data/state/cache root (equivalent to GOG_HOME) |
36+
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
37+
| `--name` | `string` | | Override uploaded Drive filename |
38+
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
39+
| `--on-restricted` | `string` | error | If public sharing is blocked: error\|link |
40+
| `--parent` | `string` | | Drive folder ID for the uploaded image |
41+
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
42+
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
43+
| `--select`<br>`--pick`<br>`--project` | `string` | | In JSON mode, select comma-separated fields (best-effort; supports dot paths). Desire path: use --fields for most commands. |
44+
| `--tab` | `string` | | Target a specific tab by title or ID (see docs list-tabs) |
45+
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
46+
| `--version` | `kong.VersionFlag` | | Print version and exit |
47+
| `--width` | `float64` | 468 | Image width in points; default 468pt |
48+
| `--wrap-untrusted` | `bool` | false | In JSON/raw output, wrap fetched text fields in external untrusted-content markers |
49+
50+
## See Also
51+
52+
- [gog docs](gog-docs.md)
53+
- [Command index](README.md)

0 commit comments

Comments
 (0)