Skip to content

CLI Reference

If installed globally (npm install -g bentopdf-sh):

Terminal window
bentopdf <command> [options]

If using npx:

Terminal window
npx bentopdf-sh <command> [options]

All examples below use the short bentopdf form.


Convert one or more files to PDF.

Terminal window
bentopdf to-pdf <input...> [options]
ArgumentDescription
<input...>One or more input file paths. Glob patterns are expanded by your shell.
FlagAliasTypeDefaultDescription
--output-ostringOutput file path (single input) or directory path (multiple inputs). Defaults to same directory as input, same filename with .pdf extension.
--enginestringautoForce a specific engine: mupdf, pandoc, or libreoffice. By default bentopdf selects the engine based on file extension.
--verbosebooleanfalseShow detailed progress output including engine load time and conversion duration.
--overwritebooleanfalseOverwrite existing output files without prompting.
Terminal window
# Single file, default output location
bentopdf to-pdf report.docx
# Single file, explicit output path
bentopdf to-pdf report.docx -o ~/Desktop/report.pdf
# Multiple files to a directory
bentopdf to-pdf *.pptx -o ./pdfs/
# Force LibreOffice engine
bentopdf to-pdf notes.html --engine libreoffice
# Verbose output
bentopdf to-pdf large-doc.docx --verbose

Convert Markdown or HTML files to DOCX (Word) via pandoc-wasm.

Terminal window
bentopdf to-docx <input...> [options]
ArgumentDescription
<input...>One or more Markdown or HTML files.
FlagAliasTypeDefaultDescription
--output-ostringOutput file path (single input) or directory path (multiple inputs). Defaults to same directory as input, same filename with .docx extension.
--template-tstringPath to a reference document (.docx) for styling. Controls fonts, heading styles, page layout, and other formatting. Works like pandoc’s --reference-doc.
--verbosebooleanfalseShow detailed progress output.
Terminal window
# Basic conversion
bentopdf to-docx notes.md
# With a branded template
bentopdf to-docx report.md -t company-template.docx -o report.docx
# Batch convert
bentopdf to-docx *.md -o ./docs/

Convert Markdown or HTML files to PPTX (PowerPoint) via pandoc-wasm.

Terminal window
bentopdf to-pptx <input...> [options]

Pandoc splits slides on level-2 headings (##). Each ## heading becomes a new slide title.

ArgumentDescription
<input...>One or more Markdown or HTML files.
FlagAliasTypeDefaultDescription
--output-ostringOutput file path (single input) or directory path (multiple inputs). Defaults to same directory as input, same filename with .pptx extension.
--template-tstringPath to a reference document (.pptx) for styling. Controls slide masters, fonts, colors, and layout. Works like pandoc’s --reference-doc.
--verbosebooleanfalseShow detailed progress output.
Terminal window
# Basic conversion
bentopdf to-pptx slides.md
# With a corporate slide template
bentopdf to-pptx pitch.md -t brand.pptx -o pitch-deck.pptx
# Batch convert
bentopdf to-pptx *.md -o ./presentations/

Manage the WASM engine cache.

Terminal window
bentopdf cache <action>
ActionDescription
listList all cached engines with their version, size, and cache path.
clearDelete all cached engines. They will be re-downloaded on next use.
Terminal window
# See what's cached
bentopdf cache list
# Free up disk space
bentopdf cache clear

Cache location: ~/.cache/bentopdf/engines/<name>/<version>/


CodeMeaning
0All conversions succeeded.
1One or more conversions failed (file not found, unsupported format, engine error).
2Bad arguments (missing required input, conflicting flags).
3Engine download failed (network error while fetching WASM binary).