kapi add
kapi add <pattern> [pattern...]Add file patterns to this project's content so kapi knows which files to process. Patterns support ** for recursive matching. Format is auto-detected from the extension unless --format is given.
By default each pattern becomes a bare entry, which the project's default point governs. --name puts them in a named collection instead, and --channel binds that collection to a point in the context space (profile/channel), so a surface is governed by the voice that suits it rather than by the project default. Adding to a name that already exists extends that collection.
--target declares where a translated file goes: a template over {lang} and the path tokens ({path}, {name}, {ext}), or a directory to mirror into. Without one a flow that writes has nowhere of its own to write, so give it here rather than by hand-editing the recipe. A target that lands back inside the pattern it comes from is refused: the collection would re-track its own output as source.
kapi add "src//.html" kapi add "locales/.json" --format json kapi add "src//.html" "content/**/.md" kapi add "docs//*.md" --target "translated/{lang}/{path}.md" kapi add "support//*.md" --name northsea-support --channel northsea/docs
Runs in your browser against a small sample file. Edit the command before running, or press Run to execute it as shown.
kapi add| Flag | Type | Default | Description |
|---|---|---|---|
| --channel | string | bind the named collection to a point in the context space (profile/channel) | |
| --color | string | auto | colorize output: auto, always, never |
| --format , -f | string | file format (e.g. html, json); auto-detected if omitted | |
| --jq | string | filter JSON output through a jq expression (implies --json) | |
| --json | bool | false | Output in JSON format |
| --name | string | put the patterns in a named collection (created, or extended if it exists) | |
| --output-format | string | Output format: text (alias: table), json, yaml | |
| --project , -p | string | path to a kapi.yaml project recipe or its directory (auto-discovered from cwd if omitted) | |
| --target | string | where translated files go: a template over {lang} and the path tokens, or a directory to mirror into | |
| --text | bool | false | Output in text format (default) |
← Back to the Command Reference