How to Set Up Kimi‑Code Locally: Install Methods and Developer Workflow

You can install Kimi‑Code locally via a single‑binary install script (no Node.js required) or build it from source using pnpm and Node 24+.

Kimi‑Code is a TypeScript monorepo developed by MoonshotAI that bundles a terminal UI (TUI) agent, a backend server, and a plugin ecosystem into a cohesive AI coding assistant. This guide walks through both end‑user installation and contributor setup, referencing the exact source files and build system defined in the repository.

Prerequisites and System Requirements

Before installing, verify your environment matches the repository requirements enforced in [package.json](https://github.com/MoonshotAI/kimi-code/blob/main/package.json) and .nvmrc:

Component Minimum Version Notes
Node.js 24.15.0 Required only for source builds; the install script bundles its own runtime
pnpm 9.x+ Used as the workspace manager (see [pnpm-workspace.yaml](https://github.com/MoonshotAI/kimi-code/blob/main/pnpm-workspace.yaml))
Git Any Windows users need Git for Windows; set KIMI_SHELL_PATH if bash.exe is non‑standard

The fastest way to set up Kimi‑Code locally is the pre‑built binary distribution. This method downloads the correct artifact for your platform and requires no local Node.js installation.

macOS and Linux

curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash

Windows PowerShell

irm https://code.kimi.com/kimi-code/install.ps1 | iex

The script places the kimi binary on your PATH. Verify the installation:

kimi --version

Launch the interactive TUI:

cd your-project-directory
kimi

First‑Run Authentication

After launching the CLI, authenticate with Moonshot AI:

  1. Inside the TUI, type /login
  2. Choose OAuth for browser‑based sign‑in, or paste a Moonshot AI Open Platform API key

Authentication state is stored locally and reused across sessions.

Installation Method 2: Build From Source (Contributors and Custom Builds)

To modify Kimi‑Code or run bleeding‑edge features, clone the monorepo and bootstrap with pnpm.

Step 1: Clone and Install Dependencies

git clone https://github.com/MoonshotAI/kimi-code.git
cd kimi-code
pnpm install

The install command resolves all workspace packages across apps/, packages/, and plugins/.

Step 2: Run the CLI in Development Mode

pnpm dev:cli

This launches the kimi binary with hot‑reloading enabled. Changes to TypeScript source files trigger automatic recompilation.

Step 3: Run Tests and Type Checks

pnpm typecheck  # Full TypeScript type checking across the monorepo

pnpm test       # Execute the test suite

pnpm lint       # Run ESLint rules

pnpm build      # Production build for all packages

Monorepo Architecture Overview

Understanding the directory structure helps when debugging local setup issues or extending functionality.

Key Packages and Apps

Path Purpose
apps/kimi-code Main CLI binary; entry point for the kimi command
apps/kimi-inspect Web‑based debugging inspector for server sessions
packages/agent-core-v2 Agent engine with LifecycleScope hierarchy (App → Workspace → Session → Agent
packages/kap-server Backend server exposing REST/WebSocket APIs and debug RPC
packages/node-sdk Official Node.js SDK for programmatic access
packages/klient, packages/kosong Low‑level client utilities and shared primitives
plugins/official/ Curated plugins implementing skills, data sources, and web bridges
packages/pi-tui Internal TUI library powering the terminal interface

Build System Details

Windows‑Specific Configuration

The Kimi‑Code CLI shells out to Git Bash for external command execution. If Git for Windows is installed in a non‑standard location, export the path before running kimi:

$env:KIMI_SHELL_PATH = "C:\Custom\Path\Git\bin\bash.exe"
kimi

Permanent configuration via System Environment Variables is also supported.

Summary

  • End users should run the platform‑specific install script—no Node.js or build tools needed
  • Contributors need Node 24.15.0+ and pnpm 9+; clone, pnpm install, and pnpm dev:cli to start hacking
  • The monorepo splits concerns across apps/ (binaries), packages/ (libraries), and plugins/ (extensions)
  • Authentication happens inside the TUI via /login with OAuth or API key

Frequently Asked Questions

Where is the Kimi‑Code install script hosted?

The install scripts live at https://code.kimi.com/kimi-code/install.sh (macOS/Linux) and https://code.kimi.com/kimi-code/install.ps1 (Windows). These URLs are the official distribution points referenced in the README.md.

Can I run Kimi‑Code without installing Node.js?

Yes. The install script downloads a self‑contained binary that bundles the Node.js runtime. Node.js is only required when building from source or developing plugins.

How do I switch between production and development builds?

Production builds use the kimi command installed by the script. For development, run pnpm dev:cli from the repository root—the command bootstraps the CLI with hot‑reloading and links against local package sources.

What if the TUI fails to launch on Windows?

Ensure Git for Windows is installed and accessible. Set the KIMI_SHELL_PATH environment variable to the full path of bash.exe if the CLI cannot locate it automatically.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →