CLI · Tier 2

Output targets

Produce a specific deliverable other than the standard HTML bundle: per-page PNG images, PDF, and deploy artifacts.

Tier 2 commands wrap a heavier dependency (Chromium for PDF / image, an adapter SDK for deploy) around the same engine output. They're explicit commands rather than flags on build because each has its own runtime cost — running them implicitly inside build would surprise users who only want the HTML bundle.

Command Impl

# openpress:pdf

Generate a PDF locally via Chromium. Output filename comes from config.pdf.filename. Builds first if dist-react/ is missing or stale; pass --no-build to reuse the existing build.

npm run openpress:pdf

Flags

Name Type Default Description
--output string Override the output path. Defaults to config.pdf.filename next to the workspace root.
--no-build flag Reuse the existing dist-react/ output instead of re-building. Useful when iterating on Chromium print CSS.
--host string "127.0.0.1" Static server host used while Chromium prints.
--port string "5185" Static server port.
--dry-run flag Print the command sequence without actually rendering or invoking Chromium.
One-shot PDF
npm run openpress:pdf
# → ./<config.pdf.filename>.pdf
Command Impl

# openpress:image

Generate one PNG per page via Chromium. Output defaults to dist-react/images/page-001.png, page-002.png, and so on. Builds first unless --no-build is passed.

npm run openpress:image

Flags

Name Type Default Description
--output string Override the output directory. Defaults to dist-react/images.
--no-build flag Reuse the existing dist-react/ output instead of re-building.
--host string "127.0.0.1" Static server host used while Chromium captures pages.
--port string "5186" Static server port.
--dry-run flag Print the command sequence without rendering or invoking Chromium.
Per-page PNGs
npm run openpress:image
# → dist-react/images/page-001.png
Command Impl

# openpress:deploy

Run the configured deploy adapter. Builds the workspace, generates the PDF stage artifact alongside, writes deploy metadata to deploy.json, and hands off to the adapter. Always requires --confirm — there is no silent deploy.

npm run openpress:deploy

Flags

Name Type Default Description
--confirm flag Required for a real deploy. Skips the interactive prompt; CI should set this only after a separate gate (e.g. PR approval).
--dry-run flag Run preflight only; print the command sequence (build → PDF → adapter); do not publish.
Dry run from local
npm run openpress:deploy:dry-run
# → reports adapter, target, and what would change
Real deploy (CI)
npm run openpress:deploy -- --confirm
# → 1. build
# → 2. PDF into the deploy stage
# → 3. write deploy.json
# → 4. adapter publishes

The active adapter is selected by package.json "openpress.deploy.adapter". Each adapter has its own required config — see Workspace config for the full schema.

Adapters

Config Impl

# "cloudflare-pages"

Calls npx wrangler pages deploy. Required: projectName. Optional: commitDirty. Wrangler must be authenticated on the deploying machine.

// package.json
"openpress": {
  "deploy": { "adapter": "cloudflare-pages", "projectName": "...", "source": ".deploy" }
}
Config Plan · v1.0

# "static-dir"

Copy the deploy stage to a local folder for hand-off to a separate uploader (S3 sync, GitHub Pages action, scp, etc). Built-in fallback for self-hosted deploys.

// package.json
"openpress": {
  "deploy": { "adapter": "static-dir", "target": "./build-output" }
}

This is a draft adapter contract. Until it is marked Impl, use the cloudflare-pages adapter or copy the generated deploy stage manually.