← All posts

Guide

How to install Kimi Code, Moonshot's coding-agent CLI

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

MethodCommandNeeds Node?
macOS / Linux scriptcurl -fsSL https://code.kimi.com/kimi-code/install.sh | bashNo
Windows PowerShellirm https://code.kimi.com/kimi-code/install.ps1 | iexNo
npmnpm install -g @moonshot-ai/kimi-codeYes, 22.19.0+
pnpmpnpm add -g @moonshot-ai/kimi-codeYes, 22.19.0+
Upgradekimi 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:

/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.

PathPriceNotes
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/yr60 agent credits, 1× Kimi Code credits
Allegretto$39/mo, $372/yr150 credits, 5×
Allegro$99/mo, $948/yr360 credits, 15×
Vivace$199/mo, $1,908/yr720 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 CodeClaude CodeOpenCode
LicenseMITProprietaryOpen source
AgeSince May 2026Since early 2025Since 2025
Model lock-inKimi default, other providers configurableClaude modelsProvider-agnostic
Subagentscoder, explore, planYes, user-definedYes
Video inputYesNoNo
Editor protocolkimi acp (Zed, JetBrains)Own extensionsACP + extensions
Local web UIkimi webNoYes
BackgrindPTY-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

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.