Skip to main content

kapi init

kapi init

Create a kapi project here: a kapi.yaml recipe with collections for the content kapi found in the tree, and the wiring coding agents read.

kapi init reads the files under the directory, honouring .gitignore and skipping dependency, vendored and build directories, and writes a collection for each kind of content it recognises: documents grouped by directory (docs/**/*.md), a file at the root on its own (README.md), and i18n catalogs where a framework preset's layout or a file named for the source language marks them. Each collection carries a comment saying what it matched. The result is the same every time for the same tree, and nothing is asked.

Run it again on a project that already has a recipe and it leaves your collections as they are. It prints the content no collection reads yet, as recipe lines to paste and as the 'kapi add' command that writes each one.

The project name defaults to the directory's basename and the source language to en. --target-locale (repeatable) declares target languages, and catalogs then get a target beside their source. --preset <name> (alias --framework) writes a known stack's catalog layout even before its files exist; --list-presets lists the presets.

The recipe gets a stable id under 'id:', which survives a rename, a move and a clone. --mint-id writes one into an existing recipe that has none.

The project's context (its terms, voice and recorded decisions) lives in your workspace, not in the checkout. kapi keeps a cache for this checkout in .kapi/, which is ignored by version control and safe to delete.

For coding agents, kapi init writes an MCP server entry that starts 'kapi mcp' for this project (with --tools writing,translation when the recipe declares target languages) and one short skill, SKILL.md, naming the four habits kapi supports; 'kapi help <topic>' serves the rest. Claude Code is always wired; Cursor, VS Code, Codex and .agents/ are wired where the project already keeps their directory. --agents takes a comma-separated list (claude-code, cursor, vscode, codex, agents), 'all' or 'none'. An MCP entry someone else wrote is left as it is. In a skill directory an earlier kapi filled, the files it copied there are removed and any other file is kept. Codex reads its entry once you trust this repository there.

kapi init also writes the project's rules into AGENTS.md and CLAUDE.md, where agents load them without asking: the root's for the rules that hold everywhere, and one in each folder whose rules differ, such as a rename that holds in help/ and not in api/. kapi owns one marked section of each file and keeps it current as the context changes; your own text around it is kept. --no-rules-files skips them, and 'kapi context sync --files-only' writes them later.

Commandinit
Groupwork
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 init
Flags
FlagTypeDefaultDescription
--agentsstringCoding agents to wire this project for: a comma-separated list of claude-code, cursor, vscode, codex, agents; 'all'; or 'none' (default: claude-code plus every host already used here)
--dirstringDirectory to scaffold in (default: current directory)
--frameworkstringWrite a known stack's catalog layout as collections (see 'kapi init --list-presets')
--list-presetsboolfalseList available presets (framework scaffolds and per-format parsing presets) and exit
--mint-idboolfalseWrite a stable project id into a recipe that has none, and print the id
--namestringProject name (default: directory basename)
--no-rules-filesboolfalseDo not write the project's rules into AGENTS.md and CLAUDE.md
--presetstringWrite a named framework preset's catalog layout as collections; alias of --framework
--source-localestringenSource locale (BCP-47)
--target-localestringSliceTarget locale (repeatable)

← Back to the Command Reference