Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.trykode.xyz/llms.txt

Use this file to discover all available pages before exploring further.

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

kode init [directory]

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

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

# Init in a subdirectory
kode init ./services/api

Generated kode.json

The file written to .kode/kode.json contains every supported field. Edit it freely after running init.
{
  "$schema": "https://trykode.xyz/config.json",
  "version": "3.0.0",
  "model": "anthropic/claude-sonnet-4-6",
  "small_model": "anthropic/claude-haiku-4-5",
  "instructions": ["AGENTS.md"],
  "permission": {
    "edit": "ask",
    "bash": "ask"
  },
  "engine": {
    "tdd_mode": true,
    "test_command": "go test ./...",
    "max_blast_radius": 3,
    "token_budget_usd": 1.50,
    "blindfold_mode": false
  },
  "providers": {
    "primary": "kode",
    "gateway_url": "https://api.trykode.xyz"
  }
}

Engine fields

engine.tdd_mode
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.
engine.test_command
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.
engine.max_blast_radius
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.
engine.token_budget_usd
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.
engine.blindfold_mode
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

── Kode Init ────────────────────────────────────

  ✓  Created directory /home/you/project/.kode
  ·  Auto-detected test command: go test ./...
  ✓  Written /home/you/project/.kode/kode.json

── Engine Features ──────────────────────────────

  TDD Mode:        ON  (writes blocked unless test file present)
  Test Command:    go test ./...
  Blast Radius:    3 files max per verify round
  Token Budget:    $1.50 per loop cycle
  Blindfold:       OFF (identifier obfuscation before LLM send)

── Security Engine ──────────────────────────────

  ✓  Sicario installed at /home/you/project/.kode/sicario
  ·  Security gate active — high/critical findings block patches

  edit .kode/kode.json to customize
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.