Skip to main content

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.

Commandterms expand
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 terms expand --dry-run
Flags
FlagTypeDefaultDescription
--api-keystringAPI key for the AI provider
--colorstringautocolorize output: auto, always, never
--credentialstringsaved credential name (see 'kapi credentials list')
--dry-runboolfalseprint what would be added and write nothing
--filestringexplicit path to resource file
--jqstringfilter JSON output through a jq expression (implies --json)
--jsonboolfalseOutput in JSON format
--localboolfalseuse resource in current directory
--localestringSliceonly terms in these locales; a bare language matches every region (default: every language except the source language)
--modelstringAI model name
--namestringnamed resource in KAPI_HOME (e.g. --name project-terms)
--output-formatstringOutput format: text (alias: table), json, yaml
--overwriteboolfalseask again about terms that already declare forms, and replace them
--project, -pstringpath to a kapi.yaml project recipe or its directory (auto-discovered from cwd if omitted)
--providerstringAI provider (default: anthropic)
--source-locale, -sstringlanguage the source terms are written in (default: the project's source language)
--textboolfalseOutput in text format (default)
More examples
kapi terms expand --locale nb --locale de
kapi terms expand .kapi/terms.json --overwrite

← Back to the Command Reference