@dicepdf/cli
Private, offline PDF tools in your terminal.
Merge, split, extract text, compress, watermark and more — powered by
@dicepdf/core.
One promise: your files never leave the machine. The CLI makes zero
network calls — it works on a plane, in a SCIF, behind a corporate proxy.
Use without installing
npx dicepdf merge a.pdf b.pdf -o merged.pdf
Or install globally:
npm install -g @dicepdf/cli
dicepdf --help
Examples
dicepdf merge invoices/*.pdf -o all.pdf
dicepdf extract all.pdf --format markdown > all.md
cat report.pdf | dicepdf extract - --format json | jq '.pages[0]'
dicepdf split book.pdf --ranges 1-10,11-30,31-50 --out-dir chapters/
dicepdf strip-metadata contract.pdf -o contract.clean.pdf
dicepdf watermark deck.pdf --text "CONFIDENTIAL" --position diagonal -o out.pdf
dicepdf pdf2img scan.pdf --format png --dpi 150 --out-dir pages/
dicepdf compress scan.pdf --aggressive --dpi 120 -o smaller.pdf
Use - as an input or -o value to read stdin / write stdout.
Commands
merge, split, rotate, delete, reorder, crop, watermark,
pagenumbers, strip-metadata, compress (--aggressive), repair,
img2pdf, pdf2img, extract, metadata, zip. Run dicepdf --help
for full options.
pdf2img and compress --aggressive rasterize pages and use the optional
@napi-rs/canvas dependency (installed automatically with the CLI).
Exit codes
0 success · 1 runtime error (bad/encrypted PDF, missing file) · 2 usage error.
License
MIT