@dicepdf/cli
v0.1.0
Published
Private, offline PDF tools in your terminal. Merge, split, extract text, compress and more — your files never leave your machine.
Downloads
163
Maintainers
Readme
@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.pdfOr install globally:
npm install -g @dicepdf/cli
dicepdf --help # (alias: `dice`)Examples
# Merge, then extract clean Markdown for an LLM
dicepdf merge invoices/*.pdf -o all.pdf
dicepdf extract all.pdf --format markdown > all.md
# Pipe-friendly: read stdin, write stdout
cat report.pdf | dicepdf extract - --format json | jq '.pages[0]'
# Split a book into chapters
dicepdf split book.pdf --ranges 1-10,11-30,31-50 --out-dir chapters/
# Redact identifying metadata before sharing
dicepdf strip-metadata contract.pdf -o contract.clean.pdf
# Rotate, delete, reorder, crop, watermark, page numbers, compress, repair…
dicepdf watermark deck.pdf --text "CONFIDENTIAL" --position diagonal -o out.pdf
# Rasterize pages to images
dicepdf pdf2img scan.pdf --format png --dpi 150 --out-dir pages/
# Aggressive (rasterizing) compression for scan-heavy PDFs
dicepdf compress scan.pdf --aggressive --dpi 120 -o smaller.pdfUse - 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.
pdf2imgandcompress --aggressiverasterize pages and use the optional@napi-rs/canvasdependency (installed automatically with the CLI).
Exit codes
0 success · 1 runtime error (bad/encrypted PDF, missing file) · 2 usage error.
License
MIT
