Manage Google Slides presentations. Create presentations, add/delete slides, insert text, shapes, and images. Use when working with Google Slides presentation management.
Resources
3Install
npx skillscat add odyssey4me/agent-skills/google-slides Install via the SkillsCat registry.
Google Slides
Interact with Google Slides for presentation creation, slide management, and content insertion.
Installation
Install Python dependencies:
pip install --user google-auth google-auth-oauthlib google-api-python-client keyring pyyamlDownload the skill from Releases or use directly from this repository.
Setup Verification
After installation, verify the skill is properly configured:
python scripts/google-slides.py checkThis will check:
- Python dependencies (google-auth, google-auth-oauthlib, google-api-python-client, keyring, pyyaml)
- Authentication configuration
- Connectivity to Google Slides API
If anything is missing, the check command will provide setup instructions.
Authentication
Google Slides uses OAuth 2.0 for authentication. For complete setup instructions, see:
- GCP Project Setup Guide - Create project, enable Slides API
- Google OAuth Setup Guide - Configure credentials
Quick Start
Create
~/.config/agent-skills/google.yaml:oauth_client: client_id: your-client-id.apps.googleusercontent.com client_secret: your-client-secretRun
python scripts/google-slides.py checkto trigger OAuth flow and verify setup.
OAuth Scopes
The skill requests granular scopes for different operations:
| Scope | Permission | Used For |
|---|---|---|
presentations.readonly |
Read presentations | Reading presentation metadata and content |
presentations |
Full access | Creating and modifying presentations |
drive.readonly |
Read Drive files | Exporting presentations as PDF |
Scope Errors
If you encounter "insufficient scope" errors, reset your token and re-authenticate:
- Reset token:
python scripts/google-slides.py auth reset - Re-run:
python scripts/google-slides.py check
Commands
check
Verify configuration and connectivity.
python scripts/google-slides.py checkThis validates:
- Python dependencies are installed
- Authentication is configured
- Can connect to Google Slides API
- Creates a test presentation to verify write access
auth setup
Store OAuth 2.0 client credentials for custom OAuth flow.
python scripts/google-slides.py auth setup \
--client-id YOUR_CLIENT_ID \
--client-secret YOUR_CLIENT_SECRETCredentials are saved to ~/.config/agent-skills/google-slides.yaml.
Options:
--client-id- OAuth 2.0 client ID (required)--client-secret- OAuth 2.0 client secret (required)
auth reset
Clear stored OAuth token. The next command that needs authentication will trigger re-authentication automatically.
python scripts/google-slides.py auth resetUse this when you encounter scope or authentication errors.
auth status
Show current OAuth token information without making API calls.
python scripts/google-slides.py auth statusDisplays: whether a token is stored, granted scopes, refresh token presence, token expiry, and client ID.
presentations create
Create a new Google Slides presentation.
python scripts/google-slides.py presentations create --title "My Presentation"Options:
--title- Presentation title (required)
Example:
python scripts/google-slides.py presentations create --title "Q4 Review"
# Output:
# ✓ Presentation created successfully
# Title: Q4 Review
# Presentation ID: 1abc...xyz
# Slides: 1
# URL: https://docs.google.com/presentation/d/1abc...xyz/editpresentations get
Get presentation metadata and structure.
python scripts/google-slides.py presentations get PRESENTATION_IDArguments:
presentation_id- The Google Slides presentation ID
Example:
python scripts/google-slides.py presentations get 1abc...xyz
# Output:
# Title: Q4 Review
# Presentation ID: 1abc...xyz
# Slides: 5
# URL: https://docs.google.com/presentation/d/1abc...xyz/edit
#
# Slides:
# Slide 1:
# ID: slide_id_1
# Layout: TITLE
# Elements: 2 (2 text, 0 shapes, 0 images, 0 other)
# Slide 2:
# ID: slide_id_2
# Layout: TITLE_AND_BODY
# Elements: 3 (2 text, 1 shapes, 0 images, 0 other)presentations read
Read presentation text content from all slides, or export as PDF.
python scripts/google-slides.py presentations read PRESENTATION_IDArguments:
presentation_id- The Google Slides presentation ID
Options:
--format- Output format:text(default) orpdf--output,-o- Output file path (used with pdf format)
Example:
# Read as text (default)
python scripts/google-slides.py presentations read 1abc...xyz
# Export as PDF
python scripts/google-slides.py presentations read 1abc...xyz --format pdf --output presentation.pdf
# Output (text format):
# --- Slide 1 ---
# Welcome to Our Product
# An introduction to key features
#
# --- Slide 2 ---
# Key Metrics
# Revenue: $1.2M
# Users: 50,000
#
# --- Slide 3 ---
# | Quarter | Revenue | Growth |
# | --- | --- | --- |
# | Q1 | $250K | 10% |
# | Q2 | $300K | 20% |Note: Text format extracts text from all shapes, text boxes, and tables on each slide (tables formatted as markdown). PDF export uses Google's native Drive API export, which requires the drive.readonly scope.
slides create
Add a new slide to a presentation.
python scripts/google-slides.py slides create PRESENTATION_ID --layout BLANKArguments:
presentation_id- The Google Slides presentation ID
Options:
--layout- Slide layout (default: BLANK)BLANK- Empty slideTITLE- Title slideTITLE_AND_BODY- Title and body textTITLE_ONLY- Title onlySECTION_HEADER- Section headerSECTION_TITLE_AND_DESCRIPTION- Section with descriptionONE_COLUMN_TEXT- Single column of textMAIN_POINT- Large centered textBIG_NUMBER- Large number display
--index- Insert at specific position (0-based, optional)
Example:
# Add blank slide at the end
python scripts/google-slides.py slides create 1abc...xyz --layout BLANK
# Add title slide at position 0
python scripts/google-slides.py slides create 1abc...xyz --layout TITLE --index 0
# Output:
# ✓ Slide created successfully
# Slide ID: slide_abc123
# Layout: TITLESee references/layouts-guide.md for layout details.
slides delete
Delete a slide from a presentation.
python scripts/google-slides.py slides delete PRESENTATION_ID --slide-id SLIDE_IDArguments:
presentation_id- The Google Slides presentation ID
Options:
--slide-id- Slide object ID to delete (required, not the index!)
Example:
# Get slide IDs first
python scripts/google-slides.py presentations get 1abc...xyz
# Delete a slide
python scripts/google-slides.py slides delete 1abc...xyz --slide-id slide_abc123
# Output:
# ✓ Slide deleted successfullyWarning: Cannot delete the last remaining slide in a presentation.
text insert
Insert text into a slide.
python scripts/google-slides.py text insert PRESENTATION_ID \
--slide-id SLIDE_ID \
--text "Hello World"Arguments:
presentation_id- The Google Slides presentation ID
Options:
--slide-id- Slide object ID (required)--text- Text to insert (required)--x- X position in points (default: 100)--y- Y position in points (default: 100)--width- Text box width in points (default: 400)--height- Text box height in points (default: 100)
Example:
# Insert text at default position
python scripts/google-slides.py text insert 1abc...xyz \
--slide-id slide_abc123 \
--text "Hello World"
# Insert text at custom position
python scripts/google-slides.py text insert 1abc...xyz \
--slide-id slide_abc123 \
--text "Q4 Results" \
--x 50 --y 50 --width 500 --height 80
# Output:
# ✓ Text inserted successfully
# Text: Q4 Results
# Position: (50.0, 50.0) points
# Size: 500.0 x 80.0 pointsNote: Coordinates are in points (1 point = 1/72 inch). Origin (0,0) is top-left.
shapes create
Create a shape on a slide.
python scripts/google-slides.py shapes create PRESENTATION_ID \
--slide-id SLIDE_ID \
--shape-type RECTANGLEArguments:
presentation_id- The Google Slides presentation ID
Options:
--slide-id- Slide object ID (required)--shape-type- Shape type (required)RECTANGLE,ELLIPSE,TRIANGLE,PENTAGON,HEXAGONSTAR_5,STAR_8,STAR_24,STAR_32CLOUD,HEART,LIGHTNING_BOLT,MOON,SUNARROW_NORTH,ARROW_EAST,ARROW_SOUTH,ARROW_WEST- And many more (see references/shapes-guide.md)
--x- X position in points (default: 100)--y- Y position in points (default: 100)--width- Shape width in points (default: 200)--height- Shape height in points (default: 200)
Example:
# Create rectangle
python scripts/google-slides.py shapes create 1abc...xyz \
--slide-id slide_abc123 \
--shape-type RECTANGLE
# Create star with custom size
python scripts/google-slides.py shapes create 1abc...xyz \
--slide-id slide_abc123 \
--shape-type STAR_5 \
--x 300 --y 200 --width 150 --height 150
# Output:
# ✓ Shape created successfully
# Type: STAR_5
# Position: (300.0, 200.0) points
# Size: 150.0 x 150.0 pointsSee references/shapes-guide.md for all shape types.
images create
Insert an image into a slide.
python scripts/google-slides.py images create PRESENTATION_ID \
--slide-id SLIDE_ID \
--image-url "https://example.com/image.png"Arguments:
presentation_id- The Google Slides presentation ID
Options:
--slide-id- Slide object ID (required)--image-url- Image URL (required, must be publicly accessible)--x- X position in points (default: 100)--y- Y position in points (default: 100)--width- Image width in points (default: 300)--height- Image height in points (default: 200)
Example:
python scripts/google-slides.py images create 1abc...xyz \
--slide-id slide_abc123 \
--image-url "https://example.com/chart.png" \
--x 50 --y 150 --width 400 --height 300
# Output:
# ✓ Image created successfully
# URL: https://example.com/chart.png
# Position: (50.0, 150.0) points
# Size: 400.0 x 300.0 pointsNote: The image URL must be publicly accessible or authenticated with Google.
Examples
Create a simple presentation
# Create presentation (note the presentation ID from the output)
python scripts/google-slides.py presentations create --title "Team Update"
# Get the default slide ID (note the slide ID from the output)
python scripts/google-slides.py presentations get $PRES_ID
# Add title text
python scripts/google-slides.py text insert $PRES_ID \
--slide-id $SLIDE_ID \
--text "Q4 Team Update" \
--x 50 --y 50 --width 600 --height 100
# Add subtitle
python scripts/google-slides.py text insert $PRES_ID \
--slide-id $SLIDE_ID \
--text "December 2024" \
--x 50 --y 180 --width 600 --height 50Build a multi-slide presentation
#!/bin/bash
PRES_ID="your-presentation-id"
# Add content slide (note the slide ID from the output)
python scripts/google-slides.py slides create $PRES_ID --layout TITLE_AND_BODY
# Add title
python scripts/google-slides.py text insert $PRES_ID \
--slide-id $SLIDE_ID \
--text "Key Metrics" \
--x 50 --y 30 --width 600 --height 60
# Add chart image
python scripts/google-slides.py images create $PRES_ID \
--slide-id $SLIDE_ID \
--image-url "https://example.com/metrics.png" \
--x 100 --y 120 --width 500 --height 350
# Add another slide with shapes (note the slide ID from the output)
python scripts/google-slides.py slides create $PRES_ID --layout BLANK
# Add decorative shape
python scripts/google-slides.py shapes create $PRES_ID \
--slide-id $SLIDE2_ID \
--shape-type STAR_5 \
--x 550 --y 30 --width 80 --height 80Create presentation from data
#!/bin/bash
# Create presentation (note the presentation ID from the output)
python scripts/google-slides.py presentations create --title "Sales Report"
# Add a slide for each region (note the slide ID from each output)
python scripts/google-slides.py slides create $PRES_ID --layout TITLE_AND_BODY
# Insert text on each slide using the slide ID from the output above
python scripts/google-slides.py text insert $PRES_ID \
--slide-id $SLIDE_ID \
--text "North Region Sales" \
--x 50 --y 30 --width 600 --height 80Coordinate System
Google Slides uses points for positioning and sizing:
- 1 point = 1/72 inch
- 1 inch = 72 points
- Origin (0, 0) is at the top-left corner
- Standard slide size: 720 x 540 points (10 x 7.5 inches)
Common reference positions:
(0, 0) (720, 0)
┌───────────────────────────────────────┐
│ Title area │
│ (50, 50, 620, 80) │
│ │
│ Content area │
│ (50, 150, 620, 350) │
│ │
│ │
└───────────────────────────────────────┘
(0, 540) (720, 540)Error Handling
Authentication and scope errors are not retryable. If a command fails with an authentication error, insufficient scope error, or permission denied error (exit code 1), do NOT retry the same command. Instead:
- Inform the user about the error
- Run
python scripts/google-slides.py auth statusto check the current token state - Suggest the user run
python scripts/google-slides.py auth resetfollowed bypython scripts/google-slides.py checkto re-authenticate - The
auth resetandcheckcommands require user interaction (browser-based OAuth consent) and cannot be completed autonomously
Retryable errors: Rate limiting (HTTP 429) and temporary server errors (HTTP 5xx) may succeed on retry after a brief wait. All other errors should be reported to the user.
Model Guidance
This skill makes API calls requiring structured input/output. A standard-capability model is recommended.
Troubleshooting
Authentication failed
- Verify your OAuth client ID and client secret are correct in
~/.config/agent-skills/google-slides.yaml - Token expired or corrupted — reset and re-authenticate:
python scripts/google-slides.py auth reset python scripts/google-slides.py check
Permission denied
Your OAuth token may not have the necessary scopes. Reset your token and re-authenticate:
python scripts/google-slides.py auth reset
python scripts/google-slides.py checkCannot find presentation
Make sure you're using the correct presentation ID from the URL:
- URL:
https://docs.google.com/presentation/d/1abc...xyz/edit - Presentation ID:
1abc...xyz
Cannot find slide ID
Slide IDs are object IDs, not indices. Get them with:
python scripts/google-slides.py presentations get $PRES_IDImage not appearing
The image URL must be:
- Publicly accessible (no authentication required), OR
- Accessible to the Google account you're using
Test the URL in a browser. If it requires authentication, you'll need to:
- Upload the image to Google Drive
- Make it publicly accessible or share it with your Google account
- Use the Google Drive URL
Slide position/size issues
Remember:
- Coordinates are in points, not pixels
- Standard slide: 720 x 540 points
- Elements outside slide boundaries won't be visible
- Use
--x,--y,--width,--heightto position elements
Dependencies not found
Install required dependencies:
pip install --user google-auth google-auth-oauthlib google-api-python-client keyring pyyamlOAuth flow fails
Ensure your GCP project has:
- Google Slides API enabled (
slides.googleapis.com) - OAuth 2.0 credentials created
- OAuth consent screen configured
- Your email added as a test user (if app is in testing mode)
See docs/gcp-project-setup.md for detailed instructions.
Related Skills
- Google Drive - File management (Drive manages file metadata, Slides manages content)
- Google Docs - Document creation and editing
- Google Sheets - Spreadsheet management
API Reference
For advanced usage, see: