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
kimicommand. - Opens a local browser interface through the
kimi webcommand. - Runs as an ACP agent server through the
kimi acpcommand. - 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 visfor agent trace inspection in a browser. - Supports Zsh integration through the
zsh-kimi-cliplugin.
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
/debugcommand 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
Table Of Contents
Installation
1. Install Kimi Code CLI on Linux or macOS with the install script.
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash2. Install Kimi Code CLI on Windows from PowerShell.
irm https://code.kimi.com/kimi-code/install.ps1 | iex3. Install with npm if you prefer the package manager route.
npm install -g @moonshot-ai/kimi-code4. Verify the installation.
kimi --version5. Start Kimi Code CLI from a project directory.
cd your-project
kimi6. Configure model access inside Kimi Code CLI.
/loginThe 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.
/init8. 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 web11. Upgrade to the latest version.
kimi upgrade12. Uninstall Kimi Code CLI if you installed it through npm.
npm uninstall -g @moonshot-ai/kimi-codeKimi Code CLI commands
| Command or option | What it does |
|---|---|
kimi | Starts the interactive terminal agent. |
kimi --version | Shows the installed version. |
kimi --help | Shows command help. |
kimi -p "TEXT" | Runs a single prompt in print mode. |
kimi --output-format json | Returns print-mode output as JSON. |
kimi --model NAME | Overrides the configured model for the current run. |
kimi --work-dir PATH | Sets the working directory. |
kimi --add-dir PATH | Adds another directory to the workspace scope. |
kimi --continue | Continues 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 --plan | Starts or resumes in plan mode. |
kimi --auto | Starts with automatic permission mode. |
kimi --thinking | Enables thinking mode. |
kimi --no-thinking | Disables thinking mode. |
kimi --skills-dir PATH | Adds a skills directory. |
kimi login | Starts account login. |
kimi logout | Clears stored credentials. |
kimi provider | Adds, lists, removes, and imports provider definitions. |
kimi acp | Starts the ACP server. |
kimi mcp | Manages MCP server configuration. |
kimi export | Exports session data as a ZIP file. |
kimi upgrade | Checks for and installs a Kimi Code CLI upgrade. |
kimi migrate | Runs migration tasks for older Kimi CLI data. |
kimi vis | Opens the agent tracing visualizer. |
kimi web | Starts the browser UI server. |
Slash commands
| Slash command | What it does |
|---|---|
/help | Shows help, shortcuts, commands, and loaded skills. |
/login | Configures Kimi Code or API platform access. |
/logout | Logs out and reloads configuration. |
/provider | Manages AI provider connections and model catalog imports. |
/model | Switches model and thinking mode. |
/editor | Sets an external editor for input editing. |
/theme | Switches dark or light terminal theme. |
/reload | Reloads the config file. |
/debug | Shows message, token, checkpoint, and context details. |
/usage | Shows usage and quota information for Kimi Code. |
/mcp | Shows connected MCP servers and loaded tools. |
/mcp-config | Adds, edits, and authenticates MCP servers from the TUI. |
/hooks | Shows configured hooks. |
/plugins | Opens the plugin manager. |
/new | Creates a new session. |
/sessions | Opens the session picker. |
/title | Views or sets the session title. |
/undo | Withdraws the last prompt from conversation history. |
/fork | Forks a new session from the current one. |
/export | Exports the current session. |
/export-md | Exports the current session as Markdown. |
/export-debug-zip | Exports a debug ZIP for diagnostics. |
/import | Imports context from a file or session. |
/clear | Clears the current session context. |
/compact | Compacts the context manually. |
/skill:<name> | Loads an Agent Skill. |
/flow:<name> | Executes a flow skill. |
/add-dir | Adds another workspace directory. |
/btw | Asks a side question during a session. |
/init | Analyzes the project and generates AGENTS.md. |
/plan | Toggles plan mode. |
/goal | Starts or manages an experimental long-running task goal. |
/task | Opens the background task browser. |
/auto | Toggles automatic permission mode. |
/afk | Toggles unattended automatic approval. |
/web | Switches the current session to Web UI. |
/vis | Opens 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 listkimi provider catalog listkimi provider catalog add PROVIDER_NAMEMCP setup
Kimi Code CLI can manage MCP servers directly.
Add an HTTP MCP server.
kimi mcp add --transport http context7 https://mcp.context7.com/mcpAdd 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/mcpAdd a stdio MCP server.
kimi mcp add --transport stdio chrome-devtools -- npx chrome-devtools-mcp@latestList configured MCP servers.
kimi mcp listAuthorize an OAuth MCP server.
kimi mcp auth linearTest an MCP server.
kimi mcp test context7Remove an MCP server.
kimi mcp remove context7Kimi 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-cliAdd 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 skill | What it does |
|---|---|
kimi-cli-help | Answers questions about Kimi Code CLI installation, configuration, commands, shortcuts, MCP, providers, and environment variables. |
skill-creator | Guides 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-pluginInstall a plugin from a ZIP file.
kimi plugin install my-plugin.zipInstall a plugin from a remote ZIP URL.
kimi plugin install https://example.com/my-plugin.zipInstall a plugin from a Git repository.
kimi plugin install https://github.com/user/repo.gitInstall a plugin from a repository subdirectory.
kimi plugin install https://github.com/user/repo.git/plugins/my-pluginList installed plugins.
kimi plugin listView plugin details.
kimi plugin info my-pluginRemove a plugin.
kimi plugin remove my-pluginKimi Code CLI vs. Claude Code or Cursor
| Tool | Best fit | Main difference |
|---|---|---|
| Kimi Code CLI | Developers 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 Code | Developers who already use Anthropic’s coding agent in the terminal. | It is a first-party Anthropic tool built around Claude workflows. |
| Cursor | Developers who want an AI coding IDE. | It is editor-first, while Kimi Code CLI is terminal-first. |
| Gemini CLI | Developers who want a Google Gemini terminal agent. | It focuses on Gemini model access and Google’s CLI workflow. |
| Qwen Code CLI | Developers 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
- Best CLI AI Coding Agents: Compare Kimi Code CLI with other popular AI coding agents.
- AI Coding Agents: Discover more free & open-source AI coding agents.
- Claude Code: Browse Claude Code tools, plugins, skills, and guides.
- Claude Code Resource List: Explore Claude Code agents, skills, plugins, utilities, and alternatives.
Related Resources
- Kimi Code CLI documentation: Read the official installation, configuration, command, and reference documentation.
- MCP Servers directory: Find MCP servers to connect with Kimi Code CLI.
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 upgradecommand. - Adds experimental
/goalmode for longer tasks that need persistent progress across turns. - Adds
kimi providerfor managing model providers from the shell. - Adds background structured questions and approval lifecycle hook events.










