kapi check
kapi check [files...]Kjør innholdskontroller over én eller flere filer og returner strukturerte funn pluss bestått/ikke bestått, basert på alvorlighetsgrad — innholdsorientert motstykke til en testløper.
Standard kontrollsett er kildesiden og trenger ingen oversettelse: teksthygiene (tomme, doble mellomrom/ord, uønsket mellomrom), lengdegrenser (--max-chars/ --max-words), forbudte/påkrevde mønstre (--forbid/--require), og merkevare- vokabular når en profil er tilknyttet (--profile/--pack/--profile-file).
Tospråklige kontroller (ikke-oversett, plassholder-integritet) er valg-inn: send --target <file> --target-lang <lang> for å kontrollere et oversatt mål mot kilden.
Hvert funn har en stabil regel-id (<check>.<category>) og en blokkplassering, slik at en assistent kan fikse den nøyaktige blokken og spore regler på tvers av iterasjoner. Utdata er en menneskelig tabell som standard; --output-format json|yaml sender ut kapi.check/v1 Rapporten.
Posisjonsstier aksepterer glob-mønstre og kataloger, utvidet av kapi selv —
siter mønsteret og ** rekurserer identisk i alle skall. Inne i et .kapi-
prosjekt kontrollerer check uten filargumenter prosjektets deklarerte innhold;
å navngi filer begrenser det til disse.
Prosjektport-modus (--ship): den kjører prosjektets bundne kvalitetsporter (merkevare, terminologi, QA) pluss dets leverings-/kilde- dekningsporter over prosjektets innhold, og avslutter ikke-null når en port ikke er oppfylt — frigivelsesterskelen. Måldrift blokkerer aldri en vanlig bygging (se 'kapi status'); --ship er det eksplisitte, valg-inn håndhevingspunktet. Uten filargumenter inspiserer det prosjektets innhold × målspråk; send filer for å porthindre bare disse.
Avgangskoder: 0 bestått, 3 når porten feiler, 1 operasjonell. --no-fail avslutter alltid 0 (rapportmodus) for en fikse-løkke.
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 |
|---|---|---|---|
| --diff-against | string | check only the content blocks changed since this git revision, including untracked files (runs git diff read-only) | |
| --diff-file | string | check only the content blocks this unified diff touches (a file, or - for standard input) | |
| --diff-range | string | check only the content blocks changed between two commits, A..B or A...B (since their merge base), each file read from B and nothing from the working tree | |
| --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) | |
| --gate | stringSlice | with --ship: run only the named project gates (voice, terminology, qa); 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 | voice profile name from the local store | |
| --profile-file | string | path to a voice 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 (voice, terminology, rule-based checks) plus its ship/source coverage gates; exit non-zero when unmet: the pre-release bar |
| --source-lang | string | source language (e.g. en, en-US; defaults to the project's source_language, else en) | |
| --staged | bool | false | check only the content blocks the staged changes touch, each file read from the index (leaves out unstaged edits and untracked files) |
| --strict | bool | false | strict gate: fail on any critical or major finding |
| --target | string | translated target file to check against the (single) source, enabling 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