Cursor’s Composer 2 has been running on Kimi K2.5 under the hood โ and most developers praising its quality had no idea they were already using Moonshot AI’s model. On April 13, 2026, Moonshot rolled out K2.6-code-preview to all Kimi Code subscribers. The model scores 76.8% on SWE-Bench Verified (the K2.5 baseline) at $0.60 per million input tokens โ roughly 5x cheaper than Claude Sonnet 4.6. This kimi code cli tutorial starts where the benchmarks end โ with a working terminal session, real commands, and the gotchas nobody else is documenting in English.
What follows covers everything a developer outside China needs to get Kimi Code CLI running: install, authenticate, initialize a project, use shell mode, and wire up an MCP server. If you’ve used Claude Code or Codex CLI, the workflow will feel familiar. The pricing will not.
Before You Install: What You Actually Need (And the Account Gotcha)
Prerequisites are straightforward: Python 3.13 (3.12โ3.14 supported), terminal access, and a Moonshot AI account at platform.kimi.ai. The install script handles uv (Astral’s fast Python package manager) automatically if you don’t have it.
Here’s what the official docs won’t tell you upfront: international developers may hit a Chinese mobile number requirement during registration. Card payments from outside China work but are reportedly clunky. New accounts receive free credits, plus a $5 bonus voucher when cumulative recharges reach $5 โ a small sweetener for the friction.
Kimi Code itself is an Apache 2.0 open-source CLI with 7,800+ GitHub stars, backed by the same K2 model family that quietly powers Cursor’s Composer 2 โ something our full AI coding assistant comparison documented in March 2026. You’re not beta-testing an unknown model. Thousands of developers have already battle-tested it through Cursor without realizing it.
Install Kimi Code CLI in One Command
The official getting started documentation lists three installation methods. The recommended approach is a single curl command that bootstraps uv and installs the CLI in one shot.
# Recommended: one-liner (Linux/macOS)
curl -LsSf https://code.kimi.com/install.sh | bash
# If you already have uv installed
uv tool install --python 3.13 kimi-cli
# Fallback: pip (any Python 3.12-3.14 environment)
pip install kimi-cli
The curl script detects your OS, installs uv if missing, then runs uv tool install behind the scenes. If you prefer managing your own Python toolchain, the PyPI package (version 1.35.0, released April 15, 2026) works with a plain pip install. Verify your installation:
kimi --version
# Expected output: 1.35.0
Authenticate and Initialize Your First Project
Launch the CLI by typing kimi in your terminal, then run the /login slash command. Select “Kimi Code” as the platform โ this opens an OAuth browser flow where you authorize the CLI with your Moonshot account. If you’d rather skip the browser, paste an API key manually from platform.kimi.ai.
# Step 1: Launch the CLI
kimi
# Step 2: Authenticate (inside the CLI)
/login
# โ Select "Kimi Code" โ browser opens โ authorize
# Step 3: Navigate to your project and initialize
cd /path/to/your/project
/init
# Useful commands to know
/help # List all slash commands
/compact # Compress context when nearing token limits
/new # Start a fresh session
Settings save to ~/.kimi/ and reload automatically on future launches. The /init command is where things get interesting โ it scans your project structure and generates an AGENTS.md file that gives Kimi persistent context about your architecture. Think of it as a cheat sheet the model reads before every task, so it doesn’t waste tokens rediscovering your file layout on each session.

