A lightweight, cross-platform Microsoft® PowerPoint manipulation toolkit. Inspect and modify theme colors, theme metadata, fonts, and slide layouts without unpacking the file yourself.
pptx-toolkit reads PowerPoint files and manipulates color references, theme metadata, font schemes, and layout metadata throughout slides, layouts, and masters. You can:
- Swap between scheme colors (like
accent1,accent5) and hex RGB values (likeAABBCC,FF0000) - Inspect and rename theme names — the human-readable names PowerPoint shows for slide masters
- Inspect and rename theme colour scheme names
- Inspect and set theme fonts — the major (headings) and minor (body) typefaces defined in each theme
- Inspect slide layouts — both name fields, master/theme relationships, and which slides use each layout
- Set or remove slide layout metadata such as
nameandmatchingName
It supports atomic many-to-one color mappings and theme filtering, making it easy to rebrand presentations or fix specific hex colors across your deck.
# Install latest release
curl -sSL https://raw.githubusercontent.com/pmdci/pptx-toolkit/main/install.sh | bashgit clone https://github.com/pmdci/pptx-toolkit
cd pptx-toolkit
make build
make install # copies to ~/.local/binDownload pre-built binaries from the releases page.
Binaries are available for:
- macOS: ARM64, Intel (AMD64)
- Linux: ARM64, AMD64
- Windows: ARM64, AMD64
macOS Users: Downloaded binaries may be blocked by Gatekeeper. After downloading, run:
xattr -d com.apple.quarantine pptx-toolkitOr alternatively:
codesign -s - pptx-toolkitView the high-level theme inventory in a PowerPoint file, including each theme's color scheme name, font scheme name, and which masters reference it.
pptx-toolkit theme list presentation.pptxFilter to specific theme files:
pptx-toolkit theme list presentation.pptx --theme theme1,theme2Example output:
Found 3 theme(s) in presentation.pptx:
━━━ theme1.xml ━━━
Theme: Simple Light
Color Scheme: Simple Light
Font Scheme: Soho
Bindings:
Slide master: slideMaster1.xml
━━━ theme2.xml ━━━
Theme: Default
Color Scheme: Default
Font Scheme: Office
Bindings:
Notes master: notesMaster1.xml
━━━ theme3.xml ━━━
Theme: Office Theme
Color Scheme: Office
Font Scheme: Office
Bindings:
Handout master: handoutMaster1.xml
Rename the human-readable theme name shown by PowerPoint for a slide master:
This is the CLI equivalent of renaming a slide master in PowerPoint; PowerPoint persists that UI rename as the theme name in the PPTX.
# Rename one slide-master-bound theme
pptx-toolkit theme set input.pptx output.pptx --theme theme2 --name "Contoso Blue II Deck"
# The theme filter also accepts the .xml suffix
pptx-toolkit theme set input.pptx output.pptx --theme theme2.xml --name "AdventureWorks Deck"Notes:
--themeis required and must resolve to exactly one theme- only slide-master-bound themes can be renamed; notes and handout themes are rejected
- names must be non-empty; XML-sensitive characters are preserved and written safely
- when
docProps/app.xmlis present, the command keeps its theme metadata in sync
View all themes and their color schemes in a PowerPoint file:
pptx-toolkit theme color list presentation.pptxFilter to specific theme files:
pptx-toolkit theme color list presentation.pptx --theme theme1,theme2Example output:
Found 2 theme(s) in presentation.pptx:
━━━ theme1.xml ━━━
Theme: Office Theme Deck
Color Scheme: Office
Colors:
dk1 (Dark 1): #000000
lt1 (Light 1): #FFFFFF
accent1 (Accent 1): #156082
accent2 (Accent 2): #E97132
accent3 (Accent 3): #196B24
...
View the font scheme (major/heading and minor/body typefaces) for every theme in a file:
pptx-toolkit theme font list presentation.pptxFilter to a specific theme:
pptx-toolkit theme font list presentation.pptx --theme theme1Example output:
Found 2 theme(s) in presentation.pptx:
━━━ theme1.xml ━━━
Theme: Office Theme Deck
Font Scheme: Office
Fonts:
major (headings): Aptos Display
minor (body): Aptos
━━━ theme2.xml ━━━
Theme: Blue II Deck
Font Scheme: Office
Fonts:
major (headings): Aptos Display
minor (body): Aptos
Update the heading font, body font, or font scheme name in one or more themes:
# Set both fonts in all themes
pptx-toolkit theme font set input.pptx output.pptx --major "Arial" --minor "Times New Roman"
# Set only the heading font
pptx-toolkit theme font set input.pptx output.pptx --major "Calibri"
# Rename the font scheme
pptx-toolkit theme font set input.pptx output.pptx --scheme-name "Corporate"
# Target a specific theme only
pptx-toolkit theme font set input.pptx output.pptx --major "Arial" --theme theme1At least one of --major, --minor, or --scheme-name must be provided. Font names are passed through as-is — no validation against installed fonts.
Scheme names must be non-empty; XML-sensitive characters are preserved and written safely.
Inspect all slide layouts in a PowerPoint file, including both name fields, the slide master and theme each layout belongs to, and which slides use it.
PowerPoint stores two separate name fields per layout, which can differ:
- Name (
p:cSld/@name) — the layout name shown in Slide Master view - Matching Name (
p:sldLayout/@matchingName) — an optional name used in the New Slide / layout picker. Absent from layouts created by PowerPoint; present on layouts imported from other tools (e.g. Google Slides). When absent, PowerPoint falls back to Name in the picker too.
pptx-toolkit layout list presentation.pptxExample output:
Found 34 layout(s) in presentation.pptx:
━━━ slideLayout1.xml ━━━
Layout ID: slideLayout1
Name: Title Slide
Matching Name: <none>
Master: slideMaster1.xml
Theme: theme1.xml
Used By Slides: 1
━━━ slideLayout12.xml ━━━
Layout ID: slideLayout12
Name: matchName-test
Matching Name: Layout with matchName property
Master: slideMaster1.xml
Theme: theme1.xml
Used By Slides: none
Filters:
# By layout file
pptx-toolkit layout list presentation.pptx --layout-id slideLayout4
# By Name (p:cSld/@name) — exact, case-sensitive
pptx-toolkit layout list presentation.pptx --name "Title Slide"
# By Matching Name (p:sldLayout/@matchingName) — exact, case-sensitive
pptx-toolkit layout list presentation.pptx --matching-name "Contact Sheet"
# By theme
pptx-toolkit layout list presentation.pptx --theme theme1Remove the matchingName attribute (p:sldLayout/@matchingName) from slide layouts. Useful when importing from Google Slides or other tools that set this field and you want PowerPoint to fall back to using the standard Name field everywhere.
# Remove from all layouts
pptx-toolkit layout remove matching-name input.pptx output.pptx
# Remove from a specific layout
pptx-toolkit layout remove matching-name input.pptx output.pptx --layout-id slideLayout12
# Remove from layouts with a specific matching name
pptx-toolkit layout remove matching-name input.pptx output.pptx --matching-name "Contact Sheet"Supports the same --layout-id, --name, --matching-name, and --theme filters as layout list.
Set layout name (p:cSld/@name) or matching-name (p:sldLayout/@matchingName) across all matched layouts.
The mapping is directional:
- left side = source
- right side = target property
Use @name or @matching-name on the left to copy from an existing property. Any other left-side value is treated as a literal string.
# Copy name into matching-name for all layouts
pptx-toolkit layout set @name:matching-name input.pptx output.pptx
# Copy matching-name into name where present
pptx-toolkit layout set @matching-name:name input.pptx output.pptx
# Set a literal matching-name on one layout
pptx-toolkit layout set "Layout with matchName property":matching-name input.pptx output.pptx --layout-id slideLayout12Supports the same --layout-id, --name, --matching-name, and --theme filters as layout list.
Replace color references throughout the presentation. Supports both scheme colors (e.g., accent1) and hex RGB values (e.g., AABBCC).
Set the colour scheme name stored in one or more theme definitions:
# Rename in all themes
pptx-toolkit theme color set input.pptx output.pptx --scheme-name "Corporate Brand"
# Rename only selected themes
pptx-toolkit theme color set input.pptx output.pptx --scheme-name "Corporate Brand" --theme theme1,theme2Colour scheme names must be non-empty; XML-sensitive characters are preserved and written safely.
# Scheme to scheme
pptx-toolkit color swap accent1:accent3 input.pptx output.pptx
# Scheme to hex
pptx-toolkit color swap accent1:BBFFCC input.pptx output.pptx
# Hex to scheme
pptx-toolkit color swap AABBCC:accent2 input.pptx output.pptx
# Hex to hex
pptx-toolkit color swap FF0000:00FF00 input.pptx output.pptx
# Many-to-one mapping (atomic)
pptx-toolkit color swap "accent1:accent3,accent5:accent3" input.pptx output.pptx
# Mixed mappings (scheme + hex)
pptx-toolkit color swap "accent1:BBFFCC,000000:accent2,FF0000:00FF00" input.pptx output.pptxQuotes are optional for simple mappings without spaces, but recommended when the mapping contains spaces or multiple comma-separated entries.
Important: Replacements are atomic, not cascading. In the example above:
accent1becomesaccent3(NOTaccent4)accent3becomesaccent4
PowerPoint theme colors support tint and shade variants (lighter/darker versions). When swapping colors:
-
Scheme → Scheme: Tint/shade modifiers are preserved
# accent1 (80% lighter) becomes accent3 (80% lighter) pptx-toolkit color swap accent1:accent3 input.pptx output.pptx -
Scheme → Hex: Tint/shade modifiers are stripped (converted to base hex color)
# accent1 (80% lighter) becomes FF00FF (base color, no tint) # accent1 (40% darker) also becomes FF00FF (base color, no tint) pptx-toolkit color swap accent1:FF00FF input.pptx output.pptx
This is semantically correct: literal RGB hex values don't support tint/shade variations. All theme color variants (base, lighter, darker) are replaced with the same hex color.
Only process specific themes when a PowerPoint file contains multiple themes. Works with both scheme and hex color mappings:
# Process only theme1
pptx-toolkit color swap accent1:accent3 input.pptx output.pptx --theme theme1
# Filter by theme with hex colors
pptx-toolkit color swap "accent1:BBFFCC,000000:accent2" input.pptx output.pptx --theme theme1
# Process multiple themes
pptx-toolkit color swap accent1:accent3 input.pptx output.pptx --theme theme1,theme2Control whether color swaps apply to user content, master infrastructure, or both:
# Process everything (default behavior)
pptx-toolkit color swap accent1:accent3 input.pptx output.pptx
# Fix user overrides in content only (slides, charts, diagrams, notes)
pptx-toolkit color swap AABBCC:accent2 input.pptx output.pptx --scope content
# Update master template only (slideMasters, slideLayouts, notesMasters, handoutMasters)
pptx-toolkit color swap accent1:accent5 input.pptx output.pptx --scope master
# Combine scope and theme filtering
pptx-toolkit color swap accent1:accent3 input.pptx output.pptx --scope content --theme theme1Scope options:
all- Process all files (default)content- Process user content only (slides, charts, diagrams, notes)master- Process master infrastructure only (slideMasters, slideLayouts, notesMasters, handoutMasters)
Target specific slides for color swaps. Automatically includes embedded content (charts, diagrams, notes).
# Process specific slides
pptx-toolkit color swap accent1:accent3 input.pptx output.pptx --slides 1,3
# Process slide range
pptx-toolkit color swap accent1:accent3 input.pptx output.pptx --slides 5-8
# Combine ranges and individual slides
pptx-toolkit color swap accent1:accent3 input.pptx output.pptx --slides 1,3,5-8,10
# Combine with theme filtering
pptx-toolkit color swap accent1:accent3 input.pptx output.pptx --slides 1-5 --theme theme1Important: --slides can only be used with --scope content.
What gets processed:
- Specified slide files
- Charts embedded in those slides (including colors.xml, style.xml)
- Diagrams/SmartArt in those slides (all 5 files: data, layout, colors, quickStyle, drawing)
- Presenter notes for those slides
Scheme colors (PowerPoint theme colors):
- Text/Background:
dk1,lt1,dk2,lt2 - Accents:
accent1,accent2,accent3,accent4,accent5,accent6 - Hyperlinks:
hlink,folHlink
Hex RGB colors:
- 6-digit hex format (case-insensitive):
AABBCC,ff0000,00FF00 - Do NOT include the
#symbol
Most PowerPoint manipulation tools require heavy dependencies like Python, .NET, or Office interop libraries. pptx-toolkit is a single binary with no runtime dependencies that focuses on a narrow, practical set of PowerPoint editing tasks: swapping colour references, updating theme metadata, adjusting theme fonts, and inspecting or editing slide layout metadata, all while preserving document structure.
Key features:
- Cross-platform: Works on macOS, Linux, Windows (all ARM64/AMD64)
- Atomic replacement: Many-to-one mappings without cascading
- Theme filtering: Target specific themes in multi-theme presentations
- Fast: Instant startup, processes presentations in milliseconds
- Lightweight: Single binary (~2-5MB depending on platform)
- No dependencies: No Office, no Python, no runtime
Use cases:
- Rebrand presentations by swapping color schemes
- Rename theme and colour scheme metadata to match branded masters
- Update theme fonts across a deck without opening PowerPoint
- Replace hardcoded hex colors with theme colors for consistency
- Convert theme colors to specific hex values for brand compliance
- Unify color usage across multiple presentations
- Inspect or normalise slide layout names and matching names
- Fix accidental color misuse in slide decks
- Automate presentation styling in CI/CD pipelines
make build # Build optimised binary to bin/pptx-toolkit
make build-release # Build with maximum optimisation + UPX compression
make cross-compile # Build for all platforms (macOS/Linux/Windows on ARM64/AMD64)
make test # Run all tests
make clean # Clean build artifacts
make install # Copy binary to ~/.local/binThe build system includes several optimisations:
- Compiler flags:
-s -w -trimpath -extldflags=-Wl,--strip-allremove debug symbols and build paths - UPX compression: Automatically applied in
build-releaseandcross-compileif UPX is installed - Cross-platform: The Makefile handles UPX platform differences.
- macOS: UPX compression is officially unsupported (Apple code signing issues)
- Windows ARM64: UPX does not yet support Windows ARM64 PE format
Size comparison (typical results):
- Default Go build: ~5.4MB
- Optimised build: ~5.2MB
- With UPX (Linux/Windows AMD64): ~2.3MB (57% reduction)
Pull requests, bug reports, and feature suggestions are welcome!
Areas that could use help:
- Additional PowerPoint manipulation features (per-script font overrides, theme effects, etc.)
- Performance improvements for large presentations
- Additional output formats (JSON, YAML for color inspection)
GPL-3.0-or-later. See LICENSE file for details.
Copyright (C) 2025 Pedro Innecco
