CLI Reference#

This page documents the CLI surface that currently ships in this repo.

The primary CLI includes plan and the existing verbs: init, readiness, explain, attest, claim, recommendation, feedback, setup, plugin, integrations. Most commands print JSON to stdout. The developer- and agent-facing readiness feedback path prints lint-style text by default; use --format json when you need machine-readable orchestration output.

Entry Points#

  • npx --no @kontourai/veritas ...
  • npx --no @kontourai/veritas -- --help
  • npx --no @kontourai/veritas readiness --help
  • npx --no @kontourai/veritas readiness --check evidence --help
  • npx --no @kontourai/veritas <subcommand> --help
  • node bin/veritas-report.mjs ...

--no runs only the locally installed Veritas. In a fresh clone it fails with npx canceled due to missing packages naming the registry's latest version, not the lockfile's; run npm install first.

The convenience veritas-report binary defaults to repo-local starter paths:

  • .veritas/repo-map.json
  • .veritas/repo-standards/default.repo-standards.json

Core Workflow#

The shortest current path is:

npm install -D @kontourai/veritas
npx --no @kontourai/veritas init
npx --no @kontourai/veritas attest bootstrap --actor <authority-id> --approval-ref <human-approval-reference> --non-interactive
npx --no @kontourai/veritas readiness --working-tree

Use readiness when you want evidence checks, generated evidence, standards feedback capture, and change guidance in one command.

Use readiness --check coverage when you want readiness coverage. The product question it answers is "what evidence is complete, missing, stale, or needs review?"

Breaking evidence-check migration notes live in ../MIGRATING.md.

Commands#

plan#

Read-only pre-edit routing and guidance, using the same requirement/check selection as readiness. It runs no checks and creates no evidence.

npx --no @kontourai/veritas plan src/example.ts tests/example.unit.test.ts
npx --no @kontourai/veritas plan --working-tree --json
npx --no @kontourai/veritas plan --changed-from origin/main --changed-to HEAD

Use explicit intended paths, the current working tree (default), or a pair of revision endpoints. Modes cannot be mixed. --root, --repo-map and --repo-standards select the target repository and optional configuration paths. Unknown options, outside paths and invalid policy schemas fail before returning a plan. JSON is a veritas.kontour.ai/v1alpha1 ChangePlan resource. Its status reports executed: false, selected checks with required/advisory status, applicable guidance and unmapped paths. Unmapped paths retain their coverage policy; a plan is not a readiness verdict. See Code Hygiene.

readiness#

Runs the requested check. Without --check, this is the agent-facing feedback path.

npx --no @kontourai/veritas readiness [--check evidence|boundaries|coverage|config] [--root <path>] [--working-tree] [--actor <id>]
npx --no @kontourai/veritas readiness --check boundaries --actor cli-team [--diff main]

--actor <id> names the governance actor for the run: any work-area-boundary requirement the Repo Standards declare, the readiness-verdict authority trace when no current attestation names one, and run history. It takes precedence over VERITAS_ACTOR, and an empty value counts as unset; with neither, a work-area-boundary requirement fails closed.

Readiness defaults to the working tree: staged, unstaged and untracked paths. It excludes committed changes. To qualify a committed branch, name both endpoints:

npx --no @kontourai/veritas readiness --changed-from origin/main --changed-to HEAD

An empty selected scope emits empty-change-scope before checks run and in the feedback summary. Repository-wide checks may still pass, but no change-specific policies were evaluated. JSON command output exposes readiness.changeScope with its source kind, scope, reference, file count and empty or selected status. selected means paths were selected; it does not mean their policies passed or all paths matched a work area. The persisted v1 evidence and trust-bundle shapes are unchanged; they retain their existing source scope and file list.

readiness is the recommended current front door for evidenceCheck execution, generated evidence, standards feedback drafting, and change guidance. readiness --check boundaries replaces boundaries check. readiness --check coverage is the current command for readiness coverage. readiness --check evidence is the current command for the lower-level generated evidence path. readiness --check config validates this repo's Repo Map and Repo Standards against the schemas Veritas publishes for them.

Evidence-check processes have bounded cancellation and per-check deadlines. Embedders may set runtime.workflowTimeoutMs for an overall readiness deadline; Veritas checks that deadline before report, finalization, and completion. Report generation and filesystem-backed feedback finalization remain synchronous repository operations: they receive explicit bounded Git diff resolution, but a caller cannot preempt an already-running filesystem operation once that finalization phase has started. The workflow deadline is therefore observed at phase boundaries, not a claim of universal mid-operation cancellation.

Readiness keeps its generated Surface projection under the ignored .kontourai/veritas/surface/ runtime root. Use --projection-output <repo-relative-file> to retain an additional copy at an explicit location for CI upload or inspection. The explicit destination is caller-owned and is not automatically ignored; existing files require --force.

readiness --format json adds a runtime-only readiness envelope with the overall status/verdict, every required Evidence Check's passed, failed, missing, skipped, or timedout state, and per-check remediation. It is intentionally outside the generated version-1 evidence record so orchestrators can enforce the current run without changing that durable schema.

--version#

Prints the installed @kontourai/veritas package version and exits successfully. Use it to record the engine identity selected by an exact package pin; --help proves only that the CLI can run.

npx --no @kontourai/veritas -- --version

init#

Bootstraps starter Repo Standards and a Repo Map for a target repo.

npx --no @kontourai/veritas init [--root <path>] [--project-name <name>] [--evidence-check <cmd>] [--template <name>] [--force] [--non-interactive]
npx --no @kontourai/veritas init --explore [--root <path>] [--project-name <name>] [--evidence-check <cmd>] [--output .veritas/init-plans/<name>.json]
npx --no @kontourai/veritas init --guided --answers <answers.json> [--root <path>] [--project-name <name>] [--output .veritas/init-plans/<name>.json]
npx --no @kontourai/veritas init --apply --plan <path> [--root <path>] [--force]

