CLI reference
@pardown/cli provides the pardown command for converting one Markdown file or standard input into a PDF. This page documents installation, path handling, output behaviour, warnings, and exit statuses.
Install the CLI
Install the package globally to add pardown to your command path.
npm install --global @pardown/clipnpm add --global @pardown/cliyarn global add @pardown/cliThe package runs as an ECMAScript module on Node.js. Its package metadata doesn't declare a minimum Node.js version.
Convert a file
Pass exactly one Markdown file path. Without an output option, Pardown replaces the input's final extension with .pdf and writes the result beside the input.
pardown notes.mdFor example, notes.md becomes notes.pdf, notes.draft.md becomes notes.draft.pdf, and README becomes README.pdf.
Relative image paths resolve from the input file's directory. Pardown reads the complete input as UTF-8 before starting conversion.
Set the output path
Use --output or -o to choose the PDF path. A relative output path resolves from the directory where you run the command, not from the input file's directory.
pardown notes.md --output exports/meeting-notes.pdf
pardown -o exports/meeting-notes.pdf notes.mdThe output's parent directory must already exist.
WARNING
Pardown overwrites an existing output file without asking for confirmation.
Read from standard input
Use - as the input to read UTF-8 Markdown from standard input. Relative images then resolve from the directory where you run the command.
printf '# Meeting notes\n' | pardown - --output meeting-notes.pdf
cat notes.md | pardown -o exports/meeting-notes.pdf -If you omit --output, Pardown writes stdin.pdf in the current directory. The command buffers all standard input before conversion and doesn't write PDF bytes to standard output.
Command syntax
The command accepts one input and two options.
Usage: pardown [options] <input|->
Convert a Markdown file to PDF. Use - to read Markdown from stdin.
Options:
-o, --output <file> Output PDF path (default: input name or stdin.pdf)
-h, --help Show this help messageUse -- before an input filename that starts with a hyphen:
pardown -- --draft.mdThe CLI doesn't provide a version option, batch conversion, or PDF output through standard output.
Warnings and errors
Recoverable conversion diagnostics are written to standard error with a warning: prefix. An image-loading warning renders alternative text in place of the image, and an unsupported-node warning keeps supported descendant content.
Argument, input, conversion, and output failures are written to standard error with an error: prefix. Argument errors also print the command help.
Successful conversion doesn't print progress or a success message.
Exit statuses
The process uses one of two exit statuses so scripts can detect success or failure:
0means help was displayed, or conversion and file writing completed.1means argument parsing, input reading, conversion, or output writing failed.
Warnings alone don't change a successful exit status.
Examples
These examples cover common CLI workflows.
Convert a document beside its Markdown source:
pardown handbook.mdWrite the PDF to an existing export directory:
mkdir -p exports
pardown handbook.md -o exports/team-handbook.pdfConvert generated Markdown from another command:
printf '# Build result\n\nAll checks passed.\n' | pardown -o build-result.pdf -Check the status in a shell script:
if pardown handbook.md -o handbook.pdf; then
echo 'Created handbook.pdf'
else
echo 'PDF conversion failed' >&2
exit 1
fiNext steps
Read Markdown support to check how document elements render. Use Image loading and cancellation or Diagnostics when you need control that the CLI doesn't expose.