Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- 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.
- 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.
- Slides: add native table creation and zero-based table-cell targeting for `insert-text`, including atomic cell replacement. (#824, #834) — thanks @sebsnyk.
- Slides: add native themed slide creation, duplication, and reordering with predefined or exact custom layouts and explicit zero-based positions. (#826, #833) — thanks @sebsnyk.

### Fixed

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ Docs: [Slides from Markdown](docs/slides-markdown.md),
[introspection](docs/slides-introspection.md),
[text editing](docs/slides-text-editing.md),
[tables](docs/slides-tables.md),
[slide structure](docs/slides-structure.md),
[`gog slides`](docs/commands/gog-slides.md),
[`gog forms`](docs/commands/gog-forms.md).

Expand All @@ -396,6 +397,9 @@ gog slides style-text <presentationId> <objectId> --range 0:12 --bold --size 24
gog slides replace-text <presentationId> old new --object <objectId>
gog slides table create <presentationId> <slideId> --rows 2 --cols 3
gog slides insert-text <presentationId> <tableId> "Revenue" --row 0 --col 0 --replace
gog slides new-slide <presentationId> --layout TITLE_AND_BODY --index 1
gog slides duplicate-slide <presentationId> <slideId> --to-index 2
gog slides move-slide <presentationId> <slideId> --to-index 0
gog slides insert-image <presentationId> <slideId> chart.png --x 24 --y 24 --width 240
gog slides insert-text <presentationId> <objectId> "New text"
gog forms update <formId> --quiz=true
Expand Down
3 changes: 3 additions & 0 deletions docs/commands.generated.md
Original file line number Diff line number Diff line change
Expand Up @@ -592,13 +592,16 @@ Generated from `gog schema --json`.
- [`gog slides (slide) create-from-markdown <title> [flags]`](commands/gog-slides-create-from-markdown.md) - Create a Google Slides presentation from markdown
- [`gog slides (slide) create-from-template <templateId> <title> [flags]`](commands/gog-slides-create-from-template.md) - Create a presentation from template with text replacements
- [`gog slides (slide) delete-slide <presentationId> <slideId>`](commands/gog-slides-delete-slide.md) - Delete a slide by object ID
- [`gog slides (slide) duplicate-slide <presentationId> <slideId> [flags]`](commands/gog-slides-duplicate-slide.md) - Duplicate a slide by object ID
- [`gog slides (slide) export (download,dl) <presentationId> [flags]`](commands/gog-slides-export.md) - Export a Google Slides deck (pdf|pptx)
- [`gog slides (slide) info (get,show) <presentationId>`](commands/gog-slides-info.md) - Get Google Slides presentation metadata
- [`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
- [`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
- [`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
- [`gog slides (slide) list-slides <presentationId>`](commands/gog-slides-list-slides.md) - List all slides with their object IDs
- [`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
- [`gog slides (slide) move-slide --to-index=TO-INDEX <presentationId> <slideId>`](commands/gog-slides-move-slide.md) - Move a slide to a zero-based insertion index
- [`gog slides (slide) new-slide <presentationId> [flags]`](commands/gog-slides-new-slide.md) - Create a native themed slide
- [`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)
- [`gog slides (slide) read-slide <presentationId> <slideId> [flags]`](commands/gog-slides-read-slide.md) - Read slide content: speaker notes, text elements, and images
- [`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
Expand Down
5 changes: 4 additions & 1 deletion docs/commands/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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.

Generated pages: 652.
Generated pages: 655.

## Top-level Commands

Expand Down Expand Up @@ -643,13 +643,16 @@ Generated pages: 652.
- [gog slides create-from-markdown](gog-slides-create-from-markdown.md) - Create a Google Slides presentation from markdown
- [gog slides create-from-template](gog-slides-create-from-template.md) - Create a presentation from template with text replacements
- [gog slides delete-slide](gog-slides-delete-slide.md) - Delete a slide by object ID
- [gog slides duplicate-slide](gog-slides-duplicate-slide.md) - Duplicate a slide by object ID
- [gog slides export](gog-slides-export.md) - Export a Google Slides deck (pdf|pptx)
- [gog slides info](gog-slides-info.md) - Get Google Slides presentation metadata
- [gog slides insert-image](gog-slides-insert-image.md) - Insert a local or public image at a position and size
- [gog slides insert-text](gog-slides-insert-text.md) - Insert text into an existing page element (shape or table) by objectId
- [gog slides link](gog-slides-link.md) - Apply a hyperlink to a text range in one page element
- [gog slides list-slides](gog-slides-list-slides.md) - List all slides with their object IDs
- [gog slides locate](gog-slides-locate.md) - Locate text in shapes and table cells with object IDs and UTF-16 ranges
- [gog slides move-slide](gog-slides-move-slide.md) - Move a slide to a zero-based insertion index
- [gog slides new-slide](gog-slides-new-slide.md) - Create a native themed slide
- [gog slides raw](gog-slides-raw.md) - Dump raw Google Slides API response as JSON (Presentations.Get; lossless; for scripting and LLM consumption)
- [gog slides read-slide](gog-slides-read-slide.md) - Read slide content: speaker notes, text elements, and images
- [gog slides replace-slide](gog-slides-replace-slide.md) - Replace an existing slide image from a local file or public URL
Expand Down
46 changes: 46 additions & 0 deletions docs/commands/gog-slides-duplicate-slide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# `gog slides duplicate-slide`

> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.

Duplicate a slide by object ID

## Usage

```bash
gog slides (slide) duplicate-slide <presentationId> <slideId> [flags]
```

## Parent

- [gog slides](gog-slides.md)

## Flags

| Flag | Type | Default | Help |
| --- | --- | --- | --- |
| `--access-token` | `string` | | Use provided access token directly (bypasses stored refresh tokens; token expires in ~1h) |
| `-a`<br>`--account`<br>`--acct` | `string` | | Account email, alias, or auto for authenticated Google API commands |
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
| `--color` | `string` | auto | Color output: auto\|always\|never |
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
| `-n`<br>`--dry-run`<br>`--dryrun`<br>`--noop`<br>`--preview` | `bool` | | Do not make changes; print intended actions and exit successfully |
| `--enable-commands` | `string` | | Comma-separated list of enabled command prefixes; dot paths allowed (restricts CLI) |
| `--enable-commands-exact` | `string` | | Comma-separated list of exact enabled commands; dot paths allowed and parent commands do not enable children |
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
| `--home` | `string` | | Override gogcli config/data/state/cache root (equivalent to GOG_HOME) |
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `--to-index` | `*int64` | | Zero-based insertion index for the duplicated slide |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
| `--version` | `kong.VersionFlag` | | Print version and exit |
| `--wrap-untrusted` | `bool` | false | In JSON/raw output, wrap fetched text fields in external untrusted-content markers |

## See Also

- [gog slides](gog-slides.md)
- [Command index](README.md)
46 changes: 46 additions & 0 deletions docs/commands/gog-slides-move-slide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# `gog slides move-slide`

> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.

Move a slide to a zero-based insertion index

## Usage

```bash
gog slides (slide) move-slide --to-index=TO-INDEX <presentationId> <slideId>
```

## Parent

- [gog slides](gog-slides.md)

## Flags

| Flag | Type | Default | Help |
| --- | --- | --- | --- |
| `--access-token` | `string` | | Use provided access token directly (bypasses stored refresh tokens; token expires in ~1h) |
| `-a`<br>`--account`<br>`--acct` | `string` | | Account email, alias, or auto for authenticated Google API commands |
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
| `--color` | `string` | auto | Color output: auto\|always\|never |
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
| `-n`<br>`--dry-run`<br>`--dryrun`<br>`--noop`<br>`--preview` | `bool` | | Do not make changes; print intended actions and exit successfully |
| `--enable-commands` | `string` | | Comma-separated list of enabled command prefixes; dot paths allowed (restricts CLI) |
| `--enable-commands-exact` | `string` | | Comma-separated list of exact enabled commands; dot paths allowed and parent commands do not enable children |
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
| `--home` | `string` | | Override gogcli config/data/state/cache root (equivalent to GOG_HOME) |
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `--to-index` | `*int64` | | Zero-based insertion index where the slide should be moved |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
| `--version` | `kong.VersionFlag` | | Print version and exit |
| `--wrap-untrusted` | `bool` | false | In JSON/raw output, wrap fetched text fields in external untrusted-content markers |

## See Also

- [gog slides](gog-slides.md)
- [Command index](README.md)
48 changes: 48 additions & 0 deletions docs/commands/gog-slides-new-slide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# `gog slides new-slide`

> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.

Create a native themed slide

## Usage

```bash
gog slides (slide) new-slide <presentationId> [flags]
```

## Parent

- [gog slides](gog-slides.md)

## Flags

| Flag | Type | Default | Help |
| --- | --- | --- | --- |
| `--access-token` | `string` | | Use provided access token directly (bypasses stored refresh tokens; token expires in ~1h) |
| `-a`<br>`--account`<br>`--acct` | `string` | | Account email, alias, or auto for authenticated Google API commands |
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
| `--color` | `string` | auto | Color output: auto\|always\|never |
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
| `-n`<br>`--dry-run`<br>`--dryrun`<br>`--noop`<br>`--preview` | `bool` | | Do not make changes; print intended actions and exit successfully |
| `--enable-commands` | `string` | | Comma-separated list of enabled command prefixes; dot paths allowed (restricts CLI) |
| `--enable-commands-exact` | `string` | | Comma-separated list of exact enabled commands; dot paths allowed and parent commands do not enable children |
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
| `--home` | `string` | | Override gogcli config/data/state/cache root (equivalent to GOG_HOME) |
| `--index` | `*int64` | | Zero-based insertion index for the new slide |
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
| `--layout` | `*string` | | Predefined slide layout; defaults to BLANK |
| `--layout-id` | `string` | | Exact presentation layout object ID from 'slides info --json'; mutually exclusive with --layout |
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
| `--version` | `kong.VersionFlag` | | Print version and exit |
| `--wrap-untrusted` | `bool` | false | In JSON/raw output, wrap fetched text fields in external untrusted-content markers |

## See Also

- [gog slides](gog-slides.md)
- [Command index](README.md)
3 changes: 3 additions & 0 deletions docs/commands/gog-slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ gog slides (slide) <command> [flags]
- [gog slides create-from-markdown](gog-slides-create-from-markdown.md) - Create a Google Slides presentation from markdown
- [gog slides create-from-template](gog-slides-create-from-template.md) - Create a presentation from template with text replacements
- [gog slides delete-slide](gog-slides-delete-slide.md) - Delete a slide by object ID
- [gog slides duplicate-slide](gog-slides-duplicate-slide.md) - Duplicate a slide by object ID
- [gog slides export](gog-slides-export.md) - Export a Google Slides deck (pdf|pptx)
- [gog slides info](gog-slides-info.md) - Get Google Slides presentation metadata
- [gog slides insert-image](gog-slides-insert-image.md) - Insert a local or public image at a position and size
- [gog slides insert-text](gog-slides-insert-text.md) - Insert text into an existing page element (shape or table) by objectId
- [gog slides link](gog-slides-link.md) - Apply a hyperlink to a text range in one page element
- [gog slides list-slides](gog-slides-list-slides.md) - List all slides with their object IDs
- [gog slides locate](gog-slides-locate.md) - Locate text in shapes and table cells with object IDs and UTF-16 ranges
- [gog slides move-slide](gog-slides-move-slide.md) - Move a slide to a zero-based insertion index
- [gog slides new-slide](gog-slides-new-slide.md) - Create a native themed slide
- [gog slides raw](gog-slides-raw.md) - Dump raw Google Slides API response as JSON (Presentations.Get; lossless; for scripting and LLM consumption)
- [gog slides read-slide](gog-slides-read-slide.md) - Read slide content: speaker notes, text elements, and images
- [gog slides replace-slide](gog-slides-replace-slide.md) - Replace an existing slide image from a local file or public URL
Expand Down
43 changes: 43 additions & 0 deletions docs/slides-structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Slides structure

Create native, editable slides without rendering an image first:

```bash
gog slides new-slide <presentationId>
gog slides new-slide <presentationId> --layout TITLE_AND_BODY --index 1
```

Without a layout flag, Google creates a blank slide. `--layout` accepts the
Slides predefined layouts. A presentation theme can remove or modify a
predefined layout; Google returns an error when the selected layout is not
available in the active master.

For an exact theme layout, read its object ID from `slides info --json` and use
`--layout-id`:

```bash
gog slides info <presentationId> --json
gog slides new-slide <presentationId> --layout-id <layoutId>
```

`--layout` and `--layout-id` are mutually exclusive. `--index` is zero-based;
omitting it appends the slide.

## Duplicate and move

Find stable slide IDs, then duplicate or reorder them:

```bash
gog slides list-slides <presentationId> --json
gog slides duplicate-slide <presentationId> <slideId>
gog slides duplicate-slide <presentationId> <slideId> --to-index 2
gog slides move-slide <presentationId> <slideId> --to-index 0
```

Without `--to-index`, Google places a duplicate immediately after its source.
With `--to-index`, duplication and positioning happen in one batch update.
Move indexes are zero-based and refer to the presentation order before the move,
matching the Slides API. An index can range from zero through the slide count.

Use `--dry-run --json` to inspect the exact batch request without contacting
Google, and `slides list-slides --json` to verify the resulting order.
3 changes: 3 additions & 0 deletions internal/cmd/slides.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ type SlidesCmd struct {
CreateFromTemplate SlidesCreateFromTemplateCmd `cmd:"" name:"create-from-template" help:"Create a presentation from template with text replacements"`
Copy SlidesCopyCmd `cmd:"" name:"copy" aliases:"cp,duplicate" help:"Copy a Google Slides presentation"`
AddSlide SlidesAddSlideCmd `cmd:"" name:"add-slide" help:"Add a slide with a full-bleed image and optional speaker notes"`
NewSlide SlidesNewSlideCmd `cmd:"" name:"new-slide" help:"Create a native themed slide"`
DuplicateSlide SlidesDuplicateSlideCmd `cmd:"" name:"duplicate-slide" help:"Duplicate a slide by object ID"`
MoveSlide SlidesMoveSlideCmd `cmd:"" name:"move-slide" help:"Move a slide to a zero-based insertion index"`
ListSlides SlidesListSlidesCmd `cmd:"" name:"list-slides" help:"List all slides with their object IDs"`
DeleteSlide SlidesDeleteSlideCmd `cmd:"" name:"delete-slide" help:"Delete a slide by object ID"`
ReadSlide SlidesReadSlideCmd `cmd:"" name:"read-slide" help:"Read slide content: speaker notes, text elements, and images"`
Expand Down
Loading
Loading