Writes:

  • .veritas/GOVERNANCE.md
  • .veritas/README.md
  • .veritas/repo-map.json
  • .veritas/repo-standards/default.repo-standards.json
  • .veritas/authority/default.authority-settings.json
  • .kontourai/veritas/evidence/
  • AGENTS.md and CLAUDE.md governance blocks

--template replaces generated starter standards with a named example template. Shipped templates currently include nextjs-typescript, python-fastapi, and monorepo-pnpm.

init keeps stdout machine-readable JSON and prints the suggested CODEOWNERS block to stderr as informational text. init --explore and init --guided are deterministic and make no model or network calls. They inspect Git-visible repository shape, package scripts, instruction files, and repository-declared hints. By default they persist the same JSON emitted on stdout to .veritas/init-plans/explore.json or .veritas/init-plans/guided.json; --output selects another path within that directory.

In --non-interactive mode, init writes .veritas/attestations/PENDING instead of recording an attestation. Run attest bootstrap after a trusted authority reviews the generated protected standards.

The bootstrap logic infers:

  • repo kind: application, workspace, knowledge, or docs
  • likely source roots
  • repository-declared external authority boundaries from package.json#veritas.externalBoundaries or an authoritative dependency statement linked from CONTEXT.md/README.md
  • likely test roots
  • whether workflows exist
  • substantive top-level product directories not already classified as source, tooling, or tests
  • an initial evidenceCheck from common npm scripts

Generated runtime output stays under .kontourai/. init merges the exact .kontourai/ ignore entry into .gitignore when needed; it does not add a .surface/ or .veritas/ ignore entry.

Guided initialization splits setup into a reviewed artifact flow:

  • --explore inspects the repo and emits a recommendation JSON without writing starter files.
  • --guided --answers <answers.json> folds owner-provided boundaries, style, evidence-check, and instruction-target choices into the recommendation.
  • --output is intentionally constrained to .veritas/init-plans/ so reviewed setup plans stay repo-local and obvious.
  • --apply --plan <path> is the only guided write path. It validates the plan schema, target root, and the exact matching path sets in required_artifact_paths, artifact_payloads, public artifact_hashes, and the local private exact-byte integrity record before checking payload hashes or overwrite rules. This rejects omitted, extra, and renamed starter artifacts even when every remaining entry is authentic. Plans use schema version 2; regenerate an older plan with --explore or --guided before applying it. Plans record target_root as the repository-relative ".", meaning the --root the plan is applied to, so a committed plan no longer carries the author's local path, and it applies from a moved or copied checkout that keeps its local integrity record. The integrity record lives under the gitignored .kontourai/ directory, so a fresh clone has none: apply there is refused, and the clone must re-run npx --no @kontourai/veritas init --explore (or --guided) before applying. A plan recorded by an older release carries an absolute target_root; apply accepts it with a warning (it cannot be compared across machines), refuses a Windows-form path recorded on another OS with a re-record message, and rejects any other value. Regenerate such a plan to drop the absolute path.
  • Apply also writes the starter claim store, veritas.claims.json, derived from the applied Repo Map the same way veritas claim init derives it, because readiness requires one. An existing claim store is never replaced, even with --force; when the kept store lacks claims for work areas in the applied Repo Map, or has claims for work areas not in it, apply prints a warning naming them.
  • Re-authoring an already-governed repository preserves its authored Repo Standards, authority settings, governance guidance, and repository context by default. Deterministically discovered work areas are appended only when their paths are not already covered. An owner may explicitly request starter replacement with replaceExistingGovernance: true in guided answers.
  • Brownfield repos with existing guidance or convergence scripts also receive an existing_verification inventory and a recommended evidence-check inventory. Unknown catch evidence stays candidate/advisory until a maintainer supplies owner and review evidence.
  • Unknown init flags fail before any files are written.

Answers are JSON and may include:

{
  "evidenceCheck": "npm run verify",
  "selectedInstructionTargets": ["AGENTS.md", "CLAUDE.md"],
  "boundaries": ["Do not edit generated snapshots without approval."],
  "codingStyle": "Prefer small ESM modules.",
  "releaseExpectations": "Run npm test and npm run verify before merge."
}

selectedInstructionTargets controls the AI instruction files that --apply mutates and the governance-block requirement that starter Repo Standards enforce.

attest#

Records or inspects attestations for protected standards.

npx --no @kontourai/veritas attest bootstrap --actor <id> --approval-ref <ref> [--root <path>] [--non-interactive] [--valid-until-days <days>]
npx --no @kontourai/veritas attest policy-change --actor <id> --approval-ref <ref> --message <text> [--root <path>] [--valid-until-days <days>]
npx --no @kontourai/veritas attest status [--root <path>]

