paramour
Reference@paramour-js/nextCLI

paramour check

Verify the committed artifact is current — exit 1 on drift, never writes.

The CI gate. check is exactly generate --check: re-scan the route directories, byte-compare the result against the committed artifact, exit 1 on drift, never write:

npx paramour check
paramour: paramour-env.d.ts is up to date

On drift, the report names what appeared and disappeared, so the fix is obvious — rerun generate and commit:

paramour: paramour-env.d.ts is out of date.
  + /product/[id] (app)
  - /products/[id] (app)
Run `paramour generate` and commit the result.

A missing artifact counts as drift — CI can't silently degrade to unchecked paths. So does byte drift with an identical route set (a hand-edited artifact), reported as content differs from generator output.

Flags

check accepts the shared route-resolution flags and nothing else — in particular it rejects --check and --watch as unknown options (it is the check; there is nothing to watch):

FlagDefaultDescription
--app-dir <dir>discovered app/ or src/app/App directory.
--pages-dir <dir>discovered pages/ or src/pages/Pages directory.
--out-file <file>paramour-env.d.tsArtifact path, relative to the project root.
--page-extensions <list>tsx,ts,jsx,jsComma-separated, no leading dots.
--help, -hShow usage.

CI usage

Put it in front of the build so a stale registry is a failed build with a clear message, not a type-error cascade later in the log:

package.json
{
  "scripts": {
    "build": "paramour check && next build"
  }
}

The complementary wiring is withTypedRoutes(config, { strict: true }), which upgrades build-phase drift into a next build failure — this docs site does both. Prefer check as the first line of defense: it fails explicitly and first, rather than mid-next build.

Exit codes

CodeWhen
0The artifact matches the filesystem byte-for-byte.
1Drift — including a missing or hand-edited artifact.
2Usage/config errors, no route directories, route collisions, I/O failures.

On this page