Skip to content

PDF CLI

Run local tools from scripts and the terminal.

Runs on your computer. Files stay on your device; the agent or script can only use the folders you allow.

Run superPDF operations from scripts and the terminal. Files are processed on your computer, and outputs are always new files.

  1. Install the command-line tool

    The superpdf command runs the tools on your computer. It needs Node.js 22 or later. Install it once with npm:

    Terminal
    npm install -g @superpdf/cli
    
    # Check it works
    superpdf help
  2. Run a command

    Terminal
    superpdf export report.pdf --output report.md
    superpdf info report.pdf
    superpdf merge a.pdf b.pdf --output combined.pdf
    superpdf extract report.pdf --pages 1,3-5 --output selected.pdf
    superpdf rotate report.pdf --pages 2 --angle 90 --output rotated.pdf
    superpdf pipeline report.pdf --steps steps.json --output result.pdf
  3. Chain steps with a pipeline

    steps.json
    [
      { "action": "extract", "options": { "pages": "1-3" } },
      { "action": "rotate", "options": { "angle": 90 } },
      { "action": "labels", "options": { "text": "{page} / {total}" } }
    ]

Run it with npx, or install it

You need Node.js 22 or later. To try it without installing anything, put npx @superpdf/cli in front of a command: npx downloads the tool once and runs it.

Terminal
npx @superpdf/cli help
npx @superpdf/cli export report.pdf --output report.md

If you use it often, install the superpdf command once; then it runs from any folder without the download step.

Terminal
npm install -g @superpdf/cli
superpdf help

To update it later, run npm install -g @superpdf/cli@latest; to remove it, npm uninstall -g @superpdf/cli.

With Homebrew on macOS or Linux, which installs Node.js for you:

Terminal
brew install arjunprabhulal/superpdf/superpdf
superpdf help

Update with brew upgrade superpdf. From Python, pip install superpdf or uvx superpdf gives the same command; see superPDF AI for Python.

Markdown, HTML and JSON

superpdf export uses the same reader as PDF to text in the browser, so it writes the same Markdown, HTML and JSON. Scanned pages (pages with no text layer) are read with superPDF OCR on the way, in the page’s language (English and the 14 others of OCR PDF), as in the browser; the recognition data comes with the tool, so nothing is downloaded. Add --no-ocr to skip it. Markdown writes tables as Markdown tables; --tables html writes them as HTML tables instead, as the HTML export does, so merged header cells are kept.

Terminal
superpdf export report.pdf --output report.md
superpdf export report.pdf --tables html --output report.md
superpdf export scan.pdf --no-ocr --output scan.md

From Python

The same tools are in the Python package: pip install superpdf, or uvx superpdf to run the command without installing it. See superPDF AI for Python.

Source and releases

superPDF AI’s command-line tool, MCP server, local API and Python package are open source (Apache-2.0).