bootstrap records the first reviewed hashes for the current protected standards files: .veritas/repo-map.json, .veritas/repo-standards/default.repo-standards.json, and .veritas/authority/default.authority-settings.json. New attestations declare repoMapHashAlgorithm: "public-policy-v1"; the Repo Map hash is its recursively redacted public policy projection, so MCP server arguments, environment, and tool input are runtime execution inputs rather than protected policy identity. Unmarked historical records remain valid when their legacy file digest still matches, receive a nonblocking migration recommendation, and never expose that legacy digest in attest status. A legacy file mismatch fails closed and requires a policy-change attestation. policy-change records a reviewed successor and requires an explanation in --message. Both write paths require --approval-ref, a durable reference to the explicit human approval that authorized the attestation. status reports the current attestation, age, expiry, and hash drift. It also reports recordIntegrity: whether the record still matches the digest written with it (verified), was edited since (mismatch, status tampered, readiness fails), names an algorithm this version cannot check (unsupported-algorithm, status unverifiable, readiness fails), or predates record integrity (unbound, still current); see Record Integrity. It also reports priorAttestationLink for the active record: the reference it names as its predecessor, its form (attestation-id, legacy-reference, or unresolved), whether it resolved to a tracked record, and an explanation. A successor of an unmarked historical attestation names its predecessor by the opaque legacy-attestation-v0:<hash> reference rather than the id in HEAD, because the historical id embeds a digest of the raw Repo Map file. That is the expected migration link, not a broken chain; resolved is true only when the reference matches exactly one tracked record, and the readiness PASS line for policy-changes-require-attestation names the reference and whether it resolved.

The built-in requirement policy-changes-require-attestation fails when the active attestation no longer matches protected standards, or when its validity window has expired; see Validity Window. --valid-until-days takes a whole number of days, 1 or more, written in digits; any other value exits 2 without writing a record. With no attestation yet, or only a pending one, it reports an advisory warning instead.

Attestations are committed files, so veritas attest does not write the raw Git user.email into them. actor.identityEvidence.gitEmail is recorded only when the configured address is already a GitHub noreply address (…@users.noreply.github.com); otherwise it is null. There is no flag or config key that records any other address. actor.identityEvidence.signingKeyFingerprint follows the same rule for Git user.signingkey: a hex key id or a SHA256: fingerprint is recorded, and a key file path, an SSH literal key (key::…, whose comment can be an address), or anything else is recorded as null. Neither value is part of the attestation id or the content hash. Records written before record integrity carry no recordIntegrity digest, so maintainers may replace a personal address in those older records with a noreply address or null without changing veritas readiness verdicts. A record that carries recordIntegrity never holds a personal address, and editing any of its fields reads as tampered; veritas attest status echoes the active record, so its output changes only by that line. Scrubbing a file does not remove the old value from Git history. actor.id and the fields derived from it (collectedBy, the Surface event actor) are identity-bearing and must not be edited.

Collection Provenance#

