CLI Reference
Invocation
Section titled “Invocation”If installed globally (npm install -g bentopdf-sh):
bentopdf <command> [options]If using npx:
npx bentopdf-sh <command> [options]All examples below use the short bentopdf form.
bentopdf to-pdf
Section titled “bentopdf to-pdf”Convert one or more files to PDF.
bentopdf to-pdf <input...> [options]Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
<input...> | One or more input file paths. Glob patterns are expanded by your shell. |
Options
Section titled “Options”| Flag | Alias | Type | Default | Description |
|---|---|---|---|---|
--output | -o | string | — | Output file path (single input) or directory path (multiple inputs). Defaults to same directory as input, same filename with .pdf extension. |
--engine | — | string | auto | Force a specific engine: mupdf, pandoc, or libreoffice. By default bentopdf selects the engine based on file extension. |
--verbose | — | boolean | false | Show detailed progress output including engine load time and conversion duration. |
--overwrite | — | boolean | false | Overwrite existing output files without prompting. |
Examples
Section titled “Examples”# Single file, default output locationbentopdf to-pdf report.docx
# Single file, explicit output pathbentopdf to-pdf report.docx -o ~/Desktop/report.pdf
# Multiple files to a directorybentopdf to-pdf *.pptx -o ./pdfs/
# Force LibreOffice enginebentopdf to-pdf notes.html --engine libreoffice
# Verbose outputbentopdf to-pdf large-doc.docx --verbosebentopdf to-docx
Section titled “bentopdf to-docx”Convert Markdown or HTML files to DOCX (Word) via pandoc-wasm.
bentopdf to-docx <input...> [options]Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
<input...> | One or more Markdown or HTML files. |
Options
Section titled “Options”| Flag | Alias | Type | Default | Description |
|---|---|---|---|---|
--output | -o | string | — | Output file path (single input) or directory path (multiple inputs). Defaults to same directory as input, same filename with .docx extension. |
--template | -t | string | — | Path to a reference document (.docx) for styling. Controls fonts, heading styles, page layout, and other formatting. Works like pandoc’s --reference-doc. |
--verbose | — | boolean | false | Show detailed progress output. |
Examples
Section titled “Examples”# Basic conversionbentopdf to-docx notes.md
# With a branded templatebentopdf to-docx report.md -t company-template.docx -o report.docx
# Batch convertbentopdf to-docx *.md -o ./docs/bentopdf to-pptx
Section titled “bentopdf to-pptx”Convert Markdown or HTML files to PPTX (PowerPoint) via pandoc-wasm.
bentopdf to-pptx <input...> [options]Pandoc splits slides on level-2 headings (##). Each ## heading becomes a new slide title.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
<input...> | One or more Markdown or HTML files. |
Options
Section titled “Options”| Flag | Alias | Type | Default | Description |
|---|---|---|---|---|
--output | -o | string | — | Output file path (single input) or directory path (multiple inputs). Defaults to same directory as input, same filename with .pptx extension. |
--template | -t | string | — | Path to a reference document (.pptx) for styling. Controls slide masters, fonts, colors, and layout. Works like pandoc’s --reference-doc. |
--verbose | — | boolean | false | Show detailed progress output. |
Examples
Section titled “Examples”# Basic conversionbentopdf to-pptx slides.md
# With a corporate slide templatebentopdf to-pptx pitch.md -t brand.pptx -o pitch-deck.pptx
# Batch convertbentopdf to-pptx *.md -o ./presentations/bentopdf cache
Section titled “bentopdf cache”Manage the WASM engine cache.
bentopdf cache <action>Actions
Section titled “Actions”| Action | Description |
|---|---|
list | List all cached engines with their version, size, and cache path. |
clear | Delete all cached engines. They will be re-downloaded on next use. |
Examples
Section titled “Examples”# See what's cachedbentopdf cache list
# Free up disk spacebentopdf cache clearCache location: ~/.cache/bentopdf/engines/<name>/<version>/
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
0 | All conversions succeeded. |
1 | One or more conversions failed (file not found, unsupported format, engine error). |
2 | Bad arguments (missing required input, conflicting flags). |
3 | Engine download failed (network error while fetching WASM binary). |