Kimi Code CLI: Open-Source AI Coding Agent with Skills & MCP Support

Get Kimi Code CLI running in your project, see which K3.1 Pro or earlier coding model your plan includes, and find commands for your first session.

Kimi Code CLI is Moonshot AI’s open-source AI coding agent for the terminal. Open it inside a project and ask it to trace a bug, explain unfamiliar code, implement a feature, or refactor several files. The agent reads the relevant source files, runs commands, makes edits, and uses the results of each step to continue the task.

Its interactive terminal UI is the main workspace, with a local browser UI and ACP connections for editors such as Zed and JetBrains. Kimi models power the coding sessions, and the CLI can draw on MCP servers, project Skills, plugins, and specialized agents when a task calls for them.

Features

  • Explores repositories, edits project files, and runs builds or tests in response to coding tasks.
  • Tracks multi-step work through interactive sessions, Plan mode, and Goal mode.
  • Uses Kimi Code models or configured third-party model providers.
  • Opens sessions in the terminal, a local browser UI, or an ACP-connected editor.
  • Connects to external services through MCP, including MCP OAuth authentication.
  • Uses project instructions, Agent Skills, and installable plugins.
  • Delegates focused work to subagents and coordinates larger jobs with swarm or experimental Tower mode.
  • Accepts images and video clips when the selected model can process them.

Kimi Code CLI Quick Reference

TaskCommand
Open a coding sessionkimi
Run one promptkimi -p "TASK"
Resume the latest sessionkimi --continue
Open the local browser UIkimi web
Connect an ACP editorkimi acp
Check the installed versionkimi --version
Check for updateskimi upgrade

How Kimi Code CLI Works in a Project

A coding session begins in the current project directory. Ask Kimi to investigate an error, and it can search for the relevant functions, inspect nearby files, and run a test or command to check its findings. For an implementation task, the conversation can continue through file edits, command output, and follow-up changes. The agent has access to the project workspace and uses tool results as new context for its next action.

For example, a request to add a validation function and its unit tests gives the agent a concrete objective. It can inspect the project’s existing validation rules, write the function in the relevant module, update tests, and execute the test command. In an interactive session, read-only operations normally proceed automatically. File changes and shell commands follow the active approval mode.

Plan mode and longer tasks

Plan mode is useful before changing a large or unfamiliar codebase. Enter /plan or press Shift-Tab to have Kimi explore and draft an implementation plan. It waits for approval before carrying out the plan, even under Never Ask permissions. Goal mode handles an objective that needs continued work across multiple turns. For example, /goal can track a defined set of failing tests and continue the work toward the requested completion criteria.

The input box also has a shell mode: type ! in an empty prompt to run a shell command and bring its output into the conversation. Prior sessions can be resumed, forked, or compacted if the context becomes large.

Choosing a Kimi Model for Coding

Kimi Code currently has 6 model IDs. K3.1 Pro is the newest flagship for complex coding and long-running agent tasks. The model picker uses the exact IDs shown here.

Model IDModel and coding role
k3.1-proK3.1 Pro · complex coding, debugging, long agent tasks
k3.1-pro-highspeedK3.1 Pro Highspeed · faster generated output
k3K3 · large codebases and extended sessions
k3-256kK3 · routine work within 256K context
kimi-for-codingK2.8 Preview · code completion and daily development
kimi-for-coding-highspeedK2.7 Code Highspeed · faster responses from the older coding model

How K3.1 Pro relates to K3 and the Coding models

K3.1 Pro is Kimi’s current flagship for difficult multi-file changes, long debugging sessions, and tasks that require substantial project context. K3.1 Pro Highspeed uses the K3.1 Pro model capabilities and produces generated output roughly two to three times faster. It consumes approximately twice the Kimi Code quota of the regular version. Build commands, tests, and other external tool operations take their usual execution time.

K3 is the preceding flagship. Its k3-256k variant works with the K3 model inside a 256K-token context window and uses approximately half the quota of the 1M K3 variant. The 256K context window is suited to short edits, routine testing, and changes within a few files. The 256K variant accepts image input, but it cannot process video clips.

