Gå til hovedinnhold

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.

Commandcheck
Groupwork
Try it

Runs in your browser against a small sample file. Edit the command before running, or press Run to execute it as shown.

kapi check
Flags
FlagTypeDefaultDescription
--dntstringSlicedo-not-translate terms that must survive verbatim into the target (with --target)
--forbidstringSliceregex that must NOT appear in the content (repeatable)
--lenientboolfalsereport only: never fail the gate (still prints findings)
--localestringwith --ship: scope the target-side gates to a single target locale (e.g. fr)
--max-charsint0flag content longer than this many characters (0 = off)
--max-criticalint0fail if critical findings exceed this count
--max-majorint-1fail if major findings exceed this count (-1 = no limit)
--max-minorint-1fail if minor findings exceed this count (-1 = no limit)
--max-wordsint0flag content with more than this many words (0 = off)
--min-scoreint0fail if the roll-up score is below this (0 = no score gate); with --ship: the brand-gate compliance threshold (default 80)
--no-failboolfalseexit 0 even when the gate fails (fix-loop mode)
--packstringbuilt-in brand starter pack
--profilestringbrand profile name from the local store
--profile-filestringpath to a brand profile YAML
--project, -pstringpath to a kapi.yaml project recipe or its directory (auto-discovered from cwd if omitted)
--requirestringSliceregex that MUST appear in the content (repeatable)
--shipboolfalseproject 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-langstringensource language (e.g. en, en-US)
--strictboolfalsestrict gate: fail on any critical or major finding
--targetstringtranslated target file to check against the (single) source — enables bilingual checks
--target-langstringlocale of the --target file (e.g. de)
--termstorestringwith --ship: named terms or terms-store path for the terminology gate (defaults to the project terms store)
--validatestringoffreader 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)
--voiceboolfalsealso run the voice/style-similarity check (needs the kapi-check plugin and a profile with examples)
--voice-minfloat640.8voice-similarity cutoff (cosine, 0-1) below which a block is flagged off-voice

← Back to the Command Reference