G

Gws Slides Processor

All-in-one command covering google, slides, read, write. Includes structured workflows, validation checks, and reusable patterns for google workspace.

CommandClipticsgoogle workspacev1.0.0MIT
0 views0 copies

GWS Slides Processor

Process Google Slides presentations -- create decks, retrieve slide content, apply batch updates, and extract page-level data through the GWS CLI.

When to Use This Command

Run this command when you need to create, read, or modify Google Slides presentations programmatically.

  • You need to create a new blank presentation with a specific title
  • You want to retrieve the full content of an existing presentation for analysis
  • You are applying batch updates to modify slide layouts, text, or images
  • You need to extract content from individual pages for processing or conversion

Use it also when:

  • You are building an automation pipeline that generates slide decks from data
  • You need to programmatically update placeholder text or images in a template deck

Quick Start

# .claude/commands/gws-slides-processor.md name: gws-slides-processor description: Process Google Slides presentations via CLI arguments: operation: The Slides operation to execute
# Get the contents of a presentation claude gws-slides-processor "presentations get --params '{\"presentationId\": \"1abc123def456\"}'"
Expected output:
{
  "presentationId": "1abc123def456",
  "title": "Q1 Review",
  "slides": [
    { "objectId": "p", "pageType": "SLIDE" },
    { "objectId": "p1", "pageType": "SLIDE" }
  ],
  "pageSize": { "width": { "magnitude": 9144000 } }
}

Core Concepts

ConceptDescription
PresentationA Google Slides document identified by its unique ID
Page / SlideAn individual slide within a presentation
Batch UpdateAtomic set of changes applied to a presentation
Page ElementObjects on a slide: text boxes, images, shapes, tables
Object IDUnique identifier for each element within a presentation
Slides Structure:
  Presentation
       │
       ā”œā”€ā”€ Slide 1 (objectId: "p")
       │     ā”œā”€ā”€ TextBox (objectId: "tb1")
       │     └── Image   (objectId: "img1")
       │
       ā”œā”€ā”€ Slide 2 (objectId: "p1")
       │     ā”œā”€ā”€ Shape   (objectId: "s1")
       │     └── Table   (objectId: "tbl1")
       │
       └── Slide N ...

Configuration

ParameterDefaultDescription
presentationIdrequiredThe ID of the target presentation
formatjsonOutput format: json, table, yaml, csv
dry-runfalseValidate batch updates without applying them
paramsnoneURL parameters as JSON string
jsonnoneRequest body for batch updates

Best Practices

  1. Use get before batchUpdate -- Always retrieve the current presentation state to understand existing object IDs and page structure before applying updates.

  2. Reference objects by ID, not index -- Slides uses objectId for all element references. Relying on slide order is fragile; always use the stable object identifier.

  3. Apply all updates in a single batchUpdate -- Each batchUpdate is atomic. Group related changes together to ensure consistency and reduce API calls.

  4. Provide a presentationId when creating -- While optional, specifying a presentationId during creation gives you a predictable identifier for subsequent operations.

  5. Use dry-run for complex batch updates -- Before applying a large batch of slide modifications, validate the request structure with --dry-run to catch errors early.

Common Issues

  1. Object ID not found in batchUpdate -- The referenced objectId does not exist in the presentation. Re-fetch the presentation to get current object IDs.

  2. Batch update request validation errors -- Each request in the batch is validated before any are applied. A single invalid request causes the entire batch to fail. Check error details for the specific failing request.

  3. Insufficient permissions for presentation -- The authenticated user needs Editor access to apply batch updates. Viewer access only allows get operations. Check sharing settings in the Google Slides UI or use the Drive API to verify permissions programmatically.

Working with Page Elements

When modifying slide content through batch updates, understanding the page element hierarchy is essential. Each slide contains page elements such as text boxes, images, shapes, and tables, each identified by a unique objectId. To replace placeholder text, use the replaceAllText request type which searches across all slides. To modify a specific element, use requests like updateTextStyle, updateShapeProperties, or replaceImage with the target element's objectId. Always retrieve the presentation first with presentations get to map out the current element structure before constructing your batch update payload.

Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates