Languages: English · 简体中文 · 繁體中文 · Français · Deutsch · Español · 日本語 · 한국어
Turn HTML into presentation-ready PPTX or PNG — from files, stdin, or URLs, directly from your terminal.
Build once in HTML, then use the same source across decks, visual assets, and automated presentation workflows.
DeckHTML fits workflows where content already lives in HTML or can be generated by code:
- Agent-generated presentations — let coding agents author HTML and produce deliverable PPTX or PNG outputs.
- Recurring reports — turn dashboards, metrics, and templated pages into presentation assets from CI or scheduled jobs.
- Web-to-deck reuse — convert hosted pages or ordered HTML files without rebuilding every slide manually.
- Local and cloud execution — run locally with no API key, or use cloud mode for hosted workflows and cloud-only enhancements.
Run without installing:
npx -y @deckflow/deckhtml@latest index.html -o deck.pptxnpm install -g @deckflow/deckhtml
deckhtml --versionConvert a single HTML file (output defaults to the same path and base name):
deckhtml index.html
# → index.pptxSpecify an output path:
deckhtml index.html -o deck.pptxPipe HTML from stdin:
cat index.html | deckhtml - -o deck.pptxConvert multiple HTML files in order:
deckhtml page1.html page2.html page3.html -o deck.pptxConvert a hosted page:
deckhtml https://example.com/deck.html -o deck.pptxOutput format is inferred from the -o extension:
| Format | Description |
|---|---|
pptx |
PowerPoint deck output (default) |
png |
PNG frame output |
deckhtml index.html -o frames.png| Mode | Description |
|---|---|
auto |
Use cloud when an API key is configured; otherwise run locally |
local |
Always run locally (no API key required) |
cloud |
Always run in the cloud (API key required) |
deckhtml index.html --mode local
deckhtml index.html --mode cloud -o deck.pptxThese flags require cloud mode:
| Flag | Description |
|---|---|
--embed-fonts |
Embed fonts into the output |
deckhtml index.html \
-o deck.pptx \
--mode cloud \
--embed-fontsLocal conversion works without an API key. Cloud mode can start as a rate-limited guest; sign in or configure an API key when prompted or when you need authenticated access.
deckhtml auth login
deckhtml auth status
deckhtml config set api-key <key>For CI, Docker, or agent environments, set the environment variable (takes precedence over stored credentials):
export DECKHTML_API_KEY=your-api-keyPersistent settings:
| Command | Description | Default |
|---|---|---|
deckhtml config set api-key <key> |
API key for cloud requests | — |
deckhtml config set size <size> |
PPTX dimensions | 1920x1080 |
deckhtml config set webhook <url> |
Default callback URL | — |
deckhtml config set retention-hours <n> |
Cloud file retention (hours) | 3 |
Credentials are stored locally at ~/.deckflow/credentials.
| Flag | Description | Default |
|---|---|---|
-h, --help |
Show help | — |
--version |
Show version | — |
-o, --output <path> |
Output path | Same base name as input |
-v, --verbose |
Detailed logs to stderr | false |
--quiet |
Only errors and final result | false |
--json |
Machine-readable JSON on stdout | false |
--report |
Generate a conversion report | Off |
--mode <mode> |
auto, local, or cloud |
auto |
--width <pixels> |
Playwright viewport width (height scales at 16:9) | 1920 |
--platform <platform> |
win, mac, ios, android, or linux |
Detected |
--embed-fonts |
Embed fonts (cloud only) | false |
--executable-path <path> |
Chromium binary for local conversion (else DECKHTML_CHROMIUM_EXECUTABLE_PATH env, then Playwright's bundle) |
— |
--exclude <selector> |
CSS selector matching runtime/navigation elements to exclude | — |
--identity-attribute <name> |
Attribute carrying a stable element identity (default: data-element-id) |
data-element-id |
--force |
Overwrite an existing output file (default: refuse) | false |
--quiet and --verbose cannot be used together. Output format is inferred from the -o extension (pptx or png).
deckhtml index.html -o deck.pptx --json{
"ok": true,
"input": ["index.html"],
"output": "deck.pptx",
"format": "pptx",
"mode": "local"
}Use the package as a library in Node.js. The library returns a Buffer (or PNG image buffers) — it never writes to disk on its own. Write the output yourself, or use the CLI for file output.
import { convertHtmlToPptx } from '@deckflow/deckhtml';
const result = await convertHtmlToPptx({
input: 'index.html',
});
// result.data: Buffer containing the PPTX file
// result.slideCount: number of slides
// result.usedFonts: resolved font names
// result.stats: element/font/simplified statistics
import { writeFileSync } from 'node:fs';
writeFileSync('deck.pptx', result.data);Start with the quick start, then learn the core concepts and architecture. Detailed CLI documentation is available in the docs/cli/ directory.
MIT

