@pdfbear/cli
v0.1.2
Published
Official command-line interface for PDFBEAR PDF tools
Maintainers
Readme
@pdfbear/cli
The official command-line interface for PDFBEAR: convert, compress, merge, split, protect, unlock and OCR PDFs from a terminal or CI job.
Requirements
- Node.js 20 or newer
- A free PDFBEAR API key
Install
npm install --global @pdfbear/cli
pdfbear loginYou can also run it without installing:
npx @pdfbear/cli toolspdfbear login prompts for the API key without displaying it, verifies it with
PDFBEAR, and saves it in the operating system's user configuration directory.
For CI or temporary use, set PDFBEAR_API_KEY instead.
Examples
pdfbear compress-pdf report.pdf --compression-level recommended
pdfbear merge-pdf chapter-1.pdf chapter-2.pdf -o book.pdf
pdfbear pdf-to-word scan.pdf -o scan.docx
pdfbear pdf-to-word https://example.com/scan.pdf -o scan.docx
pdfbear html-to-pdf https://example.com -o page.pdf
pdfbear presentation-maker "Quarterly sales review" --num-slides 8The CLI reads the current catalog from the PDFBEAR API, so every supported
tool_id is automatically available as a command. Run pdfbear tools --json
to inspect inputs, options, output formats and plan requirements.
Automation
Use --json for structured output and --no-wait to return as soon as a job is
accepted:
export PDFBEAR_API_KEY="pdfb_live_..."
pdfbear compress-pdf report.pdf --no-wait --json
pdfbear job job_123 --wait --download -o report-small.pdf --jsonUse -o - to write the downloaded file to standard output:
pdfbear compress-pdf report.pdf -o - > report-small.pdfThe CLI will not replace an existing output file unless --force is supplied.
Commands
pdfbear login
pdfbear logout
pdfbear account [--json]
pdfbear tools [--json]
pdfbear job <job-id> [--wait] [--download] [-o <path>] [--json]
pdfbear <tool-id> <input...> [tool options] [-o <path>]API documentation and plan limits are available at pdfbear.com/developers.
Security
Avoid putting API keys or document passwords directly in shell commands. Use
pdfbear login, PDFBEAR_API_KEY, and the CLI's hidden prompt for required PDF
passwords. Uploaded documents are processed according to the
PDFBEAR privacy policy.
License
MIT © Targa Limited
