Skip to content

CLI reference

The offprint command writes command data to standard output and diagnostics to standard error. Run offprint <command> --help for the exact parser-owned flag inventory in the installed version.

Command tree

CommandInputResult
capture <URL>HTTP, HTTPS, or allowed file: URL plus required outputVerified Offprint HTML file or raw bytes
artifact inspect <ARTIFACT>HTML path or standard inputEmbedded ArtifactManifest
artifact verify <ARTIFACT>HTML path or standard inputStatic or offline ArtifactVerification
artifact verify <PATH> --format <FORMAT>Exported artifact pathFormat-specific ArtifactVerification
artifact export <ARTIFACT>HTML path or standard input, output directory, formatsVerified ExportResult
batch <BATCH_REQUEST>Versioned JSON file or standard inputBatchResult with one outcome per descriptor
crawl <URL>Seed URL, output directory, boundsCrawlResult in breadth-first order
doctorResolved configuration and optional browser overrideBrowserDoctorReport and recovery actions
browser installOptional catalog revisionInstalled managed-browser record
browser listOptional cache directoryBrowser candidate inventory
browser remove <REVISION>Installed managed revisionRemoval record
completion <SHELL>Bash, Elvish, Fish, PowerShell, or ZshCompletion script

capture

text
offprint capture <URL> --output <PATH|-> [OPTIONS]

Major option groups:

GroupOptions
Output--output, --on-exists
Configuration--config, --profile
Browser--browser-path, --cdp-url, --headed
Environment--viewport, --locale, --timezone, --color-scheme
Readiness--timeout, --wait-until, --delay
Content--missing-resources, --scope, --selector, optimization flags
Trust--headers, --cookies, --network-policy, --verification
Output protocol--json, --quiet, --color, --diagnostics

--browser-path conflicts with --cdp-url. --selector conflicts with any explicit --scope value. --json conflicts with raw artifact output. Standard input can serve one artifact, batch request, header file, or cookie file at a time.

artifact export

text
offprint artifact export <ARTIFACT|-> \
  --output <DIRECTORY> \
  --format <FORMAT>...

Repeat --format or pass a comma-separated list. Accepted values are pdf, markdown, zip, self-extracting-html, and mhtml.

--landscape and --prefer-css-page-size require PDF. --no-front-matter requires Markdown. --base-name is normalized into portable output names. Conflict policy applies to the output set and defaults to fail.

batch

text
offprint batch <BATCH_REQUEST|-> \
  [--config <PATH>] \
  [--browser-path <PATH> | --cdp-url <URL>] \
  [--json] [--quiet] [--color <MODE>]

The JSON document owns complete capture requests and concurrency. Browser flags replace auto selection and preserve explicit request selections. A partial failure writes BatchResult, then returns status 1.

crawl

text
offprint crawl <URL> --output <DIRECTORY> \
  [--max-pages <COUNT>] [--max-depth <COUNT>] \
  [--concurrency <COUNT>] [--resume <PATH>] \
  [--retry-failed] [--allow-cross-origin]

Defaults are 100 pages, depth 3, concurrency 4, and the seed-origin boundary. --retry-failed requires --resume. Crawl uses offline verification and a local browser. Each verified page replaces an existing generated path in the output directory.

artifact verify

Without --format, the command verifies Offprint HTML and defaults to offline mode. With --format, it runs the corresponding export verifier and requires a filesystem path. HTML verification options do not apply to export formats.

doctor and browser commands

After configuration and service construction succeed, doctor returns a report in JSON mode. When ready is false, it writes that report before returning status 1. It may launch a local probe or connect to a remote endpoint.

Browser commands never prompt. remove --force still refuses an active lease and requires another compatible browser when removing the selected revision.

Standard output and standard error

ModeStandard outputStandard error
Human successPaths, summaries, reports, or completion scriptProgress and warnings
--quietSame command dataErrors
--jsonOne versioned JSON valueOne structured error on failure
--output -Verified artifact bytesDiagnostics

Capture JSON suppresses human progress. Batch, crawl, and doctor may return a structured value before a failure status.

Exit statuses

StatusContract
0Requested operation completed
1Runtime, browser, scheduler, artifact input, or output operation failed
2Arguments, configuration, or request validation failed
3Artifact verification rejected the input
130Operation was interrupted

Error stage determines the status. Validation failures return 2, including offprint.output.exists when the destination already exists. Artifact readability and size failures return 1, even when discovered during a verification command. See errors for structured recovery.