# Does Kimi Code Have a CLI? Yes, and It's the Primary Interface

> Discover if Kimi Code has a CLI. Learn how the kimi CLI is the primary interface for interactive sessions, web UI, and IDE integration, unlocking full functionality.

- Repository: [Moonshot AI/kimi-code](https://github.com/MoonshotAI/kimi-code)
- Tags: how-to-guide
- Published: 2026-08-15

---

**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`](https://github.com/MoonshotAI/kimi-code/blob/main/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`](https://github.com/MoonshotAI/kimi-code/blob/main/docs/zh/reference/kimi-command.md).

The install script referenced in [`README.md`](https://github.com/MoonshotAI/kimi-code/blob/main/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`](https://github.com/MoonshotAI/kimi-code/blob/main/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

```bash
cd my-project
kimi

```

This launches the TUI with the agent loaded for your project context.

### Display Version Information

```bash
kimi --version

```

Example output: `0.12.3`

### Launch the Web UI

```bash
kimi web

```

Starts the bundled browser-based chat interface, typically exposed at `http://localhost:5173`.

### Run in ACP Mode for IDE Integration

```bash
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

```bash
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`](https://github.com/MoonshotAI/kimi-code/blob/main/packages/node-sdk/src/cli.ts) | Implements the `kimi` entry point, command parsing, and dispatch logic |
| [`packages/agent-core/src/profile/default/system.md`](https://github.com/MoonshotAI/kimi-code/blob/main/packages/agent-core/src/profile/default/system.md) | Defines the "Kimi Code CLI" profile used by the engine |
| [`docs/zh/reference/kimi-command.md`](https://github.com/MoonshotAI/kimi-code/blob/main/docs/zh/reference/kimi-command.md) | Complete flag and sub-command reference |
| [`README.md`](https://github.com/MoonshotAI/kimi-code/blob/main/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 **`kimi`** CLI binary, installable via shell script or npm
- The CLI in [`packages/node-sdk/src/cli.ts`](https://github.com/MoonshotAI/kimi-code/blob/main/packages/node-sdk/src/cli.ts) parses arguments and delegates to `@moonshot-ai/agent-core-v2`
- Interactive sessions use the `pi-tui` library for terminal UI rendering
- Sub-commands include `kimi web`, `kimi acp`, and `kimi upgrade`
- Full command reference lives in [`docs/zh/reference/kimi-command.md`](https://github.com/MoonshotAI/kimi-code/blob/main/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`](https://github.com/MoonshotAI/kimi-code/blob/main/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`](https://github.com/MoonshotAI/kimi-code/blob/main/docs/zh/reference/kimi-command.md) in the repository, which documents all flags, environment variables, and sub-command behaviors.