kapi translate
kapi translate [files...]Oversett filer gjennom den innebygde oversettelsesflyten: utnytt et tilknyttet innholdsminne først (en no-op uten ett), oversett resten med den konfigurerte AI-leverandøren, kjør deretter de deterministiske kontrollene (plassholdere, inline-tagger, uoversatt tekst) over det som ble produsert.
Dette er den sikrede varianten — den samme tretrinns-flyten som 'kapi up' løper gjennom for et prosjekt, anvendt på ad-hoc-filer. Det rå oversettelses-verktøyet (uten minnepass, uten kontroller) er fortsatt tilgjengelig som 'kapi exec translate'. For å oppdatere et helt prosjekt, bruk 'kapi up'.
Try it (demo)
Demo mode — illustrative output from a built-in stub, not a real model. Install the CLI to run with your own API key.
kapi translate messages.json --target-lang frFlags
| Flag | Type | Default | Description |
|---|---|---|---|
| --api-key | string | API key for the AI provider | |
| --batching | string | how many blocks share one LLM call: auto (default), single | |
| --concurrency , -j | int | 0 | number of files to process at once (0 = auto) |
| --context | string | what the model is told about a block besides the block: none, key (default), neighbours | |
| --credential | string | saved credential name to use (see 'kapi credentials list') | |
| --encoding , -e | string | input file encoding | |
| --explain | bool | false | print the resolved source → sink bindings and exit without running |
| --fail-on-unknown | bool | false | exit with error if any file cannot be processed (default: skip with a warning) |
| --format , -f | string | override input format detection | |
| --input , -i | stringSlice | input file path(s); repeat for multiple files | |
| --instruction | string | extra guidance for the model while translating (e.g. "informal register; keep product names in English") | |
| --memory | string | named Memory for recycle flow (resolves from KAPI_HOME) | |
| --model | string | AI model name | |
| --output , -o | string | output path or template (e.g. ./out/{name}_{lang}.{ext}) | |
| --pack | bool | false | when transforming a .kpz, also eject the result to the .kpz (auto-pack) |
| --parallel-blocks | int | 0 | fan out block processing across N goroutines (0 = off) |
| --progress | string | stream progress events to stderr as NDJSON (value: jsonl); events use the flow-run event vocabulary | |
| --project , -p | string | path to a kapi.yaml project recipe or its directory (auto-discovered from cwd if omitted) | |
| --provider | string | anthropic | AI provider (anthropic, openai, ollama) |
| --source-lang | string | source language (e.g. en, en-US; defaults to the project's source_language, else en) | |
| --stats | bool | false | include part/block counts in output |
| --strict | bool | false | alias for --fail-on-unknown |
| --target-lang | string | target language (e.g. fr, de-DE) | |
| --termstore | string | named terms store for term-lookup/enforce (resolves from KAPI_HOME) | |
| --trace | string | write flow trace JSON to file (for flow visualization) |
More examples
kapi translate docs/*.md --target-lang de -o out/{name}_{lang}.{ext} kapi translate app.xliff --target-lang ja --provider ollama← Back to the Command Reference