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

An open-source CLI AI coding agent with Kimi access, MCP, providers, skills, plugins, subagents, and browser UI.

Kimi Code CLI is a free, open-source AI coding agent that runs directly in your terminal.

It can read and edit code, run shell commands, search files, fetch web pages, connect to MCP servers, manage sessions, and work through interactive CLI, browser UI, and ACP editor modes.

See Kimi API Pricing here.

This coding agent is useful if you want a terminal-first coding assistant with Kimi K2 models, API-key provider configuration, Agent Skills, plugins, subagents, lifecycle hooks, and local project context.

Features

  • Runs as an interactive terminal agent through the kimi command.
  • Opens a local browser interface through the kimi web command.
  • Runs as an ACP agent server through the kimi acp command.
  • Reads and edits project files inside the configured workspace.
  • Executes shell commands with approval controls.
  • Searches and fetches web pages when the selected provider supports those services.
  • Supports MCP servers through managed commands and ad-hoc config files.
  • Supports Agent Skills from user, project, extra, and built-in skill directories.
  • Supports beta plugins that expose executable local tools.
  • Supports subagents for focused planning, exploration, and coding tasks.
  • Supports lifecycle hooks for approval, auditing, notification, and local automation steps.
  • Supports video input when the selected model declares that capability.
  • Supports plan mode for read-only codebase exploration before implementation.
  • Supports session resume, fork, export, import, title, and undo workflows.
  • Supports image input and video input when the selected model declares those capabilities.
  • Supports Kimi, OpenAI Chat Completions, OpenAI Responses, Anthropic, Gemini, and Vertex AI provider types.
  • Supports kimi vis for agent trace inspection in a browser.
  • Supports Zsh integration through the zsh-kimi-cli plugin.

Use Cases

  • Multi-File Refactoring Projects: When you need to refactor code across multiple files, Kimi CLI can plan the changes and apply patches file by file. You maintain visibility of what’s changing while the agent handles the mechanical work of updating each location.
  • Debugging Complex Issues: The tool excels at analyzing error messages, examining stack traces, and suggesting fixes. The /debug command shows you exactly what context the agent has, helping you understand its reasoning process.
  • Terminal Workflow Automation: Developers who spend significant time in the terminal can keep Kimi CLI running and switch to agent mode whenever they hit a snag. No need to context-switch to a browser or separate application.
  • Planning Before Execution: Ask for a detailed plan before implementing changes. The agent can outline the approach, identify potential issues, and get your approval before touching any code. This “plan-then-edit” workflow reduces mistakes.
  • Tool-Assisted Development: Connect MCP servers for linters, search capabilities, or filesystem operations. The agent can request these tools, analyze their output, and make decisions based on the results.

How to Use It

Installation

1. Install Kimi Code CLI on Linux or macOS with the install script.

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

2. Install Kimi Code CLI on Windows from PowerShell.

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

3. Install with npm if you prefer the package manager route.

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

4. Verify the installation.

kimi --version

5. Start Kimi Code CLI from a project directory.

cd your-project
kimi

6. Configure model access inside Kimi Code CLI.

/login

The login flow supports Kimi Code OAuth and Moonshot AI Open Platform API keys. Other provider types can be configured through /provider, kimi provider, environment variables, or the config file.

7. Generate project instructions if the repository does not already include an AGENTS.md file.

/init

8. Use natural language in the terminal.

Explain the authentication flow in this repository.

9. Press Ctrl-X to switch shell command mode.

Kimi Code CLI can work as a shell command surface. Review permission prompts carefully before you allow file edits, shell commands, or network-facing actions.

10. Open the browser UI when you want a graphical session view.

kimi web

11. Upgrade to the latest version.

kimi upgrade

12. Uninstall Kimi Code CLI if you installed it through npm.

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

Kimi Code CLI commands