Every attestation can carry an optional structured authorizing block that records how the act of attestation was authorized. Three kinds are supported:

  • explicit-statement — a standalone text statement naming the authorizing act.

    --authorizing-statement "Reviewed and approved the policy change"
    
  • exchange — a prompt/response pair capturing a delegated approval conversation. Both --authorizing-prompt and --authorizing-response are required; omitting either is a hard CLI error. --excerpt-source is optional and maps to the source field.

    --authorizing-prompt "Did you review the policy?" --authorizing-response "Yes, approved." [--excerpt-source slack://team-channel]
    
  • authorized-action — a UI-driven control action. All four fields are required: --prompt-ref, --rendered-prompt, --action (affirmed-control or typed), and --authority-ref. Primary use is programmatic.

    --prompt-ref <ref> --rendered-prompt "Confirm the policy change" --action affirmed-control --authority-ref <session-ref>
    

Channel mapping:

Channel Authorizing kind
cli-interactive explicit-statement auto-built from the command itself
delegated (chat/agent) exchange or explicit-statement
UI authorized-action

When --executed-by <id> is specified, it acts as a delegated-channel marker that requires either --authorizing-statement OR the --authorizing-prompt + --authorizing-response pair.

Admissibility transparency annotation:

When kind=explicit-statement and the statement shares no token overlap with the changed protected-standard node IDs or the attestation notes, Veritas records admissibilityWarning: true with a reason on the attestation. This is a transparency annotation — it never blocks readiness. The warning appears in attest status output and as an annotation on the PASS line in the readiness check output (e.g. "PASS ... (1 admissibility warning)").

hooks claude-code#

Prints, installs, or runs the Claude Code PreToolUse hook, and runs the SessionEnd capture.

npx --no @kontourai/veritas hooks claude-code print [--root <path>]
npx --no @kontourai/veritas hooks claude-code apply [--root <path>] [--force]
npx --no @kontourai/veritas hooks claude-code pre-tool-use [--root <path>] [--file <path>] [--actor <id>]
npx --no @kontourai/veritas hooks claude-code session-end [--root <path>]

session-end reads the Claude Code SessionEnd hook input from stdin and writes a standards-feedback draft from the session log it names as transcript_path, as feedback observe --tool claude-code does. VERITAS_SESSION_LOG_PATH, when set, takes precedence. With no session log path, or a path that does not exist, it writes a note to stderr and exits 0, so ending the session is never held up.

pre-tool-use reads the Claude hook JSON payload from stdin, extracts tool_input.file_path or tool_input.path, resolves the actor from --actor, VERITAS_ACTOR, or the current attestation, and returns hook protocol JSON. For an allowed edit with matching rules, it includes the path-selected explain guidance in hookSpecificOutput.additionalContext. An Edit, MultiEdit, or Write call without a file path blocks because no path-specific guidance or boundary check can run. The generated hook covers those three edit tools; shell commands and runtimes without a pre-edit hook still need an explicit path briefing.

Exit codes follow the Claude Code PreToolUse protocol, where exit 2 is the only code that blocks the tool call — any other non-zero exit is reported as a non-blocking hook error and the edit proceeds:

Decision Exit code Effect in Claude Code
block (deny-enforced failure) 2 the edit is blocked and the reason is returned to the agent
approve 0 the edit proceeds

The Veritas pre-edit hooks can block path-bearing edits. Both explicit bypasses are recorded to .kontourai/veritas/standards-feedback/exceptions.jsonl:

  • VERITAS_EXCEPTION_RULE + VERITAS_EXCEPTION_REASON allow one specific denied rule and append a rule-exception record.
  • VERITAS_HOOK_SKIP=1 skips evaluation entirely and appends a hook-skip record (set VERITAS_HOOK_SKIP_REASON to say why). Unlike the generated git and runtime hooks, the PreToolUse gate resolves this bypass inside Veritas rather than in the shell body, so a skipped gate still leaves a record in the repo.

Both records carry the resolved actor, the file, and a timestamp, and both count toward the exception_count reported by standards feedback.

hooks codex#

The Governance Kit declares a .codex/hooks.json provision installed through flow-agents kit provision. Its PreToolUse handler invokes veritas hooks codex pre-tool-use. Codex sends apply_patch contents in tool_input.command; Veritas extracts all Update, Add, Delete, and Move paths, evaluates each against the Repo Standards, and returns matching guidance as hookSpecificOutput.additionalContext. An allowed edit with no new guidance returns an empty JSON object; the Codex command never emits the legacy top-level decision: "approve" field, which current Codex treats as a hook failure. A malformed or pathless patch is denied with exit 2. A supported strict-area refusal also uses Codex's permissionDecision: "deny" output. Shell commands can edit files without a parseable patch path, so this hook does not claim to cover them; required readiness checks still run after a change. Codex project hooks must be reviewed and trusted in /hooks before they execute.

integrations#

Installs or inspects runtime integrations through the tool-agnostic integration namespace.

npx --no @kontourai/veritas integrations codex status
npx --no @kontourai/veritas integrations codex uninstall [--root <path>]
npx --no @kontourai/veritas integrations claude-code install [--root <path>] [--force]
npx --no @kontourai/veritas integrations cursor install [--root <path>] [--force]
npx --no @kontourai/veritas integrations copilot status [--root <path>]

Codex and Claude Code have session log readers. Claude Code install wires PreToolUse, Stop, and SessionEnd hooks; SessionEnd captures a standards-feedback draft from the session log. Codex install wires PreToolUse and Stop hooks and does not capture session logs, because the Codex reader does not read Codex rollout transcripts. Cursor and Copilot currently install generic stop-hook wiring and report sessionLogReader: null.

uninstall is available for Codex, Claude Code, Cursor, and Copilot, but it is manual guidance only. The JSON response reports removed: false and capabilityState: "manual"; Veritas does not remove files, hooks, or tool configuration automatically yet.

report#

Generates an evidence artifact for a set of files or a repo state slice.

npx --no @kontourai/veritas readiness --check evidence [--root <path>] [--repo-map <path>] [--repo-standards <path>] [--run-id <id>] [file ...]
npx --no @kontourai/veritas readiness --check evidence --format feedback --working-tree
npx --no @kontourai/veritas readiness --check evidence --working-tree
npx --no @kontourai/veritas readiness --check evidence --staged
npx --no @kontourai/veritas readiness --check evidence --unstaged --untracked
npx --no @kontourai/veritas readiness --check evidence --changed-from <ref> --changed-to <ref>
npx --no @kontourai/veritas readiness --check evidence --trend

Important behaviors:

  • explicit files produce source_kind: "explicit-files"
  • branch comparisons produce source_kind: "branch-diff"
  • working-tree modes produce source_kind: "working-tree"

Every report also includes an integrity block. integrity.sourceRef mirrors the source anchor used for staleness decisions, integrity.fileRefs records readable changed-file fingerprints, and integrity.configRefs records hashes for Repo Map, Repo Standards, and settings files when those paths are available. Surface Console views use this to explain what a verified claim was actually verified against.

  • the Repo Map selects evidenceCheck commands through explicit evidenceCheck definitions, required check ids, default check ids, and optional routes
  • the artifact is written to the Repo Map-defined artifactDir
  • every artifact includes trust.bundle, a Surface TrustBundle projection with claims, evidence, policies, and events
  • Veritas owns repo-native claimGroup and Surface owns generic validation and report generation
  • JSON is the default output; --format feedback prints the same lint-style findings used by hooks
  • --format trust-bundle writes only the report's canonical trust.bundle JSON to stdout, suitable for direct attachment to a Flow gate; evidence-check diagnostics go to stderr
  • --trend prints the standards-feedback trend with sparklines and MTTR instead of generating a new report

explain#

Prints only the standards explanation relevant to a requirement, work area, or file.

npx --no @kontourai/veritas explain required-veritas-schema-artifacts
npx --no @kontourai/veritas explain --file src/index.mjs
npx --no @kontourai/veritas explain --file src/index.mjs --json
npx --no @kontourai/veritas explain --work-area app.src

Output is capped to fit an agent context window and includes the local governance excerpt plus matching rule explain blocks. --json returns a versioned selector and the same matching rule IDs, enforcement levels, linked evidenceCheckIds, summaries, mustDo, mustNotDo, examples, and context links for runtime hooks and kit adapters. It is guidance, not evidence that the agent followed a rule or that a behavioral check passed.

boundaries check (legacy)#

Checks strict work area ownership for a working tree or diff. Prefer readiness --check boundaries instead; boundaries check remains available for backward compatibility.

npx --no @kontourai/veritas readiness --check boundaries --actor cli-team [--working-tree | --diff main]

--actor is required unless VERITAS_ACTOR is set. Veritas intentionally does not fall back to the operating-system user, because CI runner names and shell usernames are not governance actors. If no actor is supplied, the command exits non-zero with a missing-actor failure.

Strict nodes fail when the actor is neither an owner nor listed in boundaryAllow. This means a working tree that spans several strict work areas may legitimately fail for one actor while passing for another owner or allowlisted actor.

To attach readiness directly to a trust-bundle gate, emit the canonical bundle without an adapter:

npx --no @kontourai/veritas readiness --working-tree --format trust-bundle > readiness.bundle.json

To turn a Veritas readiness artifact into a Surface trust report, use the reportArtifactPath returned by veritas readiness --format json as the stable path. Do not reconstruct .kontourai/veritas/evidence/<run-id>.json in downstream tools.

artifact_path="$(npx --no @kontourai/veritas readiness --working-tree --format json | node -e 'let data=""; process.stdin.on("data", c => data += c); process.stdin.on("end", () => { const parsed = JSON.parse(data); if (!parsed.reportArtifactPath) throw new Error("missing reportArtifactPath"); console.log(parsed.reportArtifactPath); });')"
node -e 'const fs = require("node:fs"); const artifact = JSON.parse(fs.readFileSync(process.argv[1], "utf8")); process.stdout.write(JSON.stringify(artifact.trust.bundle, null, 2));' "$artifact_path" > .kontourai/veritas/external/surface-bundle.json
surface report --repo-map surface --input .kontourai/veritas/external/surface-bundle.json --format summary

Portable consumers can find merge readiness by selecting trust.bundle.claims[] or generated trust.report.claims[] where claimType is software-readiness-verdict and subjectType is repository-change. Integrity scope is available in claim/evidence metadata; authority trace is available as first-class trust.bundle.authorityTrace.

Surface generates report-only fields such as id, generatedAt, summary, transparencyGaps, and evidenceRequirementsByClaimId. Veritas owns repo-native evidence collection and projection; Surface owns generic validation and report generation.

Current evidence artifacts also include trust.report, a compact summary generated by Surface's buildTrustReport. veritas readiness emits WARN lines for Surface-derived stale or disputed claims, and veritas explain <rule-id> includes the latest Surface claim status and transparency gaps for the matching policy claim.

coverage#

Prints readiness coverage without requiring operators to read the full report artifact.

npx --no @kontourai/veritas readiness --check coverage [--root <path>] [--repo-map <path>] [--repo-standards <path>] [--run-id <id>] [file ...]
npx --no @kontourai/veritas readiness --check coverage --working-tree
npx --no @kontourai/veritas readiness --check coverage --format feedback --working-tree
npx --no @kontourai/veritas readiness --check coverage --format json --working-tree

Important behaviors:

  • default output is a short human-readable readiness coverage summary
  • --format json returns the current readiness-coverage and inventory fields
  • --format feedback reuses the same lint-style summary as report --format feedback
  • the command uses the same Repo Map, Repo Standards, and source-scope flags as report
  • malformed declared inventory manifests fail with the manifest path and item id

readiness orchestration#

Runs evidence checks first, then creates a report, then creates a standards-feedback draft, and optionally finishes the feedback record if the missing judgment fields are supplied.

npx --no @kontourai/veritas readiness [--root <path>] [--repo-map <path>] [--repo-standards <path>] [--authority-settings <path>]
  [--format feedback|json]
  [--evidence-check-command <cmd> | --skip-evidence-check]
  [--working-tree | --changed-from <ref> --changed-to <ref>]
  [--actor <id>]
  [--run-id <id>]
  [--reviewer-confidence <scale-entry|unknown>]
  [--time-to-green-minutes <number>]
  [--exception-count <number>]
  [--false-positive-rule <rule-id>]
  [--missed-issue <text>]
  [--note <text>]
  [--accepted-without-major-rewrite <true|false>]
  [--required-followup <true|false>]
  [--force]

If accepted_without_major_rewrite, required_followup, and time_to_green_minutes are not all present, the command stops after report plus draft. Feedback mode prints the report path, standards-feedback draft path, and run id in the footer. JSON mode returns the orchestration object with the suggested feedback-record command.

Evidence Check commands are executed as tokenized argv, not through an implicit shell. Keep each command to one executable plus arguments, or move compound shell logic into a real script.

--skip-evidence-check is a deliberate diagnostic-only mode. It may generate guidance and a report, but when the Repo Map declares requiredEvidenceCheckIds, those checks are recorded as skipped and canonical Merge Readiness remains not-ready / rejected.

An explicit --evidence-check-command is additive and required. It runs alongside the Repo Map's required checks and does not replace them, and it is itself a required check for that run. If it exits nonzero, readiness fails: the command reports FAIL required-evidence-check:<id>: failed, JSON output sets evidenceCheckFailure and readiness.verdict: "not-ready", and the process exits 1. The <id> is the matching Repo Map check's id when the command equals a configured command, and otherwise an explicit-command-<slug> id. When the command equals an optional configured check's command, that check becomes required for the run, including its external tool: with externalTool.blocking: true, a fail or missing artifact verdict also blocks readiness. The flag takes exactly one non-empty command as the next argument. Giving it more than once, together with --skip-evidence-check, in the --evidence-check-command=<cmd> form, or with an empty or missing value is a usage error: readiness exits 2 with a message and runs nothing. A failing configured required check still fails readiness when the explicit command passes. To run a diagnostic that does not block, declare it in the Repo Map as a default or routed check that is not listed in requiredEvidenceCheckIds, and run readiness without --evidence-check-command; see MIGRATING.md.

External tool evidenceChecks follow the same rule. For tools such as Fallow, put shell-sensitive behavior like 2>/dev/null || true inside a script, have that script write a JSON artifact under .kontourai/veritas/, and point the check's externalTool.artifactPath at that file. Advisory external tool findings appear as warnings in feedback; blocking external tool findings fail the run.

Exit codes:

  • 0: no blocking failures
  • 1: evidenceCheck or blocking policy failure
  • 2: config/runtime error

standards feedback draft#

Builds a repo-local draft artifact from a repo-local evidence artifact.

npx --no @kontourai/veritas feedback draft --evidence <path> [--authority-settings <path>] [--output <path>] [--force]
  [--reviewer-confidence <scale-entry|unknown>]
  [--time-to-green-minutes <number>]
  [--exception-count <number>]
  [--false-positive-rule <rule-id>]
  [--missed-issue <text>]
  [--note <text>]

feedback observe#

Builds a standards-feedback draft from a Codex or Claude Code session log. With --tool none, it uses filesystem artifacts instead of a session log.

npx --no @kontourai/veritas feedback observe [--session-log <path>] [--tool auto|codex|claude-code|none] [--evidence <path>] [--output <path>] [--rewrite-threshold <ratio>] [--verbose]

When a heuristic cannot compute a value, the draft stores a reason object such as { "value": null, "reason": "no_passing_run_observed" } instead of a bare null. The command validates the draft shape before writing unless VERITAS_SKIP_STANDARDS_FEEDBACK_VALIDATION=1 is set.

Filesystem fallback fields include source: "filesystem-inferred" so session-log-derived and artifact-derived values stay distinguishable.

Guardrail:

  • evidence input must be under .kontourai/veritas/evidence/
  • the generated draft now includes a derived governance object that records whether the evidence touched the Protected Standards and whether protected-standards review is required

standards feedback record#

Completes a standards-feedback record from either evidence directly or a previously created draft.

npx --no @kontourai/veritas feedback record --evidence <path> [--authority-settings <path>] [--output <path>] [--force]
  --accepted-without-major-rewrite <true|false>
  --required-followup <true|false>
  --reviewer-confidence <scale-entry|unknown>
  --time-to-green-minutes <number>
  --exception-count <number>

npx --no @kontourai/veritas feedback record --draft <path> [--authority-settings <path>] [--output <path>] [--force]
  --accepted-without-major-rewrite <true|false>
  --required-followup <true|false>
  --reviewer-confidence <scale-entry|unknown>
  --time-to-green-minutes <number>
  --exception-count <number>

Guardrails:

  • evidence input must stay under .kontourai/veritas/evidence/
  • draft input must stay under .kontourai/veritas/standards-feedback-drafts/
  • a draft must be completed with the same standards settings that created it
  • the completed record keeps the same derived governance object so governance-touching feedback can be measured later
  • existing output is not overwritten without --force

feedback marker#

Scores a deterministic marker-surfacing benchmark by comparing one without Veritas session log to one with Veritas session log against the same benchmark scenario.

npx --no @kontourai/veritas feedback marker \
  --scenario examples/benchmarks/migration/scenario.json \
  --without-veritas-session-log examples/benchmarks/migration/without-veritas.json \
  --with-veritas-session-log examples/benchmarks/migration/with-veritas.json

Important behaviors:

  • the command is read-only and prints JSON to stdout
  • the scenario defines the required marker phrases and the scoring window
  • session logs must declare the matching benchmark_id plus the expected without-veritas or with-veritas condition id
  • session logs must include a trigger tag, and may include a response-window tag when the tagged assistant turn is the response that must carry the marker
  • this command scores one benchmark pair; repeat it across multiple runs when you want pass^k-style evidence, or use marker-suite for the aggregated pass_pow_k metric

feedback marker-suite#

Scores a suite of marker benchmarks and reports aggregate reliability metrics across multiple scenario groups and trials.

npx --no @kontourai/veritas feedback marker-suite \
  --suite examples/benchmarks/suites/context-surfacing-suite.json

Important behaviors:

  • the suite artifact references scenario files plus one or more trial session log pairs per benchmark
  • each benchmark_id and trial_id in the suite must be unique
  • aggregate metrics include per-trial rates and grouped reliability summaries
  • improvement_rate counts trials where Veritas improves outcome quality or delivers the same correct outcome faster
  • pass_at_1 is computed from the first listed trial in each benchmark group
  • pass_at_k means a benchmark has at least one passing with Veritas trial across its recorded trials
  • pass_pow_k is the suite report name for pass^k: every recorded with Veritas trial in a benchmark group passes
  • the command validates every referenced scenario and session log before producing a suite summary

standards feedback summary#

Reads .kontourai/veritas/standards-feedback/history.jsonl and prints recent local outcome metrics.

npx --no @kontourai/veritas feedback summary [--root <path>]

The summary includes acceptance count, required rewrites, average time to green, average exceptions, confidence distribution, and the most flagged false-positive rule.

feedback recommend#

Reads .kontourai/veritas/standards-feedback/history.jsonl and writes non-blocking recommendation artifacts under .kontourai/veritas/recommendations/.

npx --no @kontourai/veritas feedback recommend [--root <path>] [--force] [--dry-run]

The generator looks for frequently excepted failures, warning requirements that did not cause follow-up, and paths that repeatedly matched no work area. Quiet history alone does not produce retirement suggestions.

recommendation#

Review recommendation artifacts.

npx --no @kontourai/veritas recommendation list [--root <path>] [--status proposed|accepted|rejected|all]
npx --no @kontourai/veritas recommendation show <id> [--root <path>]
npx --no @kontourai/veritas recommendation decide <id> --accept|--reject --actor <id> [--approval-ref <ref>] [--message <text>] [--root <path>]

veritas attest recommendation <id> --accept|--reject --actor <id> is the authority-loop alias. Accepting a recommendation applies the recorded standards diff and creates a recommendation-acceptance attestation, so accepted recommendations also require --approval-ref. Rejecting records the decision without changing standards files.

print#

Print-only helpers return suggested content without changing the repo.

npx --no @kontourai/veritas print package-scripts [--root <path>] [--evidence-check <cmd>]
npx --no @kontourai/veritas print ci-snippet [--root <path>] [--evidence-check <cmd>]
npx --no @kontourai/veritas print git-hook [--root <path>] [--hook post-commit|pre-push]
npx --no @kontourai/veritas print runtime-hook [--root <path>]
npx --no @kontourai/veritas print stop-hook [--root <path>] [--tool generic|claude-code|cursor]
npx --no @kontourai/veritas print governance-block
npx --no @kontourai/veritas print codex-hook [--root <path>] [--target-hooks-file <path>] [--codex-home <path>]
npx --no @kontourai/veritas print claude-code-pre-tool-use-hook [--root <path>]

Printed helper surfaces:

  • suggested package.json scripts
  • a CI snippet
  • a tracked git hook body
  • a tracked runtime hook body
  • a generic stop-hook body and thin tool-specific wrapper configs
  • the canonical Veritas governance block
  • a tracked Codex hooks config plus optional target inspection status
  • a Claude Code PreToolUse hook that injects veritas explain context before file edits

readiness --check config#

Validates this repo's governance config against the JSON Schemas Veritas publishes for it.

npx --no @kontourai/veritas readiness --check config [--root <path>] [--repo-map <path>] [--repo-standards <path>] [--format json]

Checks .veritas/repo-map.json against schemas/veritas-repo-map.schema.json and .veritas/repo-standards/default.repo-standards.json against schemas/veritas-repo-standards.schema.json, printing one PASS / FAIL / SKIP line per artifact and exiting 1 if either is invalid. This is the gateable form of the check — put it in CI or a pre-push lane to make config drift an authoring-time error.

Legacy Repo Map and legacy Repo Standards loads warn by default unless strict mode is requested or VERITAS_STRICT_CONFIG=1 is set. Resource-shaped Repo Standards always validate strictly, and plan explicitly loads both configurations strictly. The standalone config check exits nonzero for invalid configuration regardless of those load defaults.

Both schemas set additionalProperties: false, so a field the schema does not define — a rule attribute Veritas never reads, for example — is reported rather than silently ignored.

setup#

Installs or repairs first-class repo setup.

npx --no @kontourai/veritas setup repo-hooks [--root <path>] [--force]

setup repo-hooks installs or repairs:

  • .githooks/post-commit
  • .githooks/pre-push
  • executable bits for both hook files
  • repo-local core.hooksPath=.githooks

This is the recommended command for local Git hook repair. Developers do not need to run raw git config commands. By default, setup is idempotent for Veritas-generated hook bodies and refuses to overwrite custom hook files; pass --force to replace existing hook files with the generated Veritas versions.

apply#

Write the suggested assets into the repo.

npx --no @kontourai/veritas apply package-scripts [--root <path>] [--evidence-check <cmd>] [--force]
npx --no @kontourai/veritas apply ci-snippet [--root <path>] [--output <path>] [--evidence-check <cmd>] [--force]
npx --no @kontourai/veritas apply git-hook [--root <path>] [--hook post-commit|pre-push] [--output <path>] [--configure-git] [--force]
npx --no @kontourai/veritas apply runtime-hook [--root <path>] [--output <path>] [--force]
npx --no @kontourai/veritas apply stop-hook [--root <path>] [--tool generic|claude-code|cursor] [--output <path>] [--force]
npx --no @kontourai/veritas apply governance-blocks [--root <path>] [--force]
npx --no @kontourai/veritas apply codex-hook [--root <path>] [--output <path>] [--target-hooks-file <path> | --codex-home <path>] [--force]
npx --no @kontourai/veritas apply claude-code-pre-tool-use-hook [--root <path>] [--output <path>] [--force]

npx --no @kontourai/veritas apply --help and npx --no @kontourai/veritas print --help list the targets. Each target refuses an unknown flag, a flag without its value, a value outside the listed choices, an extra positional argument, and a --root that is not an existing directory before it writes anything. A target that also merges a tool config (stop-hook with --tool claude-code|cursor, claude-code-pre-tool-use-hook, codex-hook with a target hooks file) reads and merges that config first, so a malformed config leaves nothing written. An existing generated file that already holds exactly what the target would write is accepted without --force; one that differs is refused.

Write restrictions are intentional:

  • CI snippets must stay under .veritas/snippets/
  • runtime hooks must stay under .veritas/hooks/
  • stop hooks must stay under .veritas/hooks/
  • Codex hook artifacts must stay under .veritas/runtime/
  • standards feedback artifacts must stay under .kontourai/veritas/standards-feedback/
  • git hooks must stay under .githooks/

apply git-hook remains available for lower-level scripting, custom output-path control inside .githooks/, and installing one hook at a time. For normal repository setup or repair, prefer setup repo-hooks.

apply governance-blocks is the executable remediation named by the ai-instruction-files-synced readiness result. It updates only the configured AI instruction targets, replacing content only between Veritas governance markers; unknown apply targets fail closed.

apply governance-blocks and the governance-block requirement read the same target list: the Repo Map's activation.aiInstructionFiles together with the paths in each governance-block requirement's match. A path a requirement names is required; a Repo Map entry keeps its own required flag, and a missing optional target is neither created nor reported. A list that is present counts even when it is empty: init writes [] to both lists for a repository with no instruction files, and then apply governance-blocks writes nothing and says so in its message. Only a repository with neither list configured gets the built-in defaults, AGENTS.md and CLAUDE.md, plus .cursorrules when it exists. Both lists are read from .veritas/repo-map.json and .veritas/repo-standards/default.repo-standards.json. Paths are compared in repository-relative form, so ./AGENTS.md and AGENTS.md are one target. A path that is absolute or leaves the repository is an invalid-governance-target finding in readiness, readiness --check config rejects it against the schema, and apply governance-blocks refuses to write anything until it is corrected.

The block it writes tells agents to run npx --no @kontourai/veritas readiness, which runs only an installed Veritas. In a fresh clone whose dependencies are not installed yet, and in a repository without @kontourai/veritas as a dependency, npx refuses with npx canceled due to missing packages. The block names both remedies: install the repository's dependencies, adding @kontourai/veritas as a development dependency if it is not one.

runtime status#

Inspects the installed state of tracked runtime integrations.

npx --no @kontourai/veritas integrations codex status [--root <path>] [--target-hooks-file <path>] [--codex-home <path>]
npx --no @kontourai/veritas integrations codex uninstall [--root <path>]

It reports:

  • whether .githooks/post-commit exists and is executable
  • whether .githooks/pre-push exists and is executable
  • whether core.hooksPath points at .githooks
  • whether .veritas/hooks/agent-runtime.sh exists and is executable
  • whether .veritas/runtime/codex-hooks.json exists
  • whether the target Codex hooks file already contains the Veritas command
  • the next repair or install commands to run

integrations <tool> uninstall currently reports manual uninstall state for codex, claude-code, cursor, and copilot:

{
  "removed": false,
  "capabilityState": "manual",
  "reason": "Uninstall is intentionally manual for now."
}

This command is non-destructive. Remove generated hooks or tool configuration manually until automated uninstall support is implemented.

Git hook setup or repair suggestions point to:

npx --no @kontourai/veritas setup repo-hooks

Generated Hook Behavior#

print git-hook and apply git-hook produce a post-commit hook that:

  • skips itself when VERITAS_HOOK_SKIP=1
  • compares HEAD~1..HEAD on normal commits
  • uses the empty tree for the first commit
  • calls veritas readiness

They can also produce a pre-push hook that:

  • skips itself when VERITAS_HOOK_SKIP=1
  • calls npm run --if-present prepush
  • relies on the repo's push-safe prepush script instead of the full test suite

print runtime-hook and apply runtime-hook produce a shell wrapper that:

  • skips itself when VERITAS_HOOK_SKIP=1
  • defaults to veritas readiness --format json --working-tree
  • forwards any explicit arguments through to veritas readiness --format json

print stop-hook and apply stop-hook produce .veritas/hooks/stop.sh, which:

  • skips itself when VERITAS_HOOK_SKIP=1
  • runs veritas readiness --format feedback --working-tree
  • prints failures back to the agent
  • exits 0 so the AI session can continue and repair the findings

print codex-hook and apply codex-hook produce a tracked Codex config with PreToolUse guidance for supported edit tools and the runtime hook as a Stop hook. The host must load and trust the configuration before it executes.

The Claude Code PreToolUse hook (.veritas/hooks/pre-tool-use.sh) deliberately does not skip itself in the shell body. It always calls veritas hooks claude-code pre-tool-use, which honours VERITAS_HOOK_SKIP=1 and records the bypass before approving.

Environment Variables#

  • VERITAS_HOOK_SKIP=1: skips generated git/runtime hook execution. For the Claude Code PreToolUse gate it skips evaluation but appends a hook-skip record to .kontourai/veritas/standards-feedback/exceptions.jsonl
  • VERITAS_HOOK_SKIP_REASON: optional free-text reason stored on that hook-skip record
  • VERITAS_STRICT_CONFIG=1: makes a Repo Map or Repo Standards file that fails schema validation a hard load failure instead of a warning

Do not set either skip variable in CI if the CI lane is meant to enforce evidenceCheck execution.

Output Shape#

The exact JSON varies by command, but the operator-facing contract is stable:

  • print/apply commands return machine-readable status objects
  • report returns artifactPath, markdownSummary, and the full evidence record including policy_results
  • standards-feedback draft returns artifactPath, suggestedRecordCommand, markdownSummary, and the full draft record
  • standards-feedback record returns artifactPath, historyPath, markdownSummary, and the full feedback record
  • standards-feedback summary returns a plain-text local history summary
  • marker scoring returns a benchmark comparison object with per-condition timing, false-positive, and pass results
  • marker suite scoring returns a suite report with per-benchmark rollups and aggregate reliability metrics
  • veritas readiness defaults to feedback text; --format json returns orchestration status plus the artifact paths it created

For the artifact fields themselves, see Artifacts and Schemas.

review#

veritas review --plan <path> --host-root <private-directory> --expires-at <ISO-date> [--root <path>] [--port <0..65535>] is the standalone compatibility command that creates and serves an optional Survey review of a current init plan. It requires Survey >=8.2.0 <10, a Git checkout and a mode-0700 host directory outside it. Port 0 selects an available loopback port. SIGINT or SIGTERM closes its server. The JSON startup line includes the URL, private session file, basis digest and expiry. Its optional public adapter is @kontourai/veritas/governance-review. It records operator dispositions, never protected standards or human attestations. See the Governance Kit guide for decision semantics, MCP, bounds, and trusted host authority integration.

For installed-kit review, prefer flow-agents kit review veritas-governance --dest <bootstrap> --request <private-review-request.json>. The Governance Kit manifest exposes a kontour.kit.review_request@1.0 producer to the native host; Veritas retains plan/authority admission, while Flow Agents owns transport and installed-source integrity. The existing standalone CLI/API remain compatible.

Source: docs/reference/cli.md