Skip to main content
kode init gets your project ready for Kode in a single step. It creates a .kode/ directory, writes a kode.json configuration file with sensible production-ready defaults, auto-detects your test command from the project root, and downloads the Sicario SAST binary that powers the security gate. Running init takes under ten seconds and requires no arguments.

Synopsis

What it does

  1. Creates .kode/ in your project root (or the directory you specify).
  2. Writes .kode/kode.json with all engine, provider, and permission fields populated. If a kode.json already exists, the command exits without overwriting it.
  3. Auto-detects your test command by scanning the directory for well-known project files:
    • go.modgo test ./...
    • package.jsonnpm test
    • Cargo.tomlcargo test
    • pyproject.toml / requirements.txtpytest
    • Gemfilebundle exec rspec
  4. Downloads Sicario — Kode’s embedded SAST binary — into .kode/. The security gate uses Sicario to block patches that introduce high or critical findings. If the download fails (e.g. no network), you can install it later with kode install sicario.

Arguments

string
Optional target directory. Defaults to the current working directory. Kode resolves the path to an absolute location before creating .kode/ inside it.

Generated kode.json

The file written to .kode/kode.json contains every supported field. Edit it freely after running init.

Engine fields

boolean
default:"true"
When true, Kode refuses to write to production source files if no corresponding test file exists in the codebase. Disable only if your project has no tests yet.
string
The shell command used to run your test suite. Kode appends this as the final step of the kode loop pipeline and rolls back if it exits non-zero.
integer
default:"3"
Maximum number of files a single verify round is allowed to touch. Patches that exceed this limit are rejected before any gate runs.
float
default:"1.50"
Cost ceiling per kode loop cycle in USD. Kode estimates token costs using current model pricing and aborts generation once the budget is reached.
boolean
default:"false"
When true, Kode obfuscates variable and function identifiers in the code sent to the LLM. Useful for proprietary codebases where exposing symbol names is undesirable.

Example output

Running kode init in a directory that already has .kode/kode.json will not overwrite it. The command prints an error and exits cleanly. Delete the existing file or specify a different directory if you want to regenerate it.
For the complete list of every supported kode.json field, see the kode.json configuration reference.