Command or optionWhat it does
kimiStarts the interactive terminal agent.
kimi --versionShows the installed version.
kimi --helpShows command help.
kimi -p "TEXT"Runs a single prompt in print mode.
kimi --output-format jsonReturns print-mode output as JSON.
kimi --model NAMEOverrides the configured model for the current run.
kimi --work-dir PATHSets the working directory.
kimi --add-dir PATHAdds another directory to the workspace scope.
kimi --continueContinues the previous session in the current working directory.
kimi --session [ID]Resumes a session or opens the session picker.
kimi --resume [ID]Alias for session resume.
kimi --planStarts or resumes in plan mode.
kimi --autoStarts with automatic permission mode.
kimi --thinkingEnables thinking mode.
kimi --no-thinkingDisables thinking mode.
kimi --skills-dir PATHAdds a skills directory.
kimi loginStarts account login.
kimi logoutClears stored credentials.
kimi providerAdds, lists, removes, and imports provider definitions.
kimi acpStarts the ACP server.
kimi mcpManages MCP server configuration.
kimi exportExports session data as a ZIP file.
kimi upgradeChecks for and installs a Kimi Code CLI upgrade.
kimi migrateRuns migration tasks for older Kimi CLI data.
kimi visOpens the agent tracing visualizer.
kimi webStarts the browser UI server.

Slash commands

Slash commandWhat it does
/helpShows help, shortcuts, commands, and loaded skills.
/loginConfigures Kimi Code or API platform access.
/logoutLogs out and reloads configuration.
/providerManages AI provider connections and model catalog imports.
/modelSwitches model and thinking mode.
/editorSets an external editor for input editing.
/themeSwitches dark or light terminal theme.
/reloadReloads the config file.
/debugShows message, token, checkpoint, and context details.
/usageShows usage and quota information for Kimi Code.
/mcpShows connected MCP servers and loaded tools.
/mcp-configAdds, edits, and authenticates MCP servers from the TUI.
/hooksShows configured hooks.
/pluginsOpens the plugin manager.
/newCreates a new session.
/sessionsOpens the session picker.
/titleViews or sets the session title.
/undoWithdraws the last prompt from conversation history.
/forkForks a new session from the current one.
/exportExports the current session.
/export-mdExports the current session as Markdown.
/export-debug-zipExports a debug ZIP for diagnostics.
/importImports context from a file or session.
/clearClears the current session context.
/compactCompacts the context manually.
/skill:<name>Loads an Agent Skill.
/flow:<name>Executes a flow skill.
/add-dirAdds another workspace directory.
/btwAsks a side question during a session.
/initAnalyzes the project and generates AGENTS.md.
/planToggles plan mode.
/goalStarts or manages an experimental long-running task goal.
/taskOpens the background task browser.
/autoToggles automatic permission mode.
/afkToggles unattended automatic approval.
/webSwitches the current session to Web UI.
/visOpens the current session in the tracing visualizer.

Provider management

You can manage model providers without launching the terminal UI. The kimi provider command can add, list, remove, and import providers from a custom registry file or the public models.dev catalog.

kimi provider list
kimi provider catalog list
kimi provider catalog add PROVIDER_NAME

MCP setup

Kimi Code CLI can manage MCP servers directly.

Add an HTTP MCP server.

kimi mcp add --transport http context7 https://mcp.context7.com/mcp

Add an HTTP MCP server with a header.

kimi mcp add --transport http context7 https://mcp.context7.com/mcp \
  --header "CONTEXT7_API_KEY: your-key"

Add an HTTP MCP server with OAuth.

kimi mcp add --transport http --auth oauth linear https://mcp.linear.app/mcp

Add a stdio MCP server.

kimi mcp add --transport stdio chrome-devtools -- npx chrome-devtools-mcp@latest

List configured MCP servers.

kimi mcp list

Authorize an OAuth MCP server.

kimi mcp auth linear

Test an MCP server.

kimi mcp test context7

Remove an MCP server.

kimi mcp remove context7

Kimi Code CLI stores MCP configuration in ~/.kimi-code/mcp.json. OAuth credentials for MCP servers are stored under ~/.kimi-code/mcp-oauth/.

IDE and Zsh integration

Kimi Code CLI can run inside ACP-compatible editors.

Use this configuration for Zed.

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

Use this configuration for JetBrains IDEs.

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

Kimi Code CLI also supports Zsh through the zsh-kimi-cli plugin.

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

Add kimi-cli to the plugin list in ~/.zshrc.

plugins=(... kimi-cli)

