Commands to create, read and edit Google Slides presentations using the Slides API
This package provides aux4 command wrappers for the Google Slides API v1. It covers creating presentations, reading a presentation or a single page (slide), and applying batch updates that add slides, insert text, shapes, images, and more.
Authentication is handled by community/google-auth, which stores a single OAuth2 token shared by every aux4 Google package.
aux4 aux4 pkger install community/google-slides
This package requires:
batch-updatebrew install jqapt install jqAuthenticate once with community/google-auth. The scopes are resolved from the installed Google service packages, so no --scopes flag is needed:
aux4 google auth login
This package requests https://www.googleapis.com/auth/presentations, which grants full create, read and edit access. For read-only use, request the narrower scope:
aux4 google auth login --readonly true
The read-only scope (https://www.googleapis.com/auth/presentations.readonly) is enough for get and pages get, but create and batch-update need the full presentations scope.
Check the current state at any time:
aux4 google auth status
Create a presentation:
aux4 google slides create --title "Quarterly Review"
Read it back (use the presentationId from the create response):
aux4 google slides get 1a2b3c4d5e6f
Read a single page (slide):
aux4 google slides pages get 1a2b3c4d5e6f --pageObjectId p1
Create a new, empty presentation with a title:
aux4 google slides create --title "Team Onboarding"
The response includes the generated presentationId, the default slide layout, and the master and layout definitions Google created for you. Store the presentationId — every other command needs it.
Fetch the full presentation, including every page, page element, and its properties:
aux4 google slides get 1a2b3c4d5e6f
Fetch a single page by its object ID:
aux4 google slides pages get 1a2b3c4d5e6f --pageObjectId p1
The page object ID for the first slide is usually p or p1; you can find every page's objectId in the output of aux4 google slides get.
The batch-update command sends a batchUpdate request with a raw JSON array of update operations. This is the primary way to change a presentation — add slides, insert text, create shapes, replace images, and more. The array is wrapped in a {"requests": [...]} envelope automatically.
Add a blank slide:
aux4 google slides batch-update 1a2b3c4d5e6f --requests '[{"createSlide":{}}]'
Insert text into an existing shape:
aux4 google slides batch-update 1a2b3c4d5e6f --requests '[{"insertText":{"objectId":"textbox1","text":"Hello, Sally!","insertionIndex":0}}]'
Multiple operations run in order within a single request:
aux4 google slides batch-update 1a2b3c4d5e6f --requests '[{"createSlide":{"objectId":"slide2"}},{"createShape":{"objectId":"box1","shapeType":"TEXT_BOX","elementProperties":{"pageObjectId":"slide2"}}}]'
See the Slides API request reference for the full list of supported operations.
The presentation ID is the long identifier in the presentation URL:
https://docs.google.com/presentation/d/1a2b3c4d5e6f/edit
^^^^^^^^^^^^
It is also returned as presentationId when you run aux4 google slides create.
AUX4_GOOGLE_TOKEN_FILE — where the shared Google OAuth token lives. Defaults to ~/.aux4.config/.oauth/google.json, the same location aux4 google auth login writes to, so it normally needs no setting.For the optional integration test group, set SLIDES_PRESENTATION_ID to a presentation the authenticated account can read.
MIT — See LICENSE for details.