Install the CLI
Install from npm:
npm install -g @pspdfkit/pdf-to-markdownOr use the shell installer:
curl -fsSL \ https://raw.githubusercontent.com/PSPDFKit/pdf-to-markdown/main/install.sh \ | shThe CLI supports macOS 13 or newer on Apple Silicon, Linux with glibc 2.38 or newer, and Windows. Linux also needs libcurl 4, ICU, and OpenSSL 3. On a minimal Ubuntu 24.04 image, install them with apt-get install libcurl4t64 libicu74 ca-certificates. On Windows, run the shell commands in Git Bash.
Check the installation:
nutrient --versionConvert a PDF
Standard conversion is free and doesn’t require an account:
pdf-to-markdown input.pdf output.mdThe conversion runs on your computer. Your PDF and the Markdown output aren’t uploaded to Nutrient.
Sign in for Vision
Run:
nutrient auth loginThe CLI opens a Nutrient page in your browser. Approve the request. Then return to your terminal.
Check your plan and remaining Vision pages:
nutrient auth statusUse Vision
Vision improves results for scans, handwriting, formulas, and complex tables:
pdf-to-markdown --vision scan.pdf scan.mdEach input page uses one Vision page from your monthly allowance. Failed conversions don’t use Vision pages.
The first Vision conversion downloads its models. Later conversions use the copy stored on your computer.
Use an API key in CI
Standard conversion works in containers and continuous integration (CI) without an account. To use Vision, create an API key in the PDF-to-Markdown dashboard(opens in a new tab) and set it as an environment variable:
export NUTRIENT_API_KEY="pdf_live_..."pdf-to-markdown --vision input.pdf output.md--api-key is also available, but environment variables are safer because command arguments can appear in shell history and process listings.
Work offline
Standard conversion can continue when Nutrient is unavailable.
After Vision connects, you can use it offline for one hour and process up to 100 pages before it must reconnect. A document that crosses the 100-page threshold can finish; reconnect before starting the next one.
Existing --license-key workflows continue to work offline.