How to Run Kimi Code on Windows: Installer, Git Bash, and the Rough Edges
Quick answer: yes, with two prerequisites
Quick answer: install Git for Windows first, then run the official installer in PowerShell: irm https://code.kimi.com/kimi-code/install.ps1 | iex. Open a new terminal, run kimi inside a project folder, and log in with /login.
# 1. Install Git for Windows first (required, Kimi Code uses Git Bash as its shell)
winget install Git.Git
# 2. Install Kimi Code with the official PowerShell installer
irm https://code.kimi.com/kimi-code/install.ps1 | iex
# 3. Open a NEW terminal, then verify
kimi --versionThat is the short path. The order matters: Git for Windows has to be there before Kimi Code's first launch, not after. The sections below explain why, cover the npm alternative, and go through the rendering issue that is currently the biggest Windows-specific caveat.
If Kimi Code itself is new to you, start with how to use Kimi Code, which also covers the trap of the two Moonshot CLIs that both install a kimi binary.
What you need before installing
- Windows 10 or Windows 11, 64-bit, and a terminal (Windows Terminal or PowerShell).
- Git for Windows. This is not optional. Kimi Code uses the bundled Git Bash as its shell environment, so it must be installed before the first launch. Install it from git-scm.com or with
winget install Git.Git. - Node.js 22.19.0 or later, but only if you choose the npm install route instead of the PowerShell installer. The official installer needs no Node at all.
- A Kimi account (for subscription plans) or a Moonshot platform API key (for pay-per-token).
If Git Bash lives in a non-standard location, set the KIMI_SHELL_PATH environment variable to the absolute path of your bash.exe so Kimi Code can find its shell.
Native install step by step
With Git for Windows in place, the official installer is the recommended route because it needs no runtime:
- Open PowerShell (no administrator rights needed).
- Run
irm https://code.kimi.com/kimi-code/install.ps1 | iex. It downloads the latest release, verifies the checksum, and puts thekimiexecutable on your PATH. - Close and reopen the terminal so the PATH change is picked up.
- Run
kimi --version. You should see a 0.x version, which confirms you have the current TypeScript CLI and not the legacy Python kimi-cli. - Move into a project folder, run
kimi, and log in with/login(browser sign-in for subscriptions, API key for pay-per-token).
Prefer npm? That works on Windows too, as long as you have Node.js 22.19 or later:
# Check Node first
node --version
# Install globally
npm install -g @moonshot-ai/kimi-code
# Verify
kimi --versionTo update later, run kimi upgrade, or npm install -g @moonshot-ai/kimi-code@latest if you installed through npm.
The rendering bug you should know about
Here is the part most write-ups skip. As of the 0.26.x releases, the Kimi Code repository has an open issue (#1792) where the TUI dumps raw ANSI escape sequences instead of rendering them, in Windows Terminal, PowerShell and cmd. When it hits, the screen fills with sequences like [38;2;255m instead of a usable interface.
It does not bite every machine, and with a release cadence of roughly one version a day it may be fixed by the time you read this. But if you launch kimi on Windows and the output looks like garbage rather than a UI, you are not doing anything wrong: it is a known upstream problem. Check the issue tracker for the current state before you spend time on your own config.
If the TUI renders broken for you in native Windows terminals, you have two practical outs today: run Kimi Code inside WSL, or run the model rather than the CLI by pointing Claude Code at Kimi K3, as covered in Kimi K3 with Claude Code.
The WSL route: the reliable fallback
WSL 2 gives you a real Linux environment inside Windows, and inside it Kimi Code behaves like it does on Linux: the bash dependency is native, and the rendering path is the one most of its users exercise daily. If your project already leans on Linux tooling, or the native TUI misbehaves on your machine, this is the calm route.
# Inside your WSL (Linux) terminal
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash
# Then, from your project folder
kimiTwo practical notes: keep your project files inside the Linux filesystem for performance, and when the OAuth login shows you a link, finish it in your Windows browser and come back to the terminal. Everything else works the same as the native setup.
Common Windows errors and fixes
- "kimi is not recognized as a command": you did not reopen the terminal after installing, or the installer's PATH change did not stick. Open a fresh PowerShell window; if it persists, check that the Kimi Code bin folder is on your PATH.
- Kimi Code complains about the shell or fails to run commands: Git for Windows is missing or Git Bash is somewhere unusual. Install Git for Windows, or point
KIMI_SHELL_PATHat yourbash.exe. - Screen full of raw escape codes: that is issue #1792 described above, not your config. Use WSL or check the issue tracker for a fixed release.
kimi --versionprints 1.4x: you have the legacy Python kimi-cli, not Kimi Code. Install with the official script or npm package@moonshot-ai/kimi-code; the installer renames legacy shims tokimi-legacyfor you.- npm install fails on Node version: Kimi Code needs Node 22.19.0 or later. Update Node, or skip npm entirely and use the PowerShell installer, which bundles everything.
Running multiple Kimi Code sessions on Windows
Once Kimi Code works, the next ceiling is one terminal, one task. Every kimi session is an independent process, so nothing stops you from opening several terminals and running one session in each. What gets hard is keeping track: which agent finished, which one is waiting on an approval, and what each one changed.
CodeAgentSwarm is a native desktop app for Windows and macOS built for that supervision problem. Kimi Code is a supported agent in it, next to Claude Code, Codex CLI, Antigravity CLI and opencode, and you choose the agent per terminal. You get desktop notifications when a session finishes or needs input, searchable history across every agent, live per-terminal diffs, and a quota indicator that reads Kimi's weekly and 5-hour windows.
For the full parallel workflow, continue with running multiple Kimi Code sessions and the Kimi Code agent swarm guide.
FAQ
Yes. Moonshot ships an official PowerShell installer (irm https://code.kimi.com/kimi-code/install.ps1 | iex), and there is an npm package for machines with Node 22.19 or later. The one hard requirement is Git for Windows, which must be installed before first launch because Kimi Code uses Git Bash as its shell environment.
Kimi Code runs its shell commands through Git Bash rather than PowerShell or cmd, so it needs the bash that ships with Git for Windows. If your Git Bash is installed somewhere unusual, set the KIMI_SHELL_PATH environment variable to the absolute path of bash.exe.
Current 0.26.x builds have a known open issue (#1792) where the TUI prints raw ANSI escape sequences in Windows Terminal, PowerShell and cmd on some machines. It is an upstream bug, not your configuration. Kimi Code releases almost daily, so check the GitHub issue tracker; until it is fixed on your setup, WSL is the reliable route.
Use WSL 2 if your project depends on Linux tooling, or if the native Windows TUI renders incorrectly on your machine. Inside WSL, Kimi Code installs with the same one-line script as Linux and behaves like it does for the bulk of its users. For Windows-native projects where the TUI renders fine, the native install is simpler.
Yes. Each kimi session is its own process, so you can run one per terminal. CodeAgentSwarm, a native Windows desktop app, manages that for you: Kimi Code is a supported agent, and you get notifications, searchable history, live diffs and a Kimi quota indicator across all your parallel sessions.
CodeAgentSwarm is a native Windows desktop app that runs your AI coding agents in parallel terminals, and Kimi Code is a supported agent. Notifications, searchable history and live diffs, all in one workspace.
Try CodeAgentSwarm