SlideForge

Getting Started

CLI reference

The slideforge command creates, builds, previews, exports, and validates presentations.

Commands

Build the repository first, then run the emitted entry point. Paths are relative to the current directory. -o aliases --output.

CLI commands
CommandPurpose
init [file]Copy the six-layout example and its assets; never overwrites
build <json> [-o html]Validate JSON and write an HTML document with inline CSS
preview <json> [--port n]Serve a loopback Vite preview that reloads on save, port 5180 by default
export <input> -o pptxExport JSON, local HTML, or a trusted URL to PPTX
validate <pptx>Print an offline structural report as JSON

Export input

Slides are found with [data-pptx="slide"], .slide by default. Use --selector for your own trusted HTML. The output directory must already exist.

node dist/cli/index.js export slides.html --output slides.pptx --selector '.deck-page'
node dist/cli/index.js export http://127.0.0.1:5180/ --output preview.pptx

Exit codes

Warnings alone never fail a command.

Exit codes
CodeMeaning
0Success, including help
1Operation failed, invalid content, or invalid PPTX
2Invalid usage, such as a missing --output or invalid port

Run in Docker

The image bundles Node.js, the pinned Chromium, and Noto CJK and Liberation fonts, so you do not install them yourself. Compose mounts the repository root at /work, or the folder in SLIDEFORGE_WORK, and the CLI arguments follow cli. Paths are container paths under /work.

docker compose -f docker/compose.yaml --profile cli run --rm --build cli export /work/examples/basic/presentation.json --output /work/presentation.pptx
docker compose -f docker/compose.yaml --profile cli run --rm cli validate /work/presentation.pptx
Container guide