kapi check
kapi check [files...]Run content checks over one or more files and return structured findings plus a pass/fail, gating on severity — the content-first counterpart to a test runner.
The default checkset is source-side and needs no translation: text hygiene (empty, doubled spaces/words, stray whitespace), length limits (--max-chars/ --max-words), forbidden/required patterns (--forbid/--require), and brand vocabulary when a profile is bound (--profile/--pack/--profile-file).
Bilingual checks (do-not-translate, placeholder integrity) are an opt-in: pass --target <file> --target-lang <lang> to check a translated target against its source.
Each finding carries a stable rule id (<check>.<category>) and a block location, so an assistant can fix the exact block and track rules across iterations. Output is a human table by default; --output-format json|yaml emits the kapi.check/v1 Report.
Positional paths accept glob patterns and directories, expanded by kapi itself —
quote the pattern and ** recurses identically in every shell. Inside a .kapi
project, check with no file arguments checks the project's declared content;
naming files narrows it to those.
Project gate mode (--ship): it runs the project's bound quality gates (brand, terminology, QA) plus its ship/source coverage gates over the project's content, and exits non-zero when any gate is unmet — the pre-release bar. Target drift never blocks an ordinary build (see 'kapi status'); --ship is the explicit, opt-in enforcement point. With no file arguments it inspects the project's content x target languages; pass files to gate just those.
Exit codes: 0 pass, 3 when the gate fails, 1 operational. --no-fail always exits 0 (report mode) for a fix-loop.
Runs in your browser against a small sample file. Edit the command before running, or press Run to execute it as shown.
kapi check| Flag | Type | Default | Description |
|---|---|---|---|
| --dnt | stringSlice | do-not-translate terms that must survive verbatim into the target (with --target) | |
| --forbid | stringSlice | regex that must NOT appear in the content (repeatable) | |
| --lenient | bool | false | report only: never fail the gate (still prints findings) |
| --locale | string | with --ship: scope the target-side gates to a single target locale (e.g. fr) | |
| --max-chars | int | 0 | flag content longer than this many characters (0 = off) |
| --max-critical | int | 0 | fail if critical findings exceed this count |
| --max-major | int | -1 | fail if major findings exceed this count (-1 = no limit) |
| --max-minor | int | -1 | fail if minor findings exceed this count (-1 = no limit) |
| --max-words | int | 0 | flag content with more than this many words (0 = off) |
| --min-score | int | 0 | fail if the roll-up score is below this (0 = no score gate); with --ship: the brand-gate compliance threshold (default 80) |
| --no-fail | bool | false | exit 0 even when the gate fails (fix-loop mode) |
| --pack | string | built-in brand starter pack | |
| --profile | string | brand profile name from the local store | |
| --profile-file | string | path to a brand profile YAML | |
| --project, -p | string | path to a kapi.yaml project recipe or its directory (auto-discovered from cwd if omitted) | |
| --require | stringSlice | regex that MUST appear in the content (repeatable) | |
| --ship | bool | false | project gate mode: run the project's bound gates (brand, terminology, QA) plus its ship/source coverage gates; exit non-zero when unmet — the pre-release bar |
| --source-lang | string | en | source language (e.g. en, en-US) |
| --strict | bool | false | strict gate: fail on any critical or major finding |
| --target | string | translated target file to check against the (single) source — enables bilingual checks | |
| --target-lang | string | locale of the --target file (e.g. de) | |
| --termstore | string | with --ship: named terms or terms-store path for the terminology gate (defaults to the project terms store) | |
| --validate | string | off | reader structure/encoding validation: off|report|strict (report folds structure.*/encoding.* findings into the Report; strict also fails the gate on a Major+ structure/encoding problem) |
| --voice | bool | false | also run the voice/style-similarity check (needs the kapi-check plugin and a profile with examples) |
| --voice-min | float64 | 0.8 | voice-similarity cutoff (cosine, 0-1) below which a block is flagged off-voice |
← Back to the Command Reference