# Kimi CLI is now Kimi Code CLI: the 2026 guide

> Moonshot archived the Python Kimi CLI and replaced it with Kimi Code CLI. Install, login, models, hooks, subagents and sessions, checked against the docs.

- **Category:** Workflows
- **Updated:** 2026-09-22
- **Reading time:** 9 min
- **Canonical page:** https://cmdbrief.com/guides/kimi-cli

## The Python Kimi CLI is archived — the product is Kimi Code CLI

Search for `kimi cli` and the first result is still `MoonshotAI/kimi-cli`, the Python tool Moonshot shipped through 2025 and most of 2026. Its README now opens with a shutdown notice: “This project has been archived and is no longer maintained. Kimi CLI (Python) has been replaced by Kimi Code CLI.” The same notice continues: “This repository is read-only. There will be no further releases, bug fixes, or security updates. Existing installations are no longer supported and will stop working.”

The replacement lives at [MoonshotAI/kimi-code](https://github.com/MoonshotAI/kimi-code), is MIT licensed, and describes itself as “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.” The command you type is still `kimi`, which is why the rename is so easy to miss: your muscle memory keeps working while the thing underneath it changes completely.

|  | Kimi CLI (legacy) | Kimi Code CLI (current) |
| --- | --- | --- |
| Repository | `MoonshotAI/kimi-cli` | `MoonshotAI/kimi-code` |
| Language and licence | Python, Apache-2.0 | Single binary, MIT |
| Package | `kimi-cli` (uv / Homebrew) | `@moonshot-ai/kimi-code` on npm, or the install script |
| Data directory | `~/.kimi/` | `~/.kimi-code/`, relocatable with `KIMI_CODE_HOME` |
| Status | Read-only; no further releases, fixes or security updates | Active; `2.0.2` published 19 September 2026 |

*Read from both repositories and from the npm registry on 22 September 2026.*

> **Warning:** Two details make the archive notice easy to doubt. GitHub’s `archived` flag on the legacy repository was still `false` on 22 September 2026, and commits were still landing that day — the most recent one short-circuits the old entry points into a Kimi Code installer. Treat the README as the statement of record and the commits as the shutdown being wired up, not as maintenance resuming.

## Install Kimi Code CLI

There are three supported routes. The install script drops a single binary and needs no runtime; the npm package needs Node.js 22.19.0 or later, which its `engines` field enforces.

**Install Kimi Code CLI**

```bash
# macOS and Linux, single binary, no Node.js required
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash

# Windows, PowerShell
irm https://code.kimi.com/kimi-code/install.ps1 | iex

# npm, needs Node.js >= 22.19.0
npm install -g @moonshot-ai/kimi-code

# Homebrew
brew install kimi-code

kimi --version
kimi doctor
```

> **Warning:** On Windows, install Git for Windows before first launch: the docs state that Kimi Code CLI “uses the bundled Git Bash as its shell environment.” If Git Bash lives somewhere non-standard, point `KIMI_SHELL_PATH` at the absolute path of `bash.exe`.

The version history is worth a glance before you pin anything. `0.43.1` shipped on 15 September 2026, `2.0.0` on 17 September, `2.0.1` on 18 September and `2.0.2` on 19 September — a jump from a `0.43` line to a `2.0` line inside two days. If you are reading a tutorial written against `0.4x`, assume the flags moved.

## Logging in: subscription OAuth or an API key

Inside the TUI, `/login` offers two paths: Kimi Code OAuth against a subscription, or a Moonshot AI Open Platform API key. `/logout` clears whichever you chose. For headless machines there is a dedicated subcommand, `kimi login`, which runs an RFC 8628 device-code flow and takes no flags. Environment configuration is two variables: `KIMI_API_KEY` and `KIMI_BASE_URL`, the latter defaulting to `https://api.moonshot.ai/v1`.

| Tier | Price per month | What the tier carries |
| --- | --- | --- |
| Andante | ¥49 | Kimi Code, plus 1,000 professional database calls from the shared credit pool. |
| Moderato | ¥99 | Kimi Code, 2,000 calls. |
| Allegretto | ¥199 | Kimi Code, 5,000 calls. |
| Allegro | ¥699 | Kimi Code, 12,000 calls, plus million-token conversations. |

*Moonshot membership pricing, read 22 September 2026. Every paid tier includes Kimi Code and every one of them carries, in Moonshot’s words, a separate limit of 5 hours per week for it. Prices are published in CNY only, and no free tier is listed.*

> **Tip:** A US-dollar figure for a Kimi subscription circulates widely on third-party sites. Moonshot does not publish one on any page we could read, and the localised pricing pages render client-side and return no readable table. If a price matters to your decision, take it from the checkout, not from a blog.

## Models and context windows

Kimi Code CLI talks to Moonshot’s own models by default, and to other providers — Anthropic, OpenAI and compatible endpoints, Google Gemini, Vertex AI, DeepSeek and Qwen — through `[providers.*]` blocks in `~/.kimi-code/config.toml`. Model aliases are declared under `[models]`, and each alias requires an explicit `max_context_size`, so the context window is something you assert rather than something the CLI discovers. Select with `-m` / `--model` on launch or `/model` inside a session.

| Model | Context window (tokens) | Input (USD per 1M) | Cached input (USD per 1M) | Output (USD per 1M) |
| --- | --- | --- | --- | --- |
| `kimi-k3` | 1,048,576 | 3.00 | 0.30 | 15.00 |
| `kimi-k2.7-code` | 262,144 | 0.95 | 0.19 | 4.00 |
| `kimi-k2.7-code-highspeed` | 262,144 | 1.90 | 0.38 | 8.00 |
| `kimi-k2.6` | 262,144 | 0.95 | 0.16 | 4.00 |

*Moonshot platform pricing, read 22 September 2026. These are pay-as-you-go API rates; subscription tiers are billed separately. Which model the CLI selects when you do not name one is not stated in the documentation.*

The million-token window on `kimi-k3` puts Kimi Code in the same bracket as the long-context options elsewhere in this cluster — Grok Build’s million-token models and Claude Code’s `[1m]` variants. [The six-agent comparison](https://cmdbrief.com/guides/agent-cli-comparison) puts those windows side by side.

## What Kimi Code CLI actually supports

| Capability | Kimi Code CLI | Detail from the documentation |
| --- | --- | --- |
| MCP | Yes | `/mcp-config` sets servers up conversationally; `[mcp]` timeouts live in `config.toml`; MCP OAuth is supported. |
| Hooks | Yes | `[[hooks]]` entries with `event`, `matcher`, `command` and `timeout` (1–600s, default 30). Eighteen events, including the blockable `PreToolUse`, `UserPromptSubmit` and `Stop`. JSON arrives on stdin; exit 0 allows, exit 2 blocks, any other non-zero code fails open. |
| Subagents | Yes | Built-ins `coder`, `explore` and `plan`. Custom agents are Markdown with YAML frontmatter in `.kimi-code/agents/`, `.agents/agents/` or `~/.kimi-code/agents/`; select with `--agent` or `--agent-file`. |
| OS sandbox | — | Not documented. A permission system stands in: `default_permission_mode` of `manual`, `yolo` or `auto`, plus `[[permission.rules]]` entries carrying `decision`, `pattern` and `scope`. |
| Git worktrees | — | Not documented anywhere in the English documentation. `--add-dir` adds directories to the workspace, which is a different thing. |
| Headless runs | Yes | `kimi -p "…"`, with `--output-format text\|stream-json` available only alongside `-p`. `--yolo`, `--auto` and `--plan` set the approval posture. |
| ACP and IDE | Yes | `kimi acp` for Zed and JetBrains; `kimi web` serves a local web UI plus a REST and WebSocket server on port 58627. |
| Bring your own provider | Yes | Anthropic, OpenAI and compatible endpoints, Google Gemini, Vertex AI, DeepSeek and Qwen. |
| Open source | Yes | MIT. |

*Read from the Kimi Code CLI documentation on 22 September 2026. A dash means Moonshot does not document the capability. That is not the same as the capability being absent, and it is not a verdict.*

The two dashes are the interesting rows. Every other agent in this cluster except OpenCode documents an operating-system sandbox — Claude Code uses Seatbelt on macOS, Grok Build uses Landlock and Seatbelt, [Cursor CLI](https://cmdbrief.com/guides/cursor-cli) exposes a `--sandbox` flag. Kimi Code gives you permission rules instead, which govern what the agent may ask for rather than what the process can reach. If you were relying on kernel-level confinement, read [the sandbox and permission guide](https://cmdbrief.com/guides/claude-code-sandbox) and decide whether a rule set is enough for the work you are handing over.

## Sessions, resume and forking

Sessions persist under `$KIMI_CODE_HOME/sessions/`, which defaults to `~/.kimi-code/sessions/`, grouped by working directory. Each one holds a `state.json` plus a wire log per agent at `agents/*/wire.jsonl`. That layout is why a session survives a crash and why a tool outside the CLI can read your history back.

**Resume work**

```bash
# continue the most recent session in this directory
kimi --continue
kimi -c

# open the session picker, or jump straight to an id
kimi --session
kimi --session 0f2c…
kimi -S 0f2c…

# zip a session up for sharing or archiving
kimi export 0f2c…
```

`-r` / `--resume` exists as a hidden alias for `--session`, and the two are mutually exclusive with `--continue`. Inside the TUI, `/new` (or `/clear`) starts fresh, `/sessions` (or `/resume`) opens the picker, `/fork` branches the current conversation and `/title` renames it. The subcommand surface is larger than the flag list suggests: `login`, `acp`, `web`, `doctor`, `export`, `migrate`, `upgrade` and `provider` all exist, while `kimi server …` is deprecated and exits 1 for everything except `kimi server kill`.

## It reads AGENTS.md only — there is no KIMI.md and no CLAUDE.md fallback

This is the single thing that surprises people arriving from another agent. Kimi Code CLI takes repository instructions from `AGENTS.md` and nothing else. A grep of the whole English documentation set for `KIMI.md` and for `CLAUDE.md` returns zero hits.

- Global instructions live at `$KIMI_CODE_HOME/AGENTS.md`, which is `~/.kimi-code/AGENTS.md` by default.
- Cross-tool instructions can also sit at `~/.agents/AGENTS.md`, which the docs call out explicitly as the shared location.
- Project instructions are `<project>/.kimi-code/AGENTS.md` or a plain `AGENTS.md` at the repository root.
- `/init` generates one for you against the current repository.
- `SYSTEM.md` in `$KIMI_CODE_HOME` permanently overrides the main agent’s system prompt — a blunt instrument, and worth knowing exists before you find it by accident.

That puts Kimi Code at one end of a spectrum the rest of this cluster occupies. Grok Build reads `AGENTS.md` and `CLAUDE.md` and claims “full compatibility with Claude Code with zero configuration needed”. Cursor CLI reads `.cursor/rules/*.mdc`, `AGENTS.md` and `CLAUDE.md`. OpenCode v1 falls back to `CLAUDE.md`; [OpenCode v2 deliberately dropped that fallback](https://cmdbrief.com/guides/opencode). If you maintain one repository that several agents touch, `AGENTS.md` is the file that every one of them reads.

Runtime configuration is separate from instructions. The data root is `~/.kimi-code/`, relocatable with `KIMI_CODE_HOME`, holding `config.toml` for runtime settings and `tui.toml` for the interface; project-local overrides go in `<project-root>/.kimi-code/local.toml`.

## Migrating off the Python CLI

1. Install Kimi Code CLI with any of the commands above.
2. Run `kimi migrate`, or simply launch `kimi` — it detects an existing `~/.kimi/` and offers to migrate. Configuration, MCP server definitions, input history and sessions move across.
3. Re-run `/login`. Credentials, MCP authorizations and legacy plugins are explicitly not migrated.
4. Remove the old install: `uv tool uninstall kimi-cli`, or `brew uninstall kimi-cli`.
5. Check the result with `kimi doctor` before you point any automation at the new binary.

> **Tip:** If you script against the CLI, the migration is a good moment to re-read your flags. `--output-format` is only accepted alongside `-p`, and the session flags changed shape between the two products.

## Where CmdBrief fits, and what it honestly cannot show

CmdBrief is a Mac workspace that runs six agent CLIs — Claude Code, Codex, Grok CLI, Kimi CLI, OpenCode and Cursor CLI — in named per-product workspaces, with working, needs-input and done states, a diff review pane and an integrated terminal. Claude, Codex, Grok and Cursor can lead a crew; Kimi runs in terminal panes only. For Kimi it reads the session index at `~/.kimi-code/session_index.jsonl` and each session’s `state.json`, so past work is browsable next to the running pane.

The honest limitation is usage. CmdBrief shows rolling and weekly windows for Claude Code and Codex, weekly credits for Grok CLI, Go-plan windows for OpenCode and monthly pools for Cursor CLI. Kimi exposes no usage data at all — there is no equivalent of a `kimi usage` command and nothing in the session files to derive one from — so there is no Kimi usage meter, and inventing one would mean inventing the numbers. If watching a limit is what you need, [the usage-limits guide](https://cmdbrief.com/guides/claude-code-usage-limits) covers the agents that do publish one.

That gap is a reason to run Kimi Code beside something that meters, not instead of it. [Comparing all six agent CLIs](https://cmdbrief.com/guides/agent-cli-comparison) is the fastest way to see which combination covers your work, and [the tool comparisons](https://cmdbrief.com/compare) cover the workspaces you might run them in.

## Questions

### Is Kimi CLI discontinued?

The Python `kimi-cli` is. Its README states that the project is archived, the repository is read-only, there will be no further releases, bug fixes or security updates, and that existing installations are no longer supported and will stop working. The successor is Kimi Code CLI at `MoonshotAI/kimi-code`, and the command is still `kimi`.

### How do I install Kimi Code CLI?

Run `curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash` on macOS or Linux, `irm https://code.kimi.com/kimi-code/install.ps1 | iex` on Windows, or install `@moonshot-ai/kimi-code` from npm with Node.js 22.19.0 or later. Homebrew ships `kimi-code` as well. On Windows, install Git for Windows first — the CLI uses the bundled Git Bash as its shell.

### Does Kimi Code CLI read CLAUDE.md?

No. It reads `AGENTS.md`, at `~/.kimi-code/AGENTS.md` globally, at `~/.agents/AGENTS.md` for cross-tool instructions, and at the project root or `<project>/.kimi-code/AGENTS.md`. A search of the whole English documentation set for `CLAUDE.md` and `KIMI.md` returns nothing.

### Does Kimi Code CLI sandbox commands?

Moonshot does not document an operating-system sandbox. What is documented is a permission system: `default_permission_mode` set to `manual`, `yolo` or `auto`, plus `[[permission.rules]]` entries with a decision, a pattern and a scope. Absence from the documentation is not proof of absence in the product, which is why this page shows a dash rather than a no.

### What does Kimi Code CLI cost?

Moonshot lists four paid membership tiers, all of which include Kimi Code: ¥49, ¥99, ¥199 and ¥699 per month, each with a separate limit of 5 hours per week for Kimi Code. No free tier is listed and no US-dollar price is published on a readable page. API access is billed per token, from 0.95 USD per million input tokens on `kimi-k2.7-code`.

## Primary sources

Provider terms and product behavior can change. Confirm plan, pricing, model, and permission details in the current official documentation.

- [Kimi Code CLI repository](https://github.com/MoonshotAI/kimi-code)
- [Kimi Code CLI: getting started](https://moonshotai.github.io/kimi-code/en/guides/getting-started)
- [Kimi Code CLI: sessions](https://moonshotai.github.io/kimi-code/en/guides/sessions)
- [Kimi Code CLI: configuration files](https://moonshotai.github.io/kimi-code/en/configuration/config-files)
- [Kimi Code CLI: data locations](https://moonshotai.github.io/kimi-code/en/configuration/data-locations)
- [Kimi Code CLI: hooks](https://moonshotai.github.io/kimi-code/en/customization/hooks)
- [Kimi Code CLI: agents](https://moonshotai.github.io/kimi-code/en/customization/agents)
- [Kimi Code CLI: the kimi command](https://moonshotai.github.io/kimi-code/en/reference/kimi-command)
- [Kimi CLI (archived) migration notice](https://github.com/MoonshotAI/kimi-cli)
- [Moonshot platform pricing](https://platform.kimi.ai/docs/pricing/chat)
- [Kimi membership pricing](https://www.kimi.com/en/help/membership/membership-pricing)

## Keep reading

- Comparisons: [Agent CLI comparison (2026): six terminal coding agents](https://cmdbrief.com/guides/agent-cli-comparison)
- Workflows: [Grok CLI is now Grok Build: install, models, limits](https://cmdbrief.com/guides/grok-cli)
- Workflows: [OpenCode in 2026: v1 vs v2, plans, and which one you mean](https://cmdbrief.com/guides/opencode)

---

Markdown mirror of https://cmdbrief.com/guides/kimi-cli, generated at build time from the same data the HTML page renders. Machine-readable index: https://cmdbrief.com/llms.txt