Restart Zsh, then press Ctrl-X to switch to agent mode.

Agent Skills and plugins

Kimi Code CLI supports Agent Skills through SKILL.md files. Skills can live at user level, project level, extra skill directories, or built-in package directories.

User-level skill paths include:

~/.kimi-code/skills/
~/.claude/skills/
~/.codex/skills/
~/.config/agents/skills/
~/.agents/skills/

Project-level skill paths include:

.kimi-code/skills/
.claude/skills/
.codex/skills/
.agents/skills/

The CLI includes two built-in skills:

Built-in skillWhat it does
kimi-cli-helpAnswers questions about Kimi Code CLI installation, configuration, commands, shortcuts, MCP, providers, and environment variables.
skill-creatorGuides users through creating or updating Agent Skills.

Kimi Code CLI also supports plugins. Plugins use a plugin.json file to expose executable local tools, and the TUI plugin manager shows plugin state and trust information.

Install a plugin from a local directory.

kimi plugin install /path/to/my-plugin

Install a plugin from a ZIP file.

kimi plugin install my-plugin.zip

Install a plugin from a remote ZIP URL.

kimi plugin install https://example.com/my-plugin.zip

Install a plugin from a Git repository.

kimi plugin install https://github.com/user/repo.git

Install a plugin from a repository subdirectory.

kimi plugin install https://github.com/user/repo.git/plugins/my-plugin

List installed plugins.

kimi plugin list

View plugin details.

kimi plugin info my-plugin

Remove a plugin.

kimi plugin remove my-plugin

Kimi Code CLI vs. Claude Code or Cursor

ToolBest fitMain difference
Kimi Code CLIDevelopers who want an open-source terminal agent with Kimi Code, ACP, MCP, skills, plugins, subagents, and browser UI.It runs as an MIT-licensed CLI and supports multiple provider types.
Claude CodeDevelopers who already use Anthropic’s coding agent in the terminal.It is a first-party Anthropic tool built around Claude workflows.
CursorDevelopers who want an AI coding IDE.It is editor-first, while Kimi Code CLI is terminal-first.
Gemini CLIDevelopers who want a Google Gemini terminal agent.It focuses on Gemini model access and Google’s CLI workflow.
Qwen Code CLIDevelopers who want a Qwen3-Coder terminal agent.It is optimized for Qwen coding models.

Pros

  • Terminal-first workflow.
  • Browser UI available.
  • ACP editor support.
  • MCP server management.
  • Agent Skills support.
  • Plugin system beta.
  • Multi-provider configuration.
  • Subagents, lifecycle hooks, and video input support.
  • Built-in upgrade command and background upgrade option.
  • Active release cadence.

Cons

  • Model access required.
  • Terminal comfort required.
  • Automatic permission and AFK modes need caution.

Alternatives

Related Resources

FAQs

Q: Is Kimi Code CLI free?
A: Kimi Code CLI is open-source under the MIT license. You still need Kimi Code access, a Moonshot AI Open Platform API key, or another configured provider to run model-backed agent sessions.

Q: Does Kimi Code CLI require an API key?
A: Kimi Code CLI can use Kimi Code OAuth through /login. Moonshot AI Open Platform access uses an API key, and other providers can be managed with /provider, kimi provider, environment variables, or ~/.kimi-code/config.toml.

Q: What are Agent Skills in Kimi Code CLI?
A: Agent Skills are SKILL.md directories that give Kimi Code CLI reusable instructions, project standards, workflows, and task-specific guidance. Kimi Code CLI can load skills from user, project, extra, and built-in locations, including ~/.kimi-code/skills/ and .kimi-code/skills/.

Q: What are Kimi Code CLI plugins?
A: Kimi Code CLI plugins are local tool packages defined by plugin.json. A plugin can expose executable scripts to the agent, which makes plugins useful for project-specific tools and internal automation.

Changelog

June 03, 2026

@moonshot-ai/kimi-code 0.8.0

  • Adds automatic background upgrades and a manual kimi upgrade command.
  • Adds experimental /goal mode for longer tasks that need persistent progress across turns.
  • Adds kimi provider for managing model providers from the shell.
  • Adds background structured questions and approval lifecycle hook events.

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!