🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@dicepdf/cli

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dicepdf/cli

Private, offline PDF tools in your terminal. Merge, split, extract text, compress and more — your files never leave your machine.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

@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     # (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.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

Keywords

pdf

FAQs

Package last updated on 28 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts