Skip to main content

kapi extract

kapi extract

Emit bilingual XLIFF 2.x (default) or PO files for each target locale declared in a kapi project, pre-filled from the project's translation memory.

Each invocation writes one batch of outputs under .kapi/cache/extractions/<batch-id>/ plus one bilingual file per source → target pair in --out-dir (default "out/").

Commandextract
Groupadvanced
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 extract -p kapi.yaml --no-tm
Flags
FlagTypeDefaultDescription
--forceboolfalsere-extract every file, ignoring the incremental reuse of unchanged sources
--formatstringxliff2bilingual output format (xliff2 | po | kpz)
--no-tmboolfalseskip content-memory pre-fill on extract
--onlystringrestrict to a single content collection by name
--outstringmerge-time output layout recorded in the .kpz (e.g. 'translated/{lang}/{name}.{ext}')
--out-dirstringoutdirectory for emitted bilingual files (relative to project)
--output, -ostringwrite an ad-hoc .kpz workspace from the given source files
--patternstringextra glob pattern restricting which source files to include
--progressstringstream progress events to stderr as NDJSON (value: jsonl); events use the flow-run event vocabulary
--project, -pstringpath to a kapi.yaml project recipe or its directory (auto-discovered from cwd if omitted)
--redactboolfalsereplace sensitive content with placeholders; originals stay in a local vault for merge
--redact-rulesstringpath to a redaction rules YAML file (implies --redact)
--target-langstringcomma-separated target locales (default: all in recipe)
--with-sourceboolfalseembed raw source bytes in the .kpz (default: identity + skeleton only)
--xliff-versionstringXLIFF 2.x version to emit (2.0, 2.1, 2.2; default 2.2)
More examples
kapi extract -p kapi.yaml --target-lang fr
kapi extract -p kapi.yaml --target-lang fr,de,es
kapi extract src/*.json -o work.kpz --target-lang fr,qps # ad-hoc .kpz workspace

← Back to the Command Reference