Run Your First Kimi Code CLI Task
Agent mode is the default. Type a natural language instruction and Kimi plans the task, shows its tool calls, and prompts you for approval before writing any files. Here’s a concrete example:
> Create a Python FastAPI endpoint that returns system health
status with uptime and memory usage
Kimi will decompose this into steps: create the file, import psutil and fastapi, write the endpoint logic, and suggest a requirements update. Each file modification triggers an approval prompt โ you see the diff before anything hits disk. This is the same approval flow Claude Code users already know, which tracks with Andriy Burkov’s observation on X that “visually both work the same way.”
K2.6 improves over K2.5 with deeper reasoning traces, better task decomposition, and more consistent multi-step tool call execution. According to BuildFastWithAI’s analysis, K2.5 baselines were 76.8% on SWE-Bench Verified and 85% on LiveCodeBench โ official K2.6 numbers remain pending, though beta testers report measurable improvement in structured planning.
The underlying architecture โ 1 trillion parameters total with 32B active via Mixture of Experts and a 256K context window โ keeps inference costs low despite the model’s scale.
For low-stakes work, YOLO mode (kimi.yoloMode) auto-approves all tool calls without confirmation prompts. Faster iteration, but don’t enable it on production codebases unless you enjoy living dangerously. If you’ve built agents with Claude’s Computer Use API, you’ll recognize the trust-versus-speed tradeoff.
Shell Mode: Power and Pitfalls
Press Ctrl-X to toggle into shell mode, where you can run terminal commands without leaving the CLI. Simple sequences work well โ ls, mkdir, running a test suite.
But here’s the gotcha that will waste your afternoon if nobody warns you: cd, export, and other stateful commands do not persist between shell mode executions. Each command runs in its own isolated process.
# This will NOT work as expected in shell mode:
cd src/
ls # โ still in original directory, not src/
# Workaround: chain commands with &&
cd src/ && ls # โ works correctly
# Or: use agent mode for multi-step filesystem navigation
> Navigate to src/ and list all Python files
This is not a bug โ it’s an architecture decision. But if you come from Claude Code’s shell integration where cd persists, you’ll chase a ghost bug until you understand the difference.
Extend Kimi Code with MCP Servers
MCP (Model Context Protocol) connects Kimi to external tools and data sources โ databases, browser automation, documentation APIs. The CLI manages MCP servers through the kimi mcp subcommand set, documented in the official MCP configuration docs.
# Add an HTTP-based MCP server
kimi mcp add --transport http context7 \
https://mcp.context7.com/mcp \
--header 'CONTEXT7_API_KEY: ctx7sk-your-key'
# Add a stdio-based MCP server
kimi mcp add --transport stdio chrome-devtools \
-- npx chrome-devtools-mcp@latest
# Validate connectivity
kimi mcp test
# Manage servers
kimi mcp list
kimi mcp remove context7
Configuration saves to ~/.kimi/mcp.json in a format compatible with other MCP clients. All MCP tool calls go through the same approval prompt as file modifications โ unless you’ve enabled YOLO mode. For a deeper look at how MCP fits into the broader AI agent ecosystem, our framework comparison covers the protocol’s role across coding agents.
GUI-preferring developers have an alternative: the Kimi Code extension on the VS Code Marketplace (ID: moonshot-ai.kimi-code) provides an MCP management panel, Plan Mode for reviewing steps before execution, and the same /init and /compact slash commands in a sidebar interface.
Pricing, Quotas, and the Open-Source Catch
The numbers are stark. On the Moonshot Open Platform API, Kimi K2.5 runs at $0.60 per million input tokens and $3.00 per million output tokens. Claude Sonnet 4.6 charges $3.00 and $15.00 respectively. A team running 50 coding sessions per week will feel that 5x gap in their monthly invoices.
Cache discounts widen the lead further: kimi-k2.5 cache hits drop to $0.10/MTok (~83% off input), significant for iterative sessions that keep reusing project context. One distinction worth flagging: Kimi Code membership itself runs on a quota basis, not direct per-token billing โ the API rates above apply when you’re hitting the Open Platform directly.
As developer Jason Zhou noted on X after real-world testing: “Exceptional coding capability. Cost only 20% of Claude 4. Only downside is API is a bit slow.” Honesty appreciated.
Quotas bear watching: a 5-hour rolling window allocates 300โ1,200 API calls with a maximum of 30 concurrent requests. Agent Swarm supports up to 100 sub-agents, but anything beyond 30 concurrent will queue. Generous for interactive use; potentially limiting for large-scale batch refactoring.
Now the contradiction. Kimi Code is Apache 2.0 on GitHub โ open-source by license. But the kimi-for-coding API endpoint only works with whitelisted clients: Kimi CLI, Claude Code, Roo Code, Kilo Code, and a handful of other approved agents. Attempts from non-whitelisted tools return errors indicating the endpoint is “only available for Coding Agents.” That’s not what “open-source” usually implies, and developers building custom toolchains should understand this limitation before committing.
One more wrinkle: there is no version pinning. The unified kimi-for-coding model name means Moonshot can silently upgrade every user โ the K2.5 to K2.6 switch on April 13 happened with no opt-out. Fine for interactive coding. Problematic if you’re running Kimi in CI/CD pipelines where reproducibility matters. English documentation is also Chinese-first with gaps remaining; the GitHub README and official docs are the most reliable English sources as of April 2026.
What This Kimi Code CLI Tutorial Can’t Answer Yet
The open question: will Moonshot open the coding API to arbitrary clients as the ecosystem matures, or does the whitelist stay as a competitive moat? The answer determines whether Kimi Code becomes a platform or remains a product โ and it’s entirely Moonshot’s prerogative to decide.
Here’s the reframe worth sitting with: the model family that thousands of developers credited to Cursor has been Moonshot AI’s all along. You can now run it directly, from your own terminal, at a fraction of the cost, with full control over your project context. The real disruption isn’t the benchmarks โ it’s that the supply chain of AI coding models just became visible to the people using them.
Official K2.6 benchmark numbers on SWE-Bench Verified are pending publication. When they drop, they’ll answer the question that matters most: does K2.6 close the gap on Claude Opus 4.6’s 80.8% score, or does Kimi Code remain a cost play while ceding the capability crown? Either way, the model behind the curtain now has a name โ and a terminal you can launch yourself.
Get the Daily Pulse
Sharp analysis on what's actually moving in AI. No hype, no filler, no weekly digest.



