kapi terms expand
kapi expand [bundle]Ask a model for the other shapes each term takes in its own language (the plural, the definite form, a case ending) and write them onto the term as forms.
A declared form is how kapi recognises a rendering that changes the word: the Norwegian plural "varsler" is a use of the term "varsel" once the term lists it.
By default this asks about target terms, meaning every language except the source language, and leaves terms that already declare forms alone. It writes the bundle named on the command line, or the project's committed terms source, or else the store the terms flags select. It prints each proposal and the forms the filters dropped; review the diff before committing it.
Demo mode — illustrative output from a built-in stub, not a real model. Install the CLI to run with your own API key.
kapi terms expand --dry-run| Flag | Type | Default | Description |
|---|---|---|---|
| --api-key | string | API key for the AI provider | |
| --color | string | auto | colorize output: auto, always, never |
| --credential | string | saved credential name (see 'kapi credentials list') | |
| --dry-run | bool | false | print what would be added and write nothing |
| --file | string | explicit path to resource file | |
| --jq | string | filter JSON output through a jq expression (implies --json) | |
| --json | bool | false | Output in JSON format |
| --local | bool | false | use resource in current directory |
| --locale | stringSlice | only terms in these locales; a bare language matches every region (default: every language except the source language) | |
| --model | string | AI model name | |
| --name | string | named resource in KAPI_HOME (e.g. --name project-terms) | |
| --output-format | string | Output format: text (alias: table), json, yaml | |
| --overwrite | bool | false | ask again about terms that already declare forms, and replace them |
| --project, -p | string | path to a kapi.yaml project recipe or its directory (auto-discovered from cwd if omitted) | |
| --provider | string | AI provider (default: anthropic) | |
| --source-locale, -s | string | language the source terms are written in (default: the project's source language) | |
| --text | bool | false | Output in text format (default) |
kapi terms expand --locale nb --locale de kapi terms expand .kapi/terms.json --overwrite← Back to the Command Reference