CLI Reference
Overview
The PaperQuire CLI lets you render Markdown to PDF, DOCX, and HTML from the terminal. It supports all the same templates, document options, and branding that the desktop app provides — ideal for automation, CI pipelines, and scripting.
When you install PaperQuire via Homebrew, the paperquire command is added to your PATH automatically. For manual installs, the binary is located inside the app bundle at PaperQuire.app/Contents/Resources/bin/paperquire.
Verify your installation:
paperquire version
Quick Start
# Simplest render — produces report.pdf in the same directory
paperquire report.md
# Specify output path and template
paperquire report.md -o dist/report.pdf -t minimal-clean
# Pipe from stdin, write to stdout
cat notes.md | paperquire - --stdout > out.pdf
# Batch render an entire directory
paperquire batch ./docs -o ./out
Render Command
The default command. Pass one or more Markdown files to render them to PDF.
paperquire [options] <file.md>
If no -o flag is given, the output file is placed next to the input with a .pdf extension (e.g. report.md becomes report.pdf). Use - as the filename to read from stdin.
Flags
| Flag | Description | Default |
|---|---|---|
-o, --output <path> | Output file path | Input filename with .pdf |
-f, --format <fmt> | Output format: pdf, docx Pro, html Pro | pdf |
-t, --template <id> | Template ID or path to .pqt file | Default template |
--title <text> | Cover page title | Auto-detected from first # |
--subtitle <text> | Cover page subtitle | Auto-detected from first ## |
--author <name> | Cover page author | — |
--date <text> | Cover page date | Today's date |
--company <name> | Cover page company name | — |
--logo <path> | Path to cover page logo image | Template default |
--cover / --no-cover | Enable or disable the cover page | --cover |
--toc / --no-toc | Enable or disable the table of contents | --toc |
--h1-page-break | Start each H1 heading on a new page | Off |
--page-size <size> | Paper size: letter, a4 | letter |
--margins <t,r,b,l> | Page margins in inches (e.g. 1,1,1,1) | 1,1,1,1 |
--primary-color <hex> | Brand primary color | Template default |
--watermark <text> | Watermark text overlaid on each page | — |
--compliance <mode> | Accessible/archival compliance: pdf-a, pdf-ua Enterprise | — |
--allow-html | Allow raw HTML in Markdown input | Off |
--stdout | Write output to stdout instead of a file | Off |
--dry-run | Validate inputs without rendering | Off |
-q, --quiet | Suppress all output except errors | Off |
-v, --verbose | Show detailed progress output | Off |
--license-file <path> | Path to license file | Auto-detected |
--cloud | Use PaperQuire Cloud rendering Enterprise | Off |
--api-key <key> | API key for cloud rendering | PAPERQUIRE_API_KEY env |
--dry-run to validate your Markdown and options before producing a PDF. This is especially helpful in CI pipelines.Examples
# Render with cover page metadata
paperquire report.md --title "Q2 Report" --author "Jane Doe" --date "June 2026"
# A4 paper with custom margins and no TOC
paperquire spec.md --page-size a4 --margins 0.75,0.75,0.75,0.75 --no-toc
# Export to DOCX (Pro)
paperquire report.md -f docx -o report.docx
# Watermark a draft
paperquire draft.md --watermark "DRAFT" -o draft.pdf
Batch Command Pro
Render multiple Markdown files in one invocation. All render flags are also supported.
paperquire batch <directory> [options]
Batch-Specific Flags
| Flag | Description | Default |
|---|---|---|
-o, --out-dir <path> | Output directory for rendered files | Same directory as each input |
--glob <pattern> | Glob pattern to match files (e.g. "**/*.md") | "*.md" |
--concurrency <n> | Number of files to render in parallel | 4 |
--continue-on-error | Keep rendering remaining files if one fails | Off |
--dry-run | List matched files without rendering | Off |
Examples
# Render all .md files in docs/ to an output directory
paperquire batch ./docs -o ./out
# Recursive glob with a specific template
paperquire batch ./project --glob "**/*.md" -t corporate
# Preview which files would be rendered
paperquire batch ./docs --dry-run
# Render 8 files in parallel, skip failures
paperquire batch ./docs --concurrency 8 --continue-on-error
Templates
Manage built-in and custom templates from the command line.
paperquire templates <action> [args]
List Templates
Show all available templates (built-in and user-installed):
paperquire templates list
Show Template Details
Display full metadata for a specific template:
paperquire templates show minimal-clean
Create a Custom Template
Scaffold a new template in your user templates directory:
paperquire templates init my-template
This creates a directory with a template.yml manifest, a CSS file, and a sample cover page layout. Edit these files to customize your template.
Export a Template
Export a template as a portable .pqt file (a ZIP archive containing the template manifest, styles, and assets):
paperquire templates export minimal-clean -o ./minimal-clean.pqt
Import a Template
Install a .pqt template file:
paperquire templates import ./my-template.pqt
Configuration
The CLI reads settings from YAML configuration files. Settings are resolved in this order (later sources override earlier ones):
- Global config —
~/.paperquire/config.yml - Project config —
.paperquire.yml(searched upward from the input file's directory) - CLI flags — always win
Configuration File Schema
# .paperquire.yml
template: corporate
format: pdf
page-size: letter
margins: [1, 1, 1, 1]
cover:
title: "Project Documentation"
author: "Engineering Team"
company: "Acme Corp"
logo: ./assets/logo.png
toc: true
h1-page-break: true
branding:
primary-color: "#2563eb"
output:
dir: ./dist
quiet: false
Config Commands
Initialize a .paperquire.yml in the current directory with sensible defaults:
paperquire config init
Show the resolved configuration (merged from all sources):
paperquire config show
License Management
Check your license status:
paperquire license status
Activate a license from the command line:
paperquire license activate YOUR-LICENSE-KEY
You can also set the PAPERQUIRE_LICENSE environment variable instead of activating interactively:
export PAPERQUIRE_LICENSE="YOUR-LICENSE-KEY"
Tier Requirements
| Capability | Free | Pro | Enterprise |
|---|---|---|---|
| Render to PDF | Yes (3/day) | Unlimited | Unlimited |
| Batch rendering | -- | Yes | Yes |
| HTML & DOCX export | -- | Yes | Yes |
| Accessible/archival compliance | -- | -- | Yes |
| Cloud rendering | -- | -- | Yes |
Exit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Error (invalid input, render failure, license issue) |