Model access and how to switch

The Go plan has no coding quota. On current Kimi Code plans, Plus includes K3.1 Pro, K3, K3-256K, and K2.8 Preview. Pro unlocks K3.1 Pro Highspeed and K2.7 Code Highspeed. The full one-million-token context window for K3.1 Pro and K3 is available from Pro.

K3.1 Pro and Highspeed require thinking mode and accept low, high, and max reasoning effort. Requests that disable thinking receive an HTTP 400 response. K3 and K2.8 Preview support adjustable thinking effort as well.

Enter /model inside the terminal session to select a model. If K3.1 Pro is missing from the picker, sign out with /logout and sign in again using /login. A new session is recommended when moving from K3 or an older Coding model to K3.1 Pro: mixed reasoning history can affect responses, and a switch resets the context cache.

The setup for calling Kimi models from other coding agents is explained in How to Use Kimi K3.1 Pro in Codex & Claude Code.

How to Install and Start Kimi Code CLI

macOS and Linux

curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash

Windows

irm https://code.kimi.com/kimi-code/install.ps1 | iex

npm

The npm package requires Node.js 22.19.0 or newer.

npm install -g @moonshot-ai/kimi-code

Your first coding session

Run kimi from the repository you want to work on. The first session needs a model connection. Enter /login and select Kimi Code OAuth to authorize a membership in the browser, or enter a Kimi Platform API key. Once signed in, ask for a short explanation of the project structure to see how the agent reads the codebase.

kimi --version
cd your-project
kimi

Updating or removing the CLI

Run kimi upgrade for release updates. A global npm install can be updated or removed through npm.

kimi upgrade
npm install -g @moonshot-ai/kimi-code@latest
npm uninstall -g @moonshot-ai/kimi-code

Working in the Browser and Your Editor

Kimi sessions can run from a local browser tab or from an ACP editor. In Zed or JetBrains, the agent’s conversation appears alongside the source code, and file edits and shell commands run in the connected project workspace.

Local browser UI

Run kimi web in a terminal to start the local server and open the browser UI. The server stays in the foreground until you stop it. It provides session access through its REST and WebSocket service as well as the browser page.

kimi web

Zed and JetBrains IDEs

ACP lets an editor start Kimi Code CLI as a subprocess using kimi acp. The editor communicates with the agent through the Agent Client Protocol and reuses the login completed in the terminal. In Zed, place the following configuration in ~/.config/zed/settings.json and open the editor’s Agent panel.

{
  "agent_servers": {
    "Kimi Code CLI": {
      "type": "custom",
      "command": "kimi",
      "args": ["acp"],
      "env": {}
    }
  }
}

In JetBrains IDEs, open the AI Chat panel’s Configure ACP agents option and enter the agent configuration below. Use the actual absolute location of your kimi executable as the command.

{
  "agent_servers": {
    "Kimi Code CLI": {
      "command": "/Users/you/.local/bin/kimi",
      "args": ["acp"],
      "env": {}
    }
  }
}

Zsh shortcut

Moonshot AI’s zsh-kimi-cli plugin provides a Ctrl-X shortcut to open Kimi Code CLI from Zsh. For Oh My Zsh, clone the plugin into the custom plugin directory and enable kimi-cli in ~/.zshrc.

git clone https://github.com/MoonshotAI/zsh-kimi-cli.git \
  ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/kimi-cli
plugins=(... kimi-cli)

Providers, MCP, Skills, and Plugins

Kimi Code CLI uses the current model provider for reasoning and its local tools for reading files, applying edits, and executing commands. The provider configuration can include Moonshot AI, Anthropic, OpenAI-compatible APIs, Google GenAI, and Vertex AI. Manage providers with /provider or the CLI’s kimi provider commands. Provider settings are stored in ~/.kimi-code/config.toml, with credentials optionally read from environment variables.

kimi provider list
kimi provider catalog list
kimi provider catalog add anthropic --api-key YOUR_API_KEY

