Skip to content

Install and run the CLI

Use Node.js 24 or newer. The public npm package is @anhcodo13/lattice; it installs the lattice command. The CLI rejects older Node versions.

For your own app, install an exact version and run a first check:

Terminal window
npm install --save-dev --save-exact @anhcodo13/lattice@0.5.0
npx lattice --version
npx lattice governance check . --expect-apps 1

This default check uses the policy bundled with the package. Commit the resulting manifest and lockfile. For a reviewed policy from a different core revision, supply --policy explicitly; see Project governance.

Run architecture analysis without an external service:

Terminal window
npx lattice doctor .
npx lattice analyze .

Open .nklattice-report/report.html locally. The adjacent analysis.json contains the findings and module relationships for automation. For a different output folder, add --output /path/to/reports.

For a pnpm monorepo, scan from its root or an app subtree, and set --workspace-root to the directory containing the shared lockfile. Create .nklattice-apps.json to declare the exact applications you expect; an unexpected app count must fail the deployment gate. The bundled policy is available at node_modules/@anhcodo13/lattice/governance/policy.json. Read Project governance before collecting the external test and security evidence required by the full eight-domain assessment.

Terminal window
npx lattice governance run . --expect-apps 1 \
--evidence /tmp/nklattice-governance-evidence.json

The assessment writes .nklattice-governance/assessment.json and an offline report.html. A missing check produces an incomplete verdict; it is not silently treated as a pass. To tune architecture thresholds or add a module boundary, create .nklattice.json with npx lattice init . and follow Architecture policy.

Output Next check
No supported source files found Confirm the analysis path contains supported JS/TS files outside ignored folders.
No managed applications found Confirm the governance scan path and the app’s inferred or explicit profile.
No lockfile found Commit an npm/pnpm lockfile in the app or its workspace root.
required ... declared ... locked ... Align package.json, regenerate the lockfile, and rerun governance.