> ## 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 CLI Reference — Commands, Flags, and Concepts

> Complete reference for all Kode CLI commands. Kode uses a hybrid Go+TypeScript architecture — all commands are accessible from the kode binary.

Kode ships a single `kode` binary that gives you access to every feature of the platform. The binary is written in Go and acts as the primary entry point for the verification engine, code generation, and context planning commands. For everything else — providers, models, sessions, agents, the TUI, and more — the binary automatically proxies the call to the TypeScript CLI bundled alongside it. You never need to invoke two separate tools; `kode <anything>` just works.

## How the CLI works

When you run `kode <command>`, the Go binary first checks whether the command is one it owns natively (such as `init`, `generate`, `verify`, `loop`, `plan`, or `stats`). If the command is not recognized by the Go layer, the binary transparently forwards the full argument list to the TypeScript CLI. This means every command in both layers appears under the single `kode` namespace.

```bash theme={null}
# Handled by the Go binary
kode init
kode generate "add pagination"
kode verify --input patches.json

# Automatically proxied to the TypeScript CLI
kode providers
kode models
kode session list
```

## Global flags

<ParamField path="version" type="subcommand">
  Print the current version, git commit hash, and build date.

  ```bash theme={null}
  kode version
  # kode 1.2.3 (commit: abc1234, date: 2025-01-15)
  ```
</ParamField>

## Command index

| Command          | Description                                                   |
| ---------------- | ------------------------------------------------------------- |
| `kode init`      | Scaffold `.kode/kode.json` config in your project             |
| `kode run`       | Generate, verify, and apply code in one step                  |
| `kode generate`  | Generate code patches as JSON output                          |
| `kode loop`      | Full pipeline: generate → verify → apply → test with rollback |
| `kode verify`    | Run 9-gate verification on a JSON input file                  |
| `kode voice`     | Hands-free pair programming via Whisper STT                   |
| `kode plan`      | Build a context graph from your codebase                      |
| `kode golf`      | Competitive optimization across parallel worktrees            |
| `kode daemon`    | Background tech debt watcher                                  |
| `kode stats`     | View verification statistics from the audit log               |
| `kode explain`   | Get details on a gate failure                                 |
| `kode mcp`       | Start the Kode MCP stdio server                               |
| `kode tui`       | Launch the terminal UI                                        |
| `kode providers` | Manage AI provider credentials                                |
| `kode models`    | List available AI models                                      |
| `kode session`   | List and manage sessions                                      |
| `kode agent`     | Manage agents                                                 |
| `kode install`   | Install security tools (sicario)                              |
| `kode upgrade`   | Upgrade Kode to the latest version                            |

## Key command pages

<CardGroup cols={2}>
  <Card title="kode init" icon="folder-plus" href="/cli/init">
    Scaffold your project configuration with TDD mode, blast radius limits, and auto-detected test commands.
  </Card>

  <Card title="kode run" icon="play" href="/cli/run">
    Generate and apply verified code patches from a plain-English prompt in one command.
  </Card>

  <Card title="kode loop" icon="arrows-rotate" href="/cli/loop">
    Run the full generate → verify → apply → test pipeline with automatic rollback on failure.
  </Card>

  <Card title="kode plan" icon="sitemap" href="/cli/plan">
    Build a surgical, token-capped context graph using Tree-sitter AST analysis before generating.
  </Card>

  <Card title="kode generate" icon="code" href="/cli/generate">
    Generate structured JSON hunks from a prompt, with optional inline verification and apply.
  </Card>

  <Card title="kode verify" icon="shield-check" href="/cli/verify">
    Run the 9-gate verification pipeline against a JSON file of hunks or proposed file contents.
  </Card>
</CardGroup>