MCP servers

MCP connections let Kimi use external services during a coding session. Open /mcp-config to register a server or complete its OAuth login, then use /mcp to inspect connection status. Once a server is configured, its tools can participate in tasks where repository files alone are insufficient.

Agent Skills and reusable instructions

A Skill is a directory containing a SKILL.md file with reusable instructions for a task. Kimi discovers Skills from the user folders ~/.kimi-code/skills/ and ~/.agents/skills/, project folders .kimi-code/skills/ and .agents/skills/, plus configured extra and built-in locations. Invoke a project Skill with /skill:skill-name. A plugin Skill uses /skill:plugin-id:skill-name starting in v2.3.0.

The CLI also ships built-in Skills for common maintenance tasks. Their commands are available directly from the terminal input when the agent is idle.

Built-in skill commandWhat it does
/mcp-configConfigures MCP servers and handles MCP OAuth login.
/custom-themeCreates or edits a TUI color theme.
/update-configInspects or edits runtime and TUI configuration.
/check-kimi-code-docsAnswers Kimi Code product questions against the official documentation.
/import-from-cc-codexImports Claude Code and Codex instructions, Skills, and MCP settings.
/sub-skillReviews or reorganizes local Skills into sub-skill bundles.

Plugins

Plugins package Skills, custom agents, MCP server definitions, hooks, and slash commands in a kimi.plugin.json manifest. Open /plugins to install or manage packages from the built-in catalog or other repositories. Plugin-related MCP configuration changes become active after /reload or a new session.

Subagents, Swarm, and Tower Mode

A subagent takes on focused work with its own conversation context, such as exploring an unfamiliar module or reviewing a code change.

Swarm mode coordinates multiple agents within an interactive session. Activate it with /swarm on or pass an objective to /swarm <task>.

Experimental Tower collaboration

Tower mode is designed for parallel development in a Git repository. It assigns missions to agents working in their own branches and Git worktrees, requests independent reviews, and merges approved results into the designated local branch. The coordinator can accept changes to the objective while workers are active. This is an experimental feature, activated in /experiments or with the setting below. Restart the CLI after enabling it, then use /tower on in the repository.

[experimental]
tower = true

Remote Control

Remote Control keeps the agent running on your computer and makes its sessions available from a phone or another browser. Run kimi rc to display a URL and QR code, sign in on the other device with your Kimi account, and continue the conversation or respond to approval requests. Remote Control requires a paid Kimi membership, and the original computer needs to stay awake and online.

kimi rc

Migrating from the Earlier Kimi CLI

Kimi Code CLI is the current TypeScript-based project. The earlier Python-based Kimi CLI stored its local data under ~/.kimi/. On first launch, the new CLI can detect that directory and offer to bring over configuration, MCP server entries, input history, and selected chat sessions. Run kimi migrate to open the migration flow later.

OAuth credentials, MCP authorizations, and old plugins need to be set up again. The migration leaves the original ~/.kimi/ directory intact, and the newer CLI keeps its state under ~/.kimi-code/.

AspectKimi Code CLILegacy Kimi CLI
StatusCurrent projectLegacy project with maintenance winding down
ImplementationTypeScript and Node.jsPython and uv
Local data~/.kimi-code/~/.kimi/
MigrationImports selected legacy data with kimi migrateProvides data from ~/.kimi/

More Kimi Code CLI Commands

Command or optionWhat it does
kimi --helpShows command help.
kimi -p "TEXT" --output-format stream-jsonReturns non-interactive output as JSON lines.
kimi --model NAMEOverrides the model for the current run.
kimi --add-dir PATHAdds another directory to the workspace scope.
kimi --session [ID]Opens the session picker or resumes a specified session.
kimi --yoloStarts in Ask When Needed mode for routine tool approvals.
kimi --autoStarts in Never Ask mode for autonomous execution.
kimi --planStarts in Plan mode for read-only exploration and planning.
kimi --skills-dir PATHLoads Skills from the specified directory for that run in place of auto-discovered Skill directories.
kimi loginStarts non-interactive Kimi Code OAuth login.
kimi rcStarts paid-member Remote Control for the local agent.
kimi app [PATH]Opens a new desktop chat in the selected project directory.
kimi install-desktopOpens the Kimi Code desktop download page.
kimi doctorValidates configuration files without starting the TUI.
kimi exportExports a session as a ZIP file.
kimi migrateMigrates local data from the legacy kimi-cli installation.
kimi vis [sessionId]Opens the session visualizer in a browser.
kimi providerManages providers and model catalogs.

