Gå til hovedinnhold

kapi run

kapi run [flow-name] [flags]

Run a composed flow that chains multiple tools together.

Flows are multi-tool pipelines. For single-tool operations, use the tool directly (e.g. "kapi translate" instead of "kapi run translate"). To bring the whole project up to date, use 'kapi up' — the kapi loop lives there; run is the escape hatch for one named pipeline, one pass.

Built-in flows: translate-qa Translate + quality check using AI/LLM

Custom flows can be defined in the kapi.yaml recipe or .kapi/flows/ as YAML files.

Use -p to run a flow from a kapi.yaml recipe: kapi run translate -p kapi.yaml

Commandrun
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 run translate-qa -i app.xliff --target-lang fr
Flags
FlagTypeDefaultDescription
--api-keystringAPI key for the AI provider
--batchingstringhow many blocks share one LLM call: auto (default), single
--concurrency, -jint0number of files to process at once (0 = auto)
--contextstringwhat the model is told about a block besides the block: none, key (default), neighbours
--credentialstringsaved credential name to use (see 'kapi credentials list')
--encoding, -estringUTF-8input file encoding
--explainboolfalseprint the resolved source → sink bindings and exit without running
--format, -fstringoverride input format detection
--input, -istringSliceinput file path(s); repeat for multiple files
--instructionstringextra guidance for the model while translating (e.g. "informal register; keep product names in English")
--memorystringnamed Memory for recycle flow (resolves from KAPI_HOME)
--modelstringAI model name
--output, -ostringoutput path or template (e.g. ./out/{name}_{lang}.{ext})
--packboolfalsewhen transforming a .kpz, also eject the result to the .kpz (auto-pack)
--parallel-blocksint0fan out block processing across N goroutines (0 = off)
--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)
--providerstringanthropicAI provider (anthropic, openai, ollama)
--source-langstringensource language (e.g. en, en-US)
--statsboolfalseinclude part/block counts in output
--target-langstringtarget language (e.g. fr, de-DE)
--termstorestringnamed terms store for term-lookup/enforce (resolves from KAPI_HOME)
--tracestringwrite flow trace JSON to file (for flow visualization)
More examples
kapi run translate-qa -i messages.json --target-lang de
kapi run pseudo -p kapi.yaml # a project-defined flow

← Back to the Command Reference