> ## 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 tui — Launch the Terminal User Interface

> kode tui launches Kode's Terminal UI, downloading the binary from GitHub Releases on first run. Supports --port, --hostname, and --mdns flags.

`kode tui` launches Kode's interactive Terminal User Interface — a full-featured front end for browsing your codebase, running tasks, reviewing Ghost Branch results, and inspecting verification output. On first run, Kode downloads the TUI binary from GitHub Releases and caches it in `~/.kode/tui/`. Subsequent runs start instantly from the cached binary. You can also launch the TUI simply by running `kode` with no arguments.

## Synopsis

```bash theme={null}
kode tui
```

## What it does

1. **Checks the cache** — looks for a versioned TUI binary in `~/.kode/tui/bin/`
2. **Downloads if missing** — fetches the platform-specific binary from GitHub Releases and writes it to `~/.kode/tui/bin/kode-tui` (or `kode-tui.exe` on Windows)
3. **Launches the TUI** — starts the binary, passing through port, hostname, and mDNS flags; the TUI binary connects back to `kode` via the `KODE_BIN` environment variable
4. **Logs TUI output** — redirects the TUI's stderr to `~/.kode/tui/kode-tui.log` so diagnostic lines do not interfere with the terminal screen buffer

## Flags

| Flag         | Type   | Default       | Description                                          |
| ------------ | ------ | ------------- | ---------------------------------------------------- |
| `--port`     | int    | auto-assigned | HTTP server port for the TUI                         |
| `--hostname` | string | unset         | HTTP server hostname                                 |
| `--mdns`     | bool   | `false`       | Advertise the TUI over mDNS for local network access |

## Examples

<CodeGroup>
  ```bash Default launch theme={null}
  kode tui
  ```

  ```bash Fixed port theme={null}
  kode tui --port 4096
  ```

  ```bash Accessible on the local network via mDNS theme={null}
  kode tui --hostname 0.0.0.0 --mdns
  ```

  ```bash Same as kode tui (no arguments) theme={null}
  kode
  ```
</CodeGroup>

## First-run behavior

On first run (or when the cached binary does not match the current Kode version), `kode tui` downloads the platform binary from GitHub Releases:

```
Downloading Kode TUI binary from GitHub...
```

The binary is saved to `~/.kode/tui/bin/kode-tui` and a version marker is written to `~/.kode/tui/.kode-tui-version`. Future runs skip the download and start immediately.

The download URL is constructed as:

```
https://github.com/sicario-labs/kode/releases/download/v<version>/kode-tui-<os>-<arch>
```

Where `<os>` is `linux`, `darwin`, or `windows`, and `<arch>` is `x64` or `arm64`.

## Environment overrides

| Variable              | Description                                                                                       |
| --------------------- | ------------------------------------------------------------------------------------------------- |
| `KODE_TUI_DIR`        | Override the directory where the TUI binary is cached (default: `~/.kode/tui`)                    |
| `KODE_TUI_BUNDLE_URL` | Override the full download URL for the TUI binary (useful for air-gapped environments or mirrors) |

## TUI log file

TUI stderr output is written to `~/.kode/tui/kode-tui.log`. If the TUI behaves unexpectedly or crashes, inspect this file for diagnostic output:

```bash theme={null}
tail -f ~/.kode/tui/kode-tui.log
```

<Tip>
  If the TUI download fails due to a network restriction or proxy, set `KODE_TUI_BUNDLE_URL` to an alternative mirror URL or a local file path and re-run `kode tui`.
</Tip>

<Note>
  Running `kode` with no arguments is equivalent to `kode tui`. Both commands go through the same binary resolution and download path.
</Note>

## Related

* [`kode loop`](/cli/loop) — run tasks from the command line without the TUI
* [`kode mcp serve`](/cli/mcp) — expose Kode as an MCP server for Claude Desktop