Interactive Slash Commands

Slash commandWhat it does
/helpShows shortcuts and available commands.
/loginSigns in with Kimi Code OAuth or a Kimi Platform API key.
/logoutClears credentials for the selected account.
/providerOpens the provider manager.
/modelSelects a model and offers session handling when switching.
/settingsOpens the TUI settings panel.
/permissionSelects a permission mode.
/newStarts a fresh session.
/sessionsBrowses and restores historical sessions.
/tasksOpens the background task list.
/forkForks a new session while preserving history.
/compactCompacts the current context.
/reloadReloads the current session with updated configuration.
/initAnalyzes the codebase and generates AGENTS.md.
/add-dirAdds another workspace directory to the current session.
/webOpens the current session in the web UI.
/remote-controlStarts a browser-accessible remote session.
/desktopOpens the desktop app download page.
/swarm onEnables multi-agent swarm mode for interactive sessions.
/yoloOpens Ask When Needed permission mode.
/autoOpens Never Ask permission mode.
/planToggles Plan mode.
/goalStarts or manages an autonomous goal.
/usageShows token, context, and quota usage.
/statusShows the current session runtime state.
/mcpLists MCP server connection status.
/mcp-configConfigures MCP servers and handles MCP OAuth.
/pluginsOpens the plugin manager.
/skill:<name>Loads an external Skill; plugin Skills require a qualified name.

Kimi Code CLI vs. Claude Code or Cursor

ProductPrimary workflowMain distinction
Kimi Code CLITerminal, browser UI, and ACP editor sessionsMIT-licensed terminal agent with Kimi model selection, ACP, MCP, Skills, and plugins.
Claude CodeTerminal coding agentAnthropic’s first-party coding agent for Claude workflows.
CursorAI coding editorEditor-centered development environment with integrated coding-agent features.
Gemini CLITerminal coding agentGoogle’s Gemini-focused command-line coding agent.
Qwen CodeTerminal coding agentCommand-line coding agent for the Qwen ecosystem.

Pros

  • MIT-licensed CLI with source code available on GitHub.
  • Terminal sessions, browser access, and ACP editor integration.
  • Flexible provider configuration, MCP servers, Skills, and plugins.
  • Session controls and options for delegated coding work.

Cons

  • Coding models require a Kimi membership or configured API credentials.
  • Never Ask and experimental Tower modes can execute commands without individual approval.

FAQs

Is Kimi Code CLI free?

The CLI is free to install and is available under the MIT license. For model-backed coding sessions, use Kimi Code OAuth with a membership, a Kimi Open Platform API key, or credentials for a configured third-party provider. Model usage follows the account or provider’s billing rules.

Does Kimi Code CLI require an API key?

Kimi Code OAuth authorizes a membership through browser sign-in and does not require manually entering an API key. The Kimi Open Platform and third-party providers use API credentials.

Does Kimi Code CLI work on Windows?

Yes. Install the CLI from PowerShell and install Git for Windows to provide the Git Bash environment used by Kimi’s shell commands.

Can I use K3.1 Pro in an existing K3 coding session?

The model picker can change models during a session, but opening a fresh session is recommended for K3.1 Pro. Earlier model reasoning history can affect responses, and model switches invalidate the context cache.

Alternatives & Related Resources

Last updated: October 26, 2026

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest & top AI tools sent directly to your email.

Subscribe now to explore the latest & top AI tools and resources, all in one convenient newsletter. No spam, we promise!