Does Kimi Code Have a CLI? Yes, and It's the Primary Interface
Yes, Kimi Code ships as a full-featured command-line application called kimi that serves as the main entry point for all functionality, including interactive sessions, web UI, and IDE integration.
The MoonshotAI/kimi-code repository distributes its agentic coding assistant as a standalone CLI binary. Whether you install via the official shell script or npm install -g @moonshot-ai/kimi-code, the kimi executable provides complete access to the tool's capabilities through your terminal.
How the Kimi Code CLI Works
The CLI architecture follows a clean wrapper pattern: the thin kimi binary handles argument parsing and environment setup, then delegates to the core engine.
CLI Wrapper and Entry Point
The kimi executable parses command-line arguments and initializes the runtime. In packages/node-sdk/src/cli.ts, the entry point implements command dispatch and validation. Supported flags include --version, --web, --acp, --host, and others documented in docs/zh/reference/kimi-command.md.
The install script referenced in README.md places this binary on your PATH, making it available system-wide.
Core Engine Delegation
Once initialized, the CLI hands control to @moonshot-ai/agent-core-v2. The engine's behavior is governed by the CLI profile defined in packages/agent-core/src/profile/default/system.md, which scopes the agent lifecycle, tool plumbing, and skill catalog for terminal-based operation.
This separation means the same core engine runs regardless of how you invoke Kimi Code—CLI, programmatically, or through IDE integrations.
TUI Rendering
For interactive sessions, the CLI uses the pi-tui library to render a color-rich terminal UI. This handles:
- Real-time input and output streaming
- Slash-command completion
- User approval flows
Running kimi without arguments launches this interface in your current project directory.
Essential Kimi Code CLI Commands
Start an Interactive Session
cd my-project
kimi
This launches the TUI with the agent loaded for your project context.
Display Version Information
kimi --version
Example output: 0.12.3
Launch the Web UI
kimi web
Starts the bundled browser-based chat interface, typically exposed at http://localhost:5173.
Run in ACP Mode for IDE Integration
kimi acp
Runs Kimi Code in Agent Client Protocol mode, reading JSON-RPC on stdin and writing to stdout. This enables IDE plugins to communicate with the core engine.
Self-Update the CLI
kimi upgrade
Checks GitHub releases and installs the latest binary automatically.
Key Source Files for CLI Implementation
| Path | Role |
|---|---|
packages/node-sdk/src/cli.ts |
Implements the kimi entry point, command parsing, and dispatch logic |
packages/agent-core/src/profile/default/system.md |
Defines the "Kimi Code CLI" profile used by the engine |
docs/zh/reference/kimi-command.md |
Complete flag and sub-command reference |
README.md |
Installation instructions and basic usage examples |
Configuration and Programmatic Use
The CLI respects configuration files under $KIMI_CODE_HOME, making it suitable for scripting and CI pipelines. Because the binary is just a thin wrapper around the engine, you can invoke it programmatically with the same consistency as interactive use.
Summary
- Kimi Code is distributed as the
kimiCLI binary, installable via shell script or npm - The CLI in
packages/node-sdk/src/cli.tsparses arguments and delegates to@moonshot-ai/agent-core-v2 - Interactive sessions use the
pi-tuilibrary for terminal UI rendering - Sub-commands include
kimi web,kimi acp, andkimi upgrade - Full command reference lives in
docs/zh/reference/kimi-command.md
Frequently Asked Questions
How do I install the Kimi Code CLI?
Run the official install script from README.md or execute npm install -g @moonshot-ai/kimi-code. Both methods place the kimi binary on your system PATH.
Can I use Kimi Code without the TUI for automation?
Yes. The kimi acp sub-command runs in headless JSON-RPC mode suitable for scripts and CI pipelines, reading from stdin and writing to stdout without launching the interactive interface.
Where is the complete CLI documentation located?
The authoritative reference is docs/zh/reference/kimi-command.md in the repository, which documents all flags, environment variables, and sub-command behaviors.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →