feat(slides): add create-from-template command with text replacement#273
Closed
penguinco wants to merge 1 commit intoopenclaw:mainfrom
Closed
feat(slides): add create-from-template command with text replacement#273penguinco wants to merge 1 commit intoopenclaw:mainfrom
penguinco wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Adds `gog slides create-from-template` command to create presentations
from templates with automatic placeholder text replacement.
Features:
- {{key}} placeholder format (auto-wrapped)
- Multiple replacement sources: --replace flags and --replacements JSON file
- Type conversion for JSON (numbers, booleans → strings)
- --exact flag for arbitrary string replacement
- Replacement statistics in output
- JSON/text output modes
Implementation:
- Copy template via Drive API
- Batch text replacement via Slides API ReplaceAllText
- Comprehensive error handling and validation
- 7 test cases covering all features and edge cases
Usage: gog slides create-from-template <templateId> <title> \
--replace "key=value" \
--replacements data.json
Co-authored-by: Cursor <cursoragent@cursor.com>
steipete
added a commit
that referenced
this pull request
Mar 8, 2026
steipete
added a commit
that referenced
this pull request
Mar 8, 2026
Collaborator
Collaborator
|
Landed directly on main from a current-main rebase.
Thanks @penguinco! |
klodr
pushed a commit
to klodr/gogcli
that referenced
this pull request
Apr 22, 2026
klodr
pushed a commit
to klodr/gogcli
that referenced
this pull request
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new
gog slides create-from-templatecommand that creates Google Slides presentations from templates with automatic placeholder text replacement using the Slides API'sReplaceAllTextfeature.Features
Core Functionality
{{key}}placeholder format (auto-wrapped)Replacement Options
--replace "key=value"— Command-line replacements (repeatable)--replacements file.json— JSON file with multiple replacements--exact— Match exact strings without{{}}wrappingAdditional Features
--parentflag to organize in specific folderUsage Examples
Output
Text Output
JSON Output
{ "presentationId": "1new456presentation", "name": "Q1 Report", "link": "https://docs.google.com/...", "replacements": { "quarter": 3, "revenue": 2, "growth": 1 } }Technical Implementation
Files.Copyto duplicate the templateReplaceAllTextin batch for all placeholdersFiles Changed
internal/cmd/slides_create_from_template.gointernal/cmd/slides_create_from_template_test.gointernal/cmd/slides.godocs/slides-template-replacement.mdREADME.mdTesting
All tests pass ✅ (7/7):
Use Cases
Documentation
See
docs/slides-template-replacement.mdfor:Related: Similar to
gog docs find-replacebut for Slides and template-basedMade with Cursor