
Kimi Code CLI
github.com/moonshotai/kimi-code- Category
- AI Agents
- Rank
- No. 795Tools index
- Listed in
- #17 Code with an agent
- Pricing
- Freemium
- Type
- AGENT
- Use case
- Coding
- Interfaces
- CLI
- Builder
- moonshotai
- GitHub
- 7.7k stars
- Latest release
- @moonshot-ai/kimi-code@2.1.1
- Date
About
An AI coding agent that runs in the terminal, reading and editing code, executing shell commands, searching files, and fetching web pages while deciding its own next steps. It supports video input, MCP server configuration, subagents (coder, explore, plan), lifecycle hooks, and integrates with editors like Zed and JetBrains via the Agent Client Protocol, backed by Moonshot AI's Kimi models.
What it does
Kimi Code CLI is a terminal coding agent built as a monorepo of separate packages: a core agent runtime, an editor-protocol server, an authentication package, and a cross-platform shell layer. The agent installs as a standalone binary with no separate runtime to set up, then loops between calling tools and reading their output until a task is done. It ships built on Moonshot's own models but can be pointed at other providers, and the same core process can run headless, interactively, or plugged into an editor through a standard protocol so the editor becomes the interface instead of the terminal window.
Why it's ranked here
It stands out in the terminal-agent category on architecture rather than feature count alone. The core runs on a real dependency-injection framework with its own service lifecycle, not a pile of global functions, and the editor integration is a full implementation of a standard agent protocol, covering session forking, resuming, and permission bridging rather than a thin wrapper. Both point to a team building for more surface than a single command-line tool, which is why the same runtime works as a terminal app and an editor backend. The permissive license removes the usual proprietary-agent adoption friction.
What's good
The install path is genuinely light: a shell script drops a working binary with no separate runtime, PATH conflicts, or global package collisions to manage. The editor integration goes deeper than a status-bar plugin: sessions can be listed, resumed, closed, deleted, and forked mid-conversation, with approval prompts and plan review routed back through the editor. Lifecycle hooks let a team gate or audit any tool call before it runs, which matters once an agent can execute shell commands on its own. Outbound requests route through a single proxy setting, so it works behind a corporate firewall without code changes.
Tradeoffs
Windows setup carries an extra step: the agent shells out through Git Bash rather than a native shell, so first-time Windows users need a separate Git install before anything runs. The provider story defaults hard to the maker's own models; pointing it at another compatible provider means configuring that yourself rather than picking from a first-class list. The core package's internal surface is large and deeply layered, built on its own dependency-injection and service-lifecycle machinery, which is a lot of architecture for a newcomer to read before contributing a change instead of just calling a function.
How to use it well
It fits best as a daily driver for people who want to stay inside an editor: point a supported IDE at it through the editor protocol and get the same session, approvals, and plan review there instead of a separate terminal pane. Teams that want a record of what the agent touches should wire lifecycle hooks to their own audit or notification system before allowing unattended runs. On a large, unfamiliar codebase, dispatching the exploration and planning subagents first keeps the main conversation focused while the agent maps the territory before it starts editing. It is not the choice for someone who wants equal, first-class support across many model providers.
Technical notes+
The entry point in apps/kimi-code/src/main.ts separates command parsing from process lifecycle: handleMainCommand is documented as unit-tested and never calls process.exit itself, leaving bootstrap() as the only place that owns the exit code, and it sets process.exitCode synchronously before an async log flush specifically to stop a headless run from draining the event loop and exiting 0 on failure. Cross-platform shell handling lives in packages/kaos/src/index.ts, which exports createShellPathBridge and translateShellDrivePath alongside a LocalKaos implementation. The ACP surface in packages/acp-server/src/server.ts implements AcpServer with session lifecycle methods (newSession, unstable_forkSession, loadSession) built on a Klient facade, and forwards MCP servers per session through acpMcpServersToConfigRecord. packages/agent-core-v2/src/index.ts is the largest export surface read, organized around a custom dependency-injection container (di/graph, di/instantiationService, di/fiber) and per-domain services such as sessionManager and workspaceInstance. packages/oauth/src/index.ts implements a device-code OAuth flow (pollDeviceToken, requestDeviceAuthorization) alongside a separate managed-config path for the vendor's own hosted login, keeping bring-your-own-provider credential handling on a distinct path from the managed one.
Observed
- License
- MIT licensed
- Packaging
- Distributed as a single native binary installed via a shell script, with an alternate npm install path
- Interfaces
- Interfaces: interactive terminal UI, headless prompt mode, an Agent Client Protocol server for editor integration, and MCP client support
- Platform requirement
- Requires Git Bash as the shell backend on Windows
- Packaging
- Organized as a monorepo of separate packages: CLI app, agent core runtime, ACP server, OAuth/auth, and a cross-platform shell abstraction layer
- Lifecycle hooks
- Ships lifecycle hooks that run local commands at defined points around tool calls
- Input support
- Supports video file input in addition to text prompts
- Networking
- Outbound requests are routed through a configurable HTTP/HTTPS proxy dispatcher
Read from README.md, package.json, apps/kimi-code/src/main.ts, packages/agent-core-v2/src/index.ts, packages/kaos/src/index.ts, packages/acp-server/src/index.ts, packages/acp-server/src/server.ts, packages/oauth/src/index.ts, docs/en/index.md.
What it can do
Read and edit code files
Source code files → Modified code
Execute shell commands
Shell command → Command output
Search files in a project
Search query → Matching files or file contents
Fetch web pages
URL → Web page content
Run specialized subagents (coder, explore, plan)
Task description → Subagent results
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.