Skip to content

CLI Reference

Complete reference for the SlideGen command-line interface.

Overview

SlideGen provides a CLI tool for common tasks:

  • Initialize new projects
  • Validate schemas
  • Build presentations
  • List available layouts

Installation

Install SlideGen to get the CLI:

pip install slidegen

Verify installation:

slidegen --version

Commands

slidegen init

Create a new SlideGen project with sample files.

Usage:

slidegen init [OPTIONS] <project-name>

Options:

Option Description
--help Show help message and exit

Example:

slidegen init my-presentation

Creates:

my-presentation/
├── deck.yaml          # Sample schema file
└── README.md          # Project documentation

Sample deck.yaml:

presentation:
  title: "My First Presentation"
  slides:
    - layout: title
      title: "Welcome to SlideGen"
      subtitle: "Your AI-powered slide generator"

    - layout: bullet_list
      title: "Features"
      bullets:
        - "Easy to use"
        - "AI-friendly"
        - "Professional output"

slidegen validate

Validate a schema file for errors.

Usage:

slidegen validate [OPTIONS] <schema-file>

Options:

Option Description
--verbose, -v Show detailed error messages
--help Show help message and exit

Example:

# Basic validation
slidegen validate deck.yaml

# Verbose output
slidegen validate deck.yaml --verbose

Output:

  • Success: No output (exit code 0)
  • Errors: List of validation errors with suggestions

Example Error Output:

Validation failed:
- slides[2].layout: Invalid layout type 'invalid_layout'
  Suggestion: Use one of: title, bullet_list, chart, table, ...
- slides[3].title: Required field 'title' is missing

slidegen build

Generate a PowerPoint presentation from a schema file.

Usage:

slidegen build [OPTIONS] <schema-file>

Options:

Option Description
--output, -o Output file path (required)
--watch, -w Watch mode: rebuild on file changes
--verbose, -v Show detailed progress
--help Show help message and exit

Example:

# Basic build
slidegen build deck.yaml -o output.pptx

# Watch mode (auto-rebuild on changes)
slidegen build deck.yaml -o output.pptx --watch

# Verbose output
slidegen build deck.yaml -o output.pptx --verbose

Watch Mode:

Watch mode monitors the schema file and data files for changes, automatically rebuilding the presentation:

slidegen build deck.yaml -o output.pptx --watch

Press Ctrl+C to stop watching.

Progress Output:

With --verbose, shows rendering progress:

Loading schema: deck.yaml
Validating schema... ✓
Rendering slide 1/5 (title)... ✓
Rendering slide 2/5 (bullet_list)... ✓
Rendering slide 3/5 (chart)... ✓
Rendering slide 4/5 (table)... ✓
Rendering slide 5/5 (section_header)... ✓
Saving presentation to output.pptx... ✓
Done!

slidegen layouts

List all available layout types with examples.

Usage:

slidegen layouts [OPTIONS]

Options:

Option Description
--help Show help message and exit

Example:

slidegen layouts

Output:

Available Layouts:

1. title
   Title slide with title and optional subtitle
   Example:
     - layout: title
       title: "Welcome"
       subtitle: "Introduction"

2. section_header
   Full-slide section divider
   Example:
     - layout: section_header
       text: "Part 1"

3. bullet_list
   Title with bullet points
   Example:
     - layout: bullet_list
       title: "Key Points"
       bullets:
         - "Point 1"
         - "Point 2"

... (continues for all layouts)

Global Options

These options are available for all commands:

Option Description
--version Show version number and exit
--help Show help message and exit

Exit Codes

  • 0 - Success
  • 1 - Error (validation failed, file not found, etc.)
  • 2 - Usage error (invalid arguments)

Common Workflows

Workflow 1: New Project

# 1. Initialize project
slidegen init my-presentation

# 2. Edit schema
vim my-presentation/deck.yaml

# 3. Validate
slidegen validate my-presentation/deck.yaml

# 4. Build
slidegen build my-presentation/deck.yaml -o my-presentation.pptx

Workflow 2: Iterative Development

# Start watch mode
slidegen build deck.yaml -o output.pptx --watch

# Edit deck.yaml in another terminal
# Presentation rebuilds automatically

Workflow 3: Validation Before Build

# Validate first
slidegen validate deck.yaml

# If validation passes, build
if [ $? -eq 0 ]; then
    slidegen build deck.yaml -o output.pptx
fi

Environment Variables

Variable Description
SLIDEGEN_LOG_LEVEL Logging level: DEBUG, INFO, WARNING, ERROR

Example:

export SLIDEGEN_LOG_LEVEL=DEBUG
slidegen build deck.yaml -o output.pptx

Troubleshooting

Command Not Found

Error: slidegen: command not found

Solutions: - Verify installation: pip show slidegen - Check PATH includes Python scripts directory - Reinstall: pip install --upgrade slidegen

Permission Denied

Error: Permission denied

Solutions: - Use virtual environment (recommended) - Install with --user: pip install --user slidegen - Check file permissions

File Not Found

Error: FileNotFoundError: deck.yaml

Solutions: - Check current directory: pwd - Verify file path: ls deck.yaml - Use absolute path: slidegen build /full/path/to/deck.yaml -o output.pptx

Next Steps