Workflows

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.

  • Updated September 22, 2026
  • 9 min read
  • 11 primary sources

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, 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)
RepositoryMoonshotAI/kimi-cliMoonshotAI/kimi-code
Language and licencePython, Apache-2.0Single binary, MIT
Packagekimi-cli (uv / Homebrew)@moonshot-ai/kimi-code on npm, or the install script
Data directory~/.kimi/~/.kimi-code/, relocatable with KIMI_CODE_HOME
StatusRead-only; no further releases, fixes or security updatesActive; 2.0.2 published 19 September 2026
Read from both repositories and from the npm registry on 22 September 2026.

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 CLIbash
# 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

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.

TierPrice per monthWhat the tier carries
Andante¥49Kimi Code, plus 1,000 professional database calls from the shared credit pool.
Moderato¥99Kimi Code, 2,000 calls.
Allegretto¥199Kimi Code, 5,000 calls.
Allegro¥699Kimi 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.

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.

  • kimi-k3

    Context window (tokens)
    1,048,576
    Input (USD per 1M)
    3.00
    Cached input (USD per 1M)
    0.30
    Output (USD per 1M)
    15.00
  • kimi-k2.7-code

    Context window (tokens)
    262,144
    Input (USD per 1M)
    0.95
    Cached input (USD per 1M)
    0.19
    Output (USD per 1M)
    4.00
  • kimi-k2.7-code-highspeed

    Context window (tokens)
    262,144
    Input (USD per 1M)
    1.90
    Cached input (USD per 1M)
    0.38
    Output (USD per 1M)
    8.00
  • kimi-k2.6

    Context window (tokens)
    262,144
    Input (USD per 1M)
    0.95
    Cached input (USD per 1M)
    0.16
    Output (USD per 1M)
    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 puts those windows side by side.

What Kimi Code CLI actually supports

CapabilityKimi Code CLIDetail from the documentation
MCPYes/mcp-config sets servers up conversationally; [mcp] timeouts live in config.toml; MCP OAuth is supported.
HooksYes[[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.
SubagentsYesBuilt-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 runsYeskimi -p "…", with --output-format text|stream-json available only alongside -p. --yolo, --auto and --plan set the approval posture.
ACP and IDEYeskimi acp for Zed and JetBrains; kimi web serves a local web UI plus a REST and WebSocket server on port 58627.
Bring your own providerYesAnthropic, OpenAI and compatible endpoints, Google Gemini, Vertex AI, DeepSeek and Qwen.
Open sourceYesMIT.
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 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 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 workbash
# 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. 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.

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 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 is the fastest way to see which combination covers your work, and the tool comparisons 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.

Still unsure? Write to [email protected] or use the contact form. Contact CmdBrief →

Primary sources

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

Put it into practice

Supervise Kimi Code alongside every other agent CLI you run.

Apple silicon · macOS 26+ · Subscription required · 14-day money-back guarantee

We value your privacy

We use cookies to analyze site usage and improve your experience.

Learn more about our cookies

Essential cookies are always active