Guide
How to install Kimi Code, Moonshot's coding-agent CLI
One line installs it: 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 in Windows
PowerShell, or npm install -g @moonshot-ai/kimi-code anywhere. Then run
kimi in a project directory and type /login. Kimi Code is Moonshot's own
terminal coding agent — TypeScript, MIT-licensed, and the house client for
Kimi K3. It is also genuinely young: dozens of minor
releases since May, every one of them still a 0.x. Check kimi --version rather than
trusting a version number you read in a blog post.
First, a timeline correction
A lot of coverage says Kimi Code launched alongside K3. It didn't. The
MoonshotAI/kimi-code repo was created in late May 2026, its earliest
changelog entries are from the same week, and press coverage ran in early June — roughly six weeks
before K3 was announced on July 16. K3 support was added to an already-shipping CLI. The related
claim that it hit "v1.49" on K3 launch day is also wrong: every release npm has published is a
0.x. There is no 1.x.
The second trap is the older tool. MoonshotAI/kimi-cli was a Python CLI on
PyPI, and it now carries a notice that it is "evolving into Kimi Code CLI"
and will be "gradually wound down." Two repos, two documentation sites, similar names. If a
tutorial tells you to pip install kimi-cli, it is describing the predecessor.
Installing Kimi Code migrates the old config and sessions for you; kimi migrate
does it explicitly.
Install it
| Method | Command | Needs Node? |
|---|---|---|
| macOS / Linux script | curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash | No |
| Windows PowerShell | irm https://code.kimi.com/kimi-code/install.ps1 | iex | No |
| npm | npm install -g @moonshot-ai/kimi-code | Yes, 22.19.0+ |
| pnpm | pnpm add -g @moonshot-ai/kimi-code | Yes, 22.19.0+ |
| Upgrade | kimi upgrade (or npm install -g @moonshot-ai/kimi-code@latest) | — |
| Uninstall (npm) | npm uninstall -g @moonshot-ai/kimi-code | — |
Verify with kimi --version. The Node floor is 22.19.0, not the
24.15.0 the README and parts of the docs claim — the published package's engines
field declares >=22.19.0, an open issue tracks the contradiction, and the
getting-started page agrees with the package. The script
installs are a single-binary distribution and sidestep the question. On Windows you also need
Git for Windows installed; KIMI_SHELL_PATH overrides where the CLI
looks for Git Bash.
Sign in
Run kimi inside a project directory and type /login, or run
kimi login headlessly. You get two choices:
- Kimi Code (OAuth) — a device-code flow. Open the printed link on any device, sign in to your Kimi account, enter the code. This bills against your Kimi membership.
- Kimi Platform API key — paste a key from the Kimi developer platform. This bills per token.
/logout signs out. All logged-in devices and API keys on an account share the same
quota, devices left idle long enough get unbound — running /login again restores
them — and the number of API keys you can hold at once is capped per account.
What it actually costs
Two meters, and they are not interchangeable. The OAuth login draws on a Kimi membership; the API key draws on account balance at list prices.
| Path | Price | Notes |
|---|---|---|
API, model kimi-k3 | $3.00 / MTok in, $15.00 / MTok out | $0.30 / MTok on cache hits; 1,048,576-token context |
| Moderato | $19/mo, $180/yr | 60 agent credits, 1× Kimi Code credits |
| Allegretto | $39/mo, $372/yr | 150 credits, 5× |
| Allegro | $99/mo, $948/yr | 360 credits, 15× |
| Vivace | $199/mo, $1,908/yr | 720 credits, 30× |
On the free tier, hedge. Moonshot's help-centre pricing page says "Kimi offers
four membership tiers" and lists no free plan; marketing pages and several third-party posts
describe one. A free Kimi account may well give you a taste of the CLI, but the documented floor
is $19/mo. Separately — and this one is explicit in the vendor docs — the new-user $2 API trial
voucher cannot be spent on kimi-k3. You need real balance.
Quota mechanics are also muddled between two vendor pages. The Kimi Code docs say it has "its own 5-hour / weekly rate limit that applies only to Kimi Code"; the membership-credits page says all features share one unified pool. The safe reading: separate rate-limit windows, ultimately capped by your membership's credits, which refresh on your subscription cycle and don't roll over. If you want these numbers next to everything else on the market, our model pricing tracker keeps the per-token rates in one table.
Configuration, and the telemetry default
Config is TOML at ~/.kimi-code/config.toml (relocate the whole data directory with
KIMI_CODE_HOME), with project-local overrides in
<project-root>/.kimi-code/local.toml — which the docs recommend gitignoring —
and UI preferences in tui.toml. Provider types include kimi,
anthropic, openai, openai_responses,
google-genai and vertexai, so it will drive other vendors' models too.
One behaviour worth changing on day one: config.toml has a top-level
telemetry field that defaults to true. Anonymous data
collection is on unless you set telemetry = false. Note also that API keys are read
only from config files — shell environment variables are not automatically consulted,
which surprises people coming from Claude Code.
How it compares to Claude Code and OpenCode
| Kimi Code | Claude Code | OpenCode | |
|---|---|---|---|
| License | MIT | Proprietary | Open source |
| Age | Since May 2026 | Since early 2025 | Since 2025 |
| Model lock-in | Kimi default, other providers configurable | Claude models | Provider-agnostic |
| Subagents | coder, explore, plan | Yes, user-defined | Yes |
| Video input | Yes | No | No |
| Editor protocol | kimi acp (Zed, JetBrains) | Own extensions | ACP + extensions |
| Local web UI | kimi web | No | Yes |
| Backgrind | PTY-wraps whichever of these you already run, in an always-on-top window | ||
The CLI surface will feel familiar: -p/--prompt for one-shot non-interactive runs,
-c/--continue to resume the most recent session in the current directory,
-m/--model, --plan for plan mode, and -y/--yolo to
auto-approve regular tool calls. By default read-only operations run automatically while file
edits and shell commands ask first. Subcommands worth knowing: kimi doctor for
config and TUI diagnostics, kimi export, kimi vis for a browser session
visualizer, and kimi provider add|list|catalog. MCP servers are configured
conversationally via /mcp-config, and there are Agent Skills and lifecycle hooks —
the same primitives Claude Code exposes.
The genuinely novel bit is video input: you can hand it a screen recording or a demo clip. Nothing in Claude Code or OpenCode does that today.
You don't need this CLI to run K3
Moonshot documents both alternatives itself. For Claude
Code, set ANTHROPIC_BASE_URL to Moonshot's Anthropic-compatible endpoint,
ANTHROPIC_AUTH_TOKEN to a Kimi API key, point the model variables at the K3 id, and
check /status. For OpenCode, run
opencode auth login, choose Moonshot AI, paste the key, then /models to
pick K3 and /variants to set reasoning effort — that last setting is the single
biggest lever on cost, since max is the default.
Don't hardcode a model string from a blog post. The pricing page says kimi-k3, the
Claude Code guide uses a 1M-context variant suffix, and the CLI's own config example uses
k3 under a kimi-code/k3 alias. Three vendor hosts also appear across the
docs — a rebrand from moonshot.ai to kimi.com is visibly mid-flight. Run /models or
read your console instead.
Honest caveats
- It is young. Hundreds of open issues, and version numbers moving several times a week. Pin nothing you can't re-pin.
- Telemetry is on by default. Covered above; a one-line fix, but you have to know.
- Data residency is vague. The service is operated by Moonshot AI Pte. Ltd. (Singapore) with a Beijing operating entity. The privacy policy says data may be transferred to and stored on servers outside your country of residence without naming a jurisdiction, and prompts and uploaded content may be used to improve models, with no documented in-product training opt-out for the consumer product as of mid-2026. For client code under NDA, that is a procurement conversation, not a preference.
- Benchmarks are unsettled. The widely repeated K3 coding scores come from secondary aggregators, and at least one was reportedly run inside Kimi Code at max reasoning rather than a common harness. Treat them as vendor-reported and unreproduced; the fuller picture is in Fable 5 vs Kimi K3.
Frequently asked questions
How do I install Kimi Code?
On macOS or Linux run curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash. On Windows PowerShell run irm https://code.kimi.com/kimi-code/install.ps1 | iex. If you would rather use a package manager, npm install -g @moonshot-ai/kimi-code works on any platform. The script install ships a single binary and does not need Node.js at all; the npm install does. The command you run afterwards is kimi.
What Node.js version does Kimi Code need?
Node 22.19.0 or newer, if you install via npm or pnpm. The vendor material contradicts itself here — the README and parts of the docs still say Node 24.15.0, but the published package declares "node": ">=22.19.0" in its engines field, and an open GitHub issue documents the conflict. If you install with the shell script you skip the question entirely, since that build bundles its own runtime.
Is there a free tier for Kimi Code?
Moonshot's own help-centre pricing page lists four paid membership tiers starting at $19/mo (Moderato) and documents no free coding allowance. Marketing pages and secondary write-ups describe a free tier, and a free Kimi account may give you a taste of the CLI, but we could not confirm a usable free Kimi Code quota from primary vendor documentation. Budget for a paid membership or pay-as-you-go API credit at $3 per million input tokens and $15 per million output.
Do I need Kimi Code to use Kimi K3?
No. Moonshot publishes its own guides for pointing Claude Code and OpenCode at K3. For Claude Code you set ANTHROPIC_BASE_URL to Moonshot's Anthropic-compatible endpoint plus ANTHROPIC_AUTH_TOKEN to a Kimi API key; for OpenCode you run opencode auth login, pick Moonshot AI, paste the key, and select the K3 model. Kimi Code is worth installing for its own features — subagents, video input, ACP — not because it is the only way to reach the model.
Where Backgrind fits
Backgrind is not a model and not an agent. It is a desktop overlay for macOS and Windows that PTY-wraps the CLI you already run — Claude Code, Cursor, Codex, OpenCode, or a managed endpoint — and keeps it in an always-on-top window over your other apps, including games running in borderless fullscreen (exclusive fullscreen is out of scope). It pings you only when the agent needs a decision or finishes, so a long K3 run doesn't need you parked in front of a terminal. In BYO-CLI mode your agent's content never touches our servers, and Live mode (Plus and Pro) lets you answer those prompts from a phone or browser.
If you're weighing Kimi Code against what you already have, the useful test isn't a leaderboard — it's the same task in two tabs on your own repo. The Fusion council formalises that: your own CLIs answer one hard question in parallel and a chairman returns a single verdict, pinging you only when they disagree or confidence comes back low.
Sources
Repository, README and release history: MoonshotAI/kimi-code. Install commands, Node requirement and sign-in flow: getting started. Flags and subcommands: kimi command reference. Config paths, provider types and the telemetry default: config files. Package version and engines field: npm registry metadata. API pricing and context window: Kimi platform — K3 pricing. Third-party CLI integration guides, including the $2 voucher restriction: Claude Code with Kimi and OpenCode with Kimi. Membership tiers: Kimi help centre — membership pricing. K3 announcement details: Simon Willison on Kimi K3. Benchmark figures attributed to K3 are vendor-reported and not independently reproduced.