> ## 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.

# How to Install the Kode CLI on macOS, Linux, and Windows

> Install the Kode CLI via shell script, NPM, or build from source on macOS, Linux, and Windows. Includes first-run setup and upgrade instructions.

The Kode CLI is a single compiled Go binary — no runtime dependencies, no virtual environment, no package manager side effects. You install it once, and it works. Choose the method that matches your platform and workflow below.

## Install

<CodeGroup>
  ```bash macOS / Linux theme={null}
  curl -fsSL https://raw.githubusercontent.com/sicario-labs/kode/master/script/install.sh | bash
  ```

  ```powershell Windows (PowerShell) theme={null}
  irm https://raw.githubusercontent.com/sicario-labs/kode/master/script/install.ps1 | iex
  ```

  ```bash NPM theme={null}
  npm install -g @sicario-labs/kode
  ```
</CodeGroup>

**Shell script (macOS / Linux):** Downloads the appropriate pre-built binary for your OS and architecture from GitHub Releases, places it in `~/.kode/bin`, and updates your shell configuration file (`.zshrc`, `.bashrc`, etc.). Pass `--no-modify-path` to skip the PATH modification. Pass `--version 3.6.9` to pin to a specific release.

**PowerShell (Windows):** Downloads the Windows AMD64 binary from GitHub Releases and installs it to `%LOCALAPPDATA%\kode\kode.exe`, adding it to your user PATH. Override the install directory by setting `KODE_INSTALL_DIR` before running the script.

**NPM:** Installs the `@sicario-labs/kode` package globally. The package wraps the platform-appropriate binary and registers it as a global command. Node.js or Bun is required. This is the recommended path if you're already managing global tools with NPM.

## Verify Installation

After any of the above install methods complete, open a new terminal and run:

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

Kode prints its version, commit hash, and build date:

```
kode v3.6.9 (commit: abc1234, date: 2025-07-01)
```

If `kode` is not found, ensure the install directory is on your `PATH`. The shell installer displays the exact path it used during installation.

## First-Run TUI Download

Kode's interactive terminal UI (`kode tui`) is a separate \~52 MB compiled bundle distributed as `tui-bundle.tar.gz` on GitHub Releases. It is **not** included in the initial install to keep the base install fast. On the first `kode tui` invocation, Kode downloads the bundle automatically:

```
Downloading TUI bundle (~52 MB) from GitHub Releases...
```

The bundle is extracted to `~/.kode/tui/` and cached there. Subsequent `kode tui` invocations use the cached bundle and start immediately.

You can override the download behavior with two environment variables:

| Variable              | Purpose                                                                                             |
| --------------------- | --------------------------------------------------------------------------------------------------- |
| `KODE_TUI_DIR`        | Point to a local directory containing an already-extracted TUI bundle (for air-gapped environments) |
| `KODE_TUI_BUNDLE_URL` | Override the download URL (for self-hosted distributions or mirrors)                                |

## Upgrading

Upgrade Kode to the latest release by re-running the same install command you used originally. The script detects an existing installation and replaces the binary in place. Your `.kode/` project configuration files are not affected.

<CodeGroup>
  ```bash macOS / Linux theme={null}
  curl -fsSL https://raw.githubusercontent.com/sicario-labs/kode/master/script/install.sh | bash
  ```

  ```powershell Windows (PowerShell) theme={null}
  irm https://raw.githubusercontent.com/sicario-labs/kode/master/script/install.ps1 | iex
  ```

  ```bash NPM theme={null}
  npm update -g @sicario-labs/kode
  ```
</CodeGroup>

To upgrade to a specific version, pass `--version` to the shell script:

```bash theme={null}
curl -fsSL https://raw.githubusercontent.com/sicario-labs/kode/master/script/install.sh | bash -s -- --version 3.6.9
```

## Uninstalling

To remove Kode, delete the binary from the directory where it was installed:

* **macOS / Linux:** `rm ~/.kode/bin/kode`
* **Windows:** Delete `%LOCALAPPDATA%\kode\kode.exe`
* **NPM:** `npm uninstall -g @sicario-labs/kode`

You can also remove the TUI bundle cache at `~/.kode/tui/` to free up disk space. Project-level `.kode/` directories (created by `kode init`) are always left in place — they live inside your project and are yours to manage.

## System Requirements

| Requirement          | Details                                                                    |
| -------------------- | -------------------------------------------------------------------------- |
| **Operating system** | macOS (Intel and Apple Silicon), Linux (x86-64 and ARM64), Windows (AMD64) |
| **Go**               | 1.22 or later — only required if building from source                      |
| **Node.js or Bun**   | Required only for TUI features in development mode                         |
| **Git**              | Required for Ghost Branch mode (`kode loop --branches N`)                  |

No other dependencies are needed for the prebuilt binaries. The Go verification engine ships as a fully statically linked binary with no CGo.

## Build from Source

If you prefer to compile Kode yourself — for custom build flags, a specific commit, or an unsupported platform — clone the repository and use `make install`:

```bash theme={null}
git clone https://github.com/sicario-labs/kode
cd kode
make install
```

`make install` runs `go install` with the correct linker flags to embed the version, commit, and build date into the binary. The installed binary lands wherever `$GOPATH/bin` points, which is typically already on your `PATH`.

To build a binary without installing it:

```bash theme={null}
make build
# produces bin/kode (or bin/kode.exe on Windows)
```

The `Makefile` also supports cross-compilation for all release targets via `make release-checksum`, which produces platform binaries in `dist/`.

<Warning>
  Building from source requires Go 1.22 or later. Run `go version` to check. The module path is `github.com/kode/kode` — the CLI entry point is in `cmd/kode/`.
</Warning>
