Skip to content

CLI: next

The next command targets Next.js projects using the App Router (app/ or src/app/). It inventories route modules, compares process.env usage under the app to tracked .env* files, and runs the specless authoritative gate (security-style checks). Use it in CI for a focused merge gate without maintaining an ISL spec.

Usage

Terminal window
shipgate next [path] [options]

path defaults to the current directory and should be the Next.js app root (where package.json lives).

Options

FlagDescription
--strictEnterprise-style gate thresholds (stricter than dev defaults).
--strict-envNO_SHIP if env vars are used under app/ (or middleware) but not listed in any .env* file at the app root.
--auditInclude dependency audit signals in the specless gate.
--no-provenanceSkip the optional AI/human line sample (faster).
--evidence-out <path>Write golden-path JSON evidence (includes $schema for validation).
--summary-out <path>Write Markdown summary (blockers + warnings); good for PR comments.
--format <format>pretty (default), json, or quiet (minimal logs; use in CI).

Configuration file (optional), merged with flags using OR semantics (true from either source wins):

.shipgate/next.yml at the app root:

version: 1
strict: false
strict_env: false
audit: false

Examples

Local pretty output

Terminal window
shipgate next
shipgate next ./apps/web --strict

CI: quiet + artifacts

Terminal window
shipgate next . --format quiet \
--evidence-out .shipgate/shipgate-next-evidence.json \
--summary-out .shipgate/shipgate-next-summary.md

Evidence is written on every run when these flags are set, including setup failures (missing package.json, not a Next app), so dashboards and PR comments always get a machine-readable record.

JSON result on stdout

Terminal window
shipgate next --format json

JSON Schema

The evidence file is described by golden-path-evidence.schema.json, shipped in the shipgate npm package under schemas/. The JSON document includes a $schema URI on unpkg, pinned to the installed package version (so validators match the tarball you run).

Human-readable Markdown from --summary-out is generated only from the same JSON model (no second code path). Field semantics, schemaVersion, and migration notes: Evidence export spec, versioning.

See also: Golden path example workflow (copy into .github/workflows/).

Exit codes

CodeMeaning
0SHIP — gate passed
1NO_SHIP — failed gate, setup error, or artifact write failure

Same convention as other ShipGate CLI commands that use ISL_ERROR for failure.

See also