Skip to content

Commit 21ca030

Browse files
feat(slides): add scoped text editing (#835)
Add scoped Slides text styling, links, bullets, and exact object replacement, with explicit replacement scope required. Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
1 parent 5ff811d commit 21ca030

16 files changed

Lines changed: 1236 additions & 8 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Slides: allow `insert-image` and `replace-slide` to use public HTTPS image URLs without temporary Drive sharing. (#825) — thanks @sebsnyk.
88
- Slides: add structured element geometry, styled text runs, table-cell content, image source URLs, native presentation metadata, and read-only text location with exact UTF-16 ranges. (#822) — thanks @sebsnyk.
9+
- Slides: add range-scoped styling, links, bullets, and object-scoped replacement; `replace-text` now requires explicit `--object`, `--page`, or `--all` scope instead of silently changing the whole deck. (#823, #835) — thanks @sebsnyk.
910

1011
### Fixed
1112

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ gog sheets banding set <spreadsheetId> 'Sheet1!A1:D100'
382382
Docs: [Slides from Markdown](docs/slides-markdown.md),
383383
[template replacement](docs/slides-template-replacement.md),
384384
[introspection](docs/slides-introspection.md),
385+
[text editing](docs/slides-text-editing.md),
385386
[`gog slides`](docs/commands/gog-slides.md),
386387
[`gog forms`](docs/commands/gog-forms.md).
387388

@@ -390,6 +391,8 @@ gog slides create-from-markdown "Weekly update" --content-file slides.md
390391
gog slides info <presentationId> --json
391392
gog slides read-slide <presentationId> <slideId> --detail --json
392393
gog slides locate <presentationId> "Quarterly revenue" --all --json
394+
gog slides style-text <presentationId> <objectId> --range 0:12 --bold --size 24
395+
gog slides replace-text <presentationId> old new --object <objectId>
393396
gog slides insert-image <presentationId> <slideId> chart.png --x 24 --y 24 --width 240
394397
gog slides insert-text <presentationId> <objectId> "New text"
395398
gog forms update <formId> --quiz=true

docs/commands.generated.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ Generated from `gog schema --json`.
586586
- [`gog sites (site) url (open) <siteId> ...`](commands/gog-sites-url.md) - Print Google Site editor URLs
587587
- [`gog slides (slide) <command> [flags]`](commands/gog-slides.md) - Google Slides
588588
- [`gog slides (slide) add-slide <presentationId> <image> [flags]`](commands/gog-slides-add-slide.md) - Add a slide with a full-bleed image and optional speaker notes
589+
- [`gog slides (slide) bullets --range=STRING <presentationId> <objectId> [flags]`](commands/gog-slides-bullets.md) - Turn paragraph bullets on or off in one page element
589590
- [`gog slides (slide) copy (cp,duplicate) <presentationId> <title> [flags]`](commands/gog-slides-copy.md) - Copy a Google Slides presentation
590591
- [`gog slides (slide) create (add,new) <title> [flags]`](commands/gog-slides-create.md) - Create a Google Slides presentation
591592
- [`gog slides (slide) create-from-markdown <title> [flags]`](commands/gog-slides-create-from-markdown.md) - Create a Google Slides presentation from markdown
@@ -595,12 +596,14 @@ Generated from `gog schema --json`.
595596
- [`gog slides (slide) info (get,show) <presentationId>`](commands/gog-slides-info.md) - Get Google Slides presentation metadata
596597
- [`gog slides (slide) insert-image --width=FLOAT-64 <presentationId> <slideId> [<image>] [flags]`](commands/gog-slides-insert-image.md) - Insert a local or public image at a position and size
597598
- [`gog slides (slide) insert-text <presentationId> <objectId> <text> [flags]`](commands/gog-slides-insert-text.md) - Insert text into an existing page element (shape or table) by objectId
599+
- [`gog slides (slide) link --range=STRING <presentationId> <objectId> [flags]`](commands/gog-slides-link.md) - Apply a hyperlink to a text range in one page element
598600
- [`gog slides (slide) list-slides <presentationId>`](commands/gog-slides-list-slides.md) - List all slides with their object IDs
599601
- [`gog slides (slide) locate (find-element) <presentationId> <text> [flags]`](commands/gog-slides-locate.md) - Locate text in shapes and table cells with object IDs and UTF-16 ranges
600602
- [`gog slides (slide) raw <presentationId> [flags]`](commands/gog-slides-raw.md) - Dump raw Google Slides API response as JSON (Presentations.Get; lossless; for scripting and LLM consumption)
601603
- [`gog slides (slide) read-slide <presentationId> <slideId> [flags]`](commands/gog-slides-read-slide.md) - Read slide content: speaker notes, text elements, and images
602604
- [`gog slides (slide) replace-slide <presentationId> <slideId> [<image>] [flags]`](commands/gog-slides-replace-slide.md) - Replace an existing slide image from a local file or public URL
603-
- [`gog slides (slide) replace-text <presentationId> <find> <replacement> [flags]`](commands/gog-slides-replace-text.md) - Find-and-replace text across a presentation
605+
- [`gog slides (slide) replace-text <presentationId> <find> <replacement> [flags]`](commands/gog-slides-replace-text.md) - Find-and-replace text in an explicit object, slide, or presentation scope
606+
- [`gog slides (slide) style-text --range=STRING <presentationId> <objectId> [flags]`](commands/gog-slides-style-text.md) - Apply range-scoped text styling to one page element
604607
- [`gog slides (slide) thumbnail (thumb) <presentationId> <slideId> [flags]`](commands/gog-slides-thumbnail.md) - Get or download a rendered thumbnail for a slide
605608
- [`gog slides (slide) update-notes <presentationId> <slideId> [flags]`](commands/gog-slides-update-notes.md) - Update speaker notes on an existing slide
606609
- [`gog status (st) [flags]`](commands/gog-status.md) - Show auth/config status (alias for 'auth status')

docs/commands/README.md

Lines changed: 5 additions & 2 deletions
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: 647.
5+
Generated pages: 650.
66

77
## Top-level Commands
88

@@ -637,6 +637,7 @@ Generated pages: 647.
637637
- [gog sites url](gog-sites-url.md) - Print Google Site editor URLs
638638
- [gog slides](gog-slides.md) - Google Slides
639639
- [gog slides add-slide](gog-slides-add-slide.md) - Add a slide with a full-bleed image and optional speaker notes
640+
- [gog slides bullets](gog-slides-bullets.md) - Turn paragraph bullets on or off in one page element
640641
- [gog slides copy](gog-slides-copy.md) - Copy a Google Slides presentation
641642
- [gog slides create](gog-slides-create.md) - Create a Google Slides presentation
642643
- [gog slides create-from-markdown](gog-slides-create-from-markdown.md) - Create a Google Slides presentation from markdown
@@ -646,12 +647,14 @@ Generated pages: 647.
646647
- [gog slides info](gog-slides-info.md) - Get Google Slides presentation metadata
647648
- [gog slides insert-image](gog-slides-insert-image.md) - Insert a local or public image at a position and size
648649
- [gog slides insert-text](gog-slides-insert-text.md) - Insert text into an existing page element (shape or table) by objectId
650+
- [gog slides link](gog-slides-link.md) - Apply a hyperlink to a text range in one page element
649651
- [gog slides list-slides](gog-slides-list-slides.md) - List all slides with their object IDs
650652
- [gog slides locate](gog-slides-locate.md) - Locate text in shapes and table cells with object IDs and UTF-16 ranges
651653
- [gog slides raw](gog-slides-raw.md) - Dump raw Google Slides API response as JSON (Presentations.Get; lossless; for scripting and LLM consumption)
652654
- [gog slides read-slide](gog-slides-read-slide.md) - Read slide content: speaker notes, text elements, and images
653655
- [gog slides replace-slide](gog-slides-replace-slide.md) - Replace an existing slide image from a local file or public URL
654-
- [gog slides replace-text](gog-slides-replace-text.md) - Find-and-replace text across a presentation
656+
- [gog slides replace-text](gog-slides-replace-text.md) - Find-and-replace text in an explicit object, slide, or presentation scope
657+
- [gog slides style-text](gog-slides-style-text.md) - Apply range-scoped text styling to one page element
655658
- [gog slides thumbnail](gog-slides-thumbnail.md) - Get or download a rendered thumbnail for a slide
656659
- [gog slides update-notes](gog-slides-update-notes.md) - Update speaker notes on an existing slide
657660
- [gog status](gog-status.md) - Show auth/config status (alias for 'auth status')
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# `gog slides bullets`
2+
3+
> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.
4+
5+
Turn paragraph bullets on or off in one page element
6+
7+
## Usage
8+
9+
```bash
10+
gog slides (slide) bullets --range=STRING <presentationId> <objectId> [flags]
11+
```
12+
13+
## Parent
14+
15+
- [gog slides](gog-slides.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, alias, or auto for authenticated Google API commands |
23+
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
24+
| `--color` | `string` | auto | Color output: auto\|always\|never |
25+
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
26+
| `-n`<br>`--dry-run`<br>`--dryrun`<br>`--noop`<br>`--preview` | `bool` | | Do not make changes; print intended actions and exit successfully |
27+
| `--enable-commands` | `string` | | Comma-separated list of enabled command prefixes; dot paths allowed (restricts CLI) |
28+
| `--enable-commands-exact` | `string` | | Comma-separated list of exact enabled commands; dot paths allowed and parent commands do not enable children |
29+
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
30+
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
31+
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
32+
| `--home` | `string` | | Override gogcli config/data/state/cache root (equivalent to GOG_HOME) |
33+
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
34+
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
35+
| `--off` | `bool` | | Turn bullets off for the selected paragraphs |
36+
| `--on` | `bool` | | Turn bullets on for the selected paragraphs |
37+
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
38+
| `--preset` | `string` | BULLET_DISC_CIRCLE_SQUARE | Slides bullet preset when using --on |
39+
| `--range` | `string` | | UTF-16 paragraph range as start:end |
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+
| `-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 slides](gog-slides.md)
49+
- [Command index](README.md)

docs/commands/gog-slides-link.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# `gog slides link`
2+
3+
> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.
4+
5+
Apply a hyperlink to a text range in one page element
6+
7+
## Usage
8+
9+
```bash
10+
gog slides (slide) link --range=STRING <presentationId> <objectId> [flags]
11+
```
12+
13+
## Parent
14+
15+
- [gog slides](gog-slides.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, alias, or auto for authenticated Google API commands |
23+
| `--clear` | `bool` | | Remove the hyperlink from the selected range |
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+
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
31+
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
32+
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
33+
| `--home` | `string` | | Override gogcli config/data/state/cache root (equivalent to GOG_HOME) |
34+
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
35+
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
36+
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
37+
| `--range` | `string` | | UTF-16 text range as start:end |
38+
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
39+
| `--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. |
40+
| `--url` | `string` | | External URL to apply as the hyperlink |
41+
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
42+
| `--version` | `kong.VersionFlag` | | Print version and exit |
43+
| `--wrap-untrusted` | `bool` | false | In JSON/raw output, wrap fetched text fields in external untrusted-content markers |
44+
45+
## See Also
46+
47+
- [gog slides](gog-slides.md)
48+
- [Command index](README.md)

docs/commands/gog-slides-replace-text.md

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

33
> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.
44
5-
Find-and-replace text across a presentation
5+
Find-and-replace text in an explicit object, slide, or presentation scope
66

77
## Usage
88

@@ -20,6 +20,7 @@ gog slides (slide) replace-text <presentationId> <find> <replacement> [flags]
2020
| --- | --- | --- | --- |
2121
| `--access-token` | `string` | | Use provided access token directly (bypasses stored refresh tokens; token expires in ~1h) |
2222
| `-a`<br>`--account`<br>`--acct` | `string` | | Account email, alias, or auto for authenticated Google API commands |
23+
| `--all` | `bool` | | Replace matching text across the entire presentation |
2324
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
2425
| `--color` | `string` | auto | Color output: auto\|always\|never |
2526
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
@@ -33,6 +34,7 @@ gog slides (slide) replace-text <presentationId> <find> <replacement> [flags]
3334
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
3435
| `--match-case` | `bool` | | Case-sensitive match (default: false) |
3536
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
37+
| `--object` | `string` | | Restrict replacement to a single shape text object ID |
3638
| `--page` | `[]string` | | Restrict replacement to specific slide object IDs (repeatable) |
3739
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
3840
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# `gog slides style-text`
2+
3+
> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.
4+
5+
Apply range-scoped text styling to one page element
6+
7+
## Usage
8+
9+
```bash
10+
gog slides (slide) style-text --range=STRING <presentationId> <objectId> [flags]
11+
```
12+
13+
## Parent
14+
15+
- [gog slides](gog-slides.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, alias, or auto for authenticated Google API commands |
23+
| `--bold` | `bool` | | Set bold |
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+
| `--font` | `string` | | Font family, for example Arial or Georgia |
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+
| `--italic` | `bool` | | Set italic |
36+
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
37+
| `--no-bold` | `bool` | | Clear bold |
38+
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
39+
| `--no-italic` | `bool` | | Clear italic |
40+
| `--no-underline` | `bool` | | Clear underline |
41+
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
42+
| `--range` | `string` | | UTF-16 text range as start:end |
43+
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
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+
| `--size` | `float64` | | Font size in points |
46+
| `--text-color` | `string` | | Text color as #RRGGBB or #RGB |
47+
| `--underline` | `bool` | | Set underline |
48+
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
49+
| `--version` | `kong.VersionFlag` | | Print version and exit |
50+
| `--wrap-untrusted` | `bool` | false | In JSON/raw output, wrap fetched text fields in external untrusted-content markers |
51+
52+
## See Also
53+
54+
- [gog slides](gog-slides.md)
55+
- [Command index](README.md)

0 commit comments

Comments
 (0)