Kimi Code

Install and configure Kimi Code CLI and its local Web interface.

Prerequisites

Windows needs WinGet (bundled with Windows 11); macOS / Linux need no extra setup.

1. Install

Install Kimi Code CLI with WinGet on Windows:

winget install --id MoonshotAI.KimiCodeCLI -e

On macOS or Linux, run the appropriate installer from the official Kimi Code installation page.

2. Configure

Kimi Code CLI and Kimi Web share the same config.toml:

config.toml
default_model = "getrun-model"

[providers.getrun]
type = "openai"
base_url = "https://api.get-apikey.com/v1"
api_key = "sk-xxxxx-xxx"

[models.getrun-model]
provider = "getrun"
model = "YOUR_MODEL"
max_context_size = 128000

Replace sk-xxxxx-xxx and YOUR_MODEL with actual values. getrun-model is the alias selected inside Kimi Code.

Windows

$kimiHome = if ($env:KIMI_CODE_HOME) { $env:KIMI_CODE_HOME } else { Join-Path $HOME ".kimi-code" }
New-Item -ItemType Directory -Force -Path $kimiHome | Out-Null
notepad (Join-Path $kimiHome "config.toml")
Kimi Code configuration validation in Windows PowerShell with getrun as the Provider, api.get-apikey.com/v1 as the Base URL, and a masked API Key.

macOS / Linux

KIMI_DIR="${KIMI_CODE_HOME:-$HOME/.kimi-code}"
mkdir -p "$KIMI_DIR"
${EDITOR:-vi} "$KIMI_DIR/config.toml"
chmod 600 "$KIMI_DIR/config.toml"

3. Use the CLI

Start the interactive interface from your project directory:

kimi -m getrun-model

On the first run, use the current project directory as the workspace. Later, running kimi without -m uses default_model.

You can also send one message and exit:

kimi -m getrun-model -p "Reply only with OK"

The CLI has loaded the configuration and connected to the model when it replies OK.

4. Use the Web interface

Run the following command from the directory you want to use as the workspace:

kimi web

Kimi Code starts a local service and opens it in the browser. On the first visit, select English, the appearance, and the accent color, then click Get started.

  1. Select the current workspace in the sidebar, or click Add workspace and choose the project directory.
  2. Click New Chat.
  3. Confirm that the configured YOUR_MODEL appears at the lower right of the message box.
  4. Send “Reply only with OK”. The Web interface is ready when the reply is OK.

Windows

An English Kimi Web session on Windows with an OK reply; the workspace name in the upper-left corner is blurred.

On this page