Gå til hovedinnhold

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.

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
--diff-against stringcheck only the content blocks changed since this git revision, including untracked files (runs git diff read-only)
--diff-file stringcheck only the content blocks this unified diff touches (a file, or - for standard input)
--diff-range stringcheck 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 stringSlicedo-not-translate terms that must survive verbatim into the target (with --target)
--forbid stringSliceregex that must NOT appear in the content (repeatable)
--gate stringSlicewith --ship: run only the named project gates (voice, terminology, qa); repeatable
--lenient boolfalsereport only: never fail the gate (still prints findings)
--locale stringwith --ship: scope the target-side gates to a single target locale (e.g. fr)
--max-chars int0flag content longer than this many characters (0 = off)
--max-critical int0fail if critical findings exceed this count
--max-major int-1fail if major findings exceed this count (-1 = no limit)
--max-minor int-1fail if minor findings exceed this count (-1 = no limit)
--max-words int0flag content with more than this many words (0 = off)
--min-score int0fail if the roll-up score is below this (0 = no score gate); with --ship: the brand-gate compliance threshold (default 80)
--no-fail boolfalseexit 0 even when the gate fails (fix-loop mode)
--pack stringbuilt-in brand starter pack
--profile stringvoice profile name from the local store
--profile-file stringpath to a voice profile YAML
--project , -pstringpath to a kapi.yaml project recipe or its directory (auto-discovered from cwd if omitted)
--require stringSliceregex that MUST appear in the content (repeatable)
--ship boolfalseproject 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 stringsource language (e.g. en, en-US; defaults to the project's source_language, else en)
--staged boolfalsecheck only the content blocks the staged changes touch, each file read from the index (leaves out unstaged edits and untracked files)
--strict boolfalsestrict gate: fail on any critical or major finding
--target stringtranslated target file to check against the (single) source, enabling bilingual checks
--target-lang stringlocale of the --target file (e.g. de)
--termstore stringwith --ship: named terms or terms-store path for the terminology gate (defaults to the project terms store)
--validate stringoffreader 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 boolfalsealso run the voice/style-similarity check (needs the kapi-check plugin and a profile with examples)
--voice-min float640.8voice-similarity cutoff (cosine, 0-1) below which a block is flagged off-voice

← Back to the Command Reference