⚠️ This is a custom fork of Moonshot AI Kimi Code CLI.
This build adds cost-optimized subagent model routing and per-profile thinking-level configuration. Auto-update and upstream feedback are disabled. See the Custom Features section below for details.
Documentation · Issues · 中文
Kimi Code CLI is an AI coding agent that runs in your terminal — it can read and edit code, run shell commands, search files, fetch web pages, and choose the next step based on the feedback it receives. It works out of the box with Moonshot AI's Kimi models and can also be configured to use other compatible providers.
This fork adds the following capabilities on top of the upstream Kimi Code CLI:
- Subagent model routing. Built-in subagents (
coder,explore,plan) can be configured to use different models than the main agent. For example, the main agent can use a powerful model (e.g. Kimi K2.5) while subagents use cost-optimized models (e.g. DeepSeek V4 Flash), reducing API costs without sacrificing quality on the main reasoning path. - Per-profile thinking-effort configuration. Each subagent profile can declare its own
thinkingEffort(e.g.off/low/medium/high/max), independent of the main agent's setting. Useful for tuning reasoning depth per task type. - Runtime model override.
spawnoptions accept amodelAliasparameter to override the profile-declared model on a per-invocation basis. - Config-level agent defaults. The
config.toml[agent_defaults]section lets you assign a default model alias to any agent by name, without creating a separate profile file. - Disabled auto-update. The built-in
kimi updatecommand is disabled to prevent overwriting this custom build with upstream binaries. Rungit pullandpnpm buildto update from source instead. - Disabled upstream feedback. The feedback command is routed to a no-op URL to avoid sending custom-build issues to the upstream repository.
The built-in subagents (coder, explore, plan) can be assigned different models via the config.toml [agent_defaults] section. The bundled profile does not hard-code any provider-specific model names — you configure them in your own config.
Recommended default for cost-optimized routing:
| Subagent | Suggested model | Thinking level | Rationale |
|---|---|---|---|
coder |
deepseek-v4-flash |
max |
High-throughput code editing; reasoning compensates for cheaper model |
explore |
deepseek-v4-flash |
max |
Fast read-only exploration; max reasoning for accurate analysis |
plan |
deepseek-v4-pro |
max |
Stronger model for architecture planning; pro over flash for design quality |
Add this to your config.toml:
[agent_defaults]
coder = "deepseek-v4-flash"
explore = "deepseek-v4-flash"
plan = "deepseek-v4-pro"
[models.deepseek-v4-flash]
provider = "deepseek"
model = "deepseek-v4-flash"
max_context_size = 64000
[models.deepseek-v4-pro]
provider = "deepseek"
model = "deepseek-v4-pro"
max_context_size = 64000
[providers.deepseek]
type = "openai"
api_key = "YOUR_API_KEY"Alternatively, you can create custom agent profile YAML files with modelAlias and thinkingEffort fields — the profile loader supports both extends inheritance and per-subagent overrides.
This fork must be built from source. There is no CDN-hosted binary. You need Node.js ≥ 24.15.0 and pnpm 10.33.0.
git clone <your-fork-url>
cd kimi-code
pnpm install
pnpm buildThen add the built CLI to your PATH. On Windows, add apps\kimi-code\dist to your user PATH. On macOS/Linux, create a symlink:
ln -s $(pwd)/apps/kimi-code/dist/kimi ~/bin/kimiOpen a project and start the interactive UI:
cd your-project
kimiOn first launch, run /login inside Kimi Code CLI and choose either Kimi Code OAuth or a Moonshot AI Open Platform API key. After login, try your first task:
Take a look at this project and explain its main directories.
- Single-binary distribution. Install with one command: no Node.js setup, PATH gymnastics, or global module conflicts.
- Blazing-fast startup. The TUI is ready in milliseconds, so starting a session never feels heavy.
- Purpose-built TUI. A carefully tuned interface, optimized end to end for long, focused agent sessions.
- Video input. Drop a screen recording or demo clip into the chat and let the agent watch what is hard to describe in words — turn a reference clip into a LUT, a long video into a short, a screen recording into working code, and more.
- AI-native MCP configuration. Add, edit, and authenticate Model Context Protocol servers conversationally with
/mcp-config, without hand-editing JSON. - Rich plugin ecosystem. Install skills, MCP servers, and data sources from the marketplace or any GitHub repo, with each install's trust level surfaced up front.
- Subagents for focused, parallel work. Dispatch built-in
coder,explore, andplansubagents in isolated contexts while keeping the main conversation clean. - Lifecycle hooks. Run local commands at key points to gate risky tool calls, audit decisions, trigger desktop notifications, or connect to your own automation.
- Editor & IDE integration (ACP). Drive a Kimi Code CLI session straight from Zed, JetBrains, or any Agent Client Protocol client with
kimi acp.
Kimi Code CLI speaks the Agent Client Protocol, so ACP-compatible editors and IDEs (Zed, JetBrains, …) can drive a session over stdio. Log in once, then point your editor at the kimi acp subcommand — no extra login needed.
For Zed, add this to ~/.config/zed/settings.json:
{
"agent_servers": {
"Kimi Code CLI": {
"type": "custom",
"command": "kimi",
"args": ["acp"],
"env": {}
}
}
}Then open a new conversation in Zed's Agent panel. See Using in IDEs for JetBrains setup and troubleshooting, and the kimi acp reference for the full capability matrix.
- Getting Started
- Interaction and approvals
- Sessions
- Using in IDEs (ACP)
- Configuration
- Command reference
Requirements: Node.js ≥ 24.15.0, pnpm 10.33.0.
git clone https://github.com/MoonshotAI/kimi-code.git
cd kimi-code
pnpm installpnpm dev:cli # run the CLI in dev mode
pnpm test # run tests
pnpm typecheck # TypeScript check
pnpm lint # oxlint
pnpm build # build all packagesSee CONTRIBUTING.md for the full contribution guide.
- Issues
- For security vulnerabilities, see SECURITY.md.
Our TUI is built on top of pi-tui. We thank the authors of pi-tui for their valuable work.
Released under the MIT License.
