Kimi Code CLI Windows installation tutorial: login, MCP, ACP and migration from old Kimi CLI

Describes the installation of Kimi Code CLI on Windows, first login, MCP and ACP usage, as well as legacy Kimi CLI configuration and session migration considerations.

Moonshot AI is migrating the legacy Kimi CLI to the new generation Kimi Code CLI. The new version is a terminal AI programming Agent that can read and modify code, run Shell, search for files, access web pages, and supports MCP, plug-ins, sub-Agents, Hooks and ACP editor access.

Project address: MoonshotAI/kimi-code

Windows Quick Installation

Install Git for Windows first. Kimi Code CLI uses Git Bash as the shell environment on Windows, and then executes the official installation script in PowerShell:

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

Close and reopen the terminal to check the version:

1
kimi --version

If Git Bash is installed in a custom directory, you need to set KIMI_SHELL_PATH to the absolute path of bash.exe.

Log in and run for the first time

Start after entering the project directory:

1
2
cd C:\Work\your-project
kimi

When running for the first time, enter /login in the interactive interface, and you can choose Kimi Code OAuth or Moonshot AI open platform API Key. After logging in, first use the read-only task to verify:

1
读取这个项目,说明主要目录和启动入口,不要修改文件。

After confirming that the path identification is correct, give it the task of small-scale modification.

How to migrate the old Kimi CLI

Official instructions indicate that installing Kimi Code CLI will automatically migrate old configurations and sessions, and the old repository will gradually cease maintenance. Before migration, it is still recommended to back up the original configuration directory and record the custom Provider, MCP Server and workspace paths.

Key checks after migration:

  1. Whether kimi --version points to the new version;
  2. Whether the /login status is valid;
  3. Whether the MCP service can still be connected;
  4. Whether the old session can be opened;
  5. Are the Git Bash and project paths correct?

What is the difference between MCP and ACP

MCP is used to add external tools and data sources to Agent. The new version can be configured conversationally through /mcp-config. ACP allows editors such as Zed and JetBrains to directly launch Kimi Code CLI sessions.

The ACP service commands are:

1
kimi acp

/login should be completed once in the terminal before using ACP. The editor configuration is only responsible for starting the process and should not write the API Key in plain text into the project repository.

How to check before executing the installation script

PowerShell’s irm ... | iex will directly execute the network return content. A safer approach is to open the installation script in a browser or download it and check it before running it. Highlights:

  • Whether the download source is code.kimi.com;
  • Which directory should the binary be installed to?
  • How to modify PATH;
  • Whether to write Shell configuration;
  • Upgrade and uninstall methods;
  • Whether to require administrator privileges.

Corporate computers also need to confirm endpoint security policies, agents, and Git for Windows installation sources. Do not temporarily turn off system protection in order to install it.

What should you do when entering the project for the first time?

Start with read-only tasks first, don’t directly ask to “fix everything”. Recommended steps:

  1. Run kimi in the root directory of the Git repository;
  2. Let it only read the directory structure and project description;
  3. Confirm the working directory it identifies;
  4. Ask to list the files to be read;
  5. Give it a small, verifiable change;
  6. Review git diff and the test results when completed.

A good first modification task is to fix documentation links, add unit tests, or tweak individual components. Dependency upgrades, database migrations, and global formats are not suitable for first verification.

How to choose the login method

Kimi Code OAuth

Suitable for personal interactive use and simple configuration. Pay attention to whether account subscriptions, call quotas, and organizational policies cover CLI usage.

Moonshot AI API Key

Suitable for scenarios that require independent billing, automation or team management. Key should be placed in user configuration or security environment variables, and should not be submitted to the repository.

Either way, an actual request should be performed after migration. Just because the interface displays “Logged in” does not mean that the model, region, and quota are definitely available.

MCP configuration and verification

The new version mainly recommends managing MCP through /mcp-config, while the old Kimi CLI also provides kimi mcp commands. Don’t mix two sets of documents when migrating users; first use kimi --version to confirm the current product, and then check the corresponding version help.

Follow this order when adding MCP Server:

  1. Read the Server repository and permission description;
  2. Install in the test project first;
  3. Do not transfer the real production Token;
  4. View the list of tools it exposes;
  5. Execute a read-only call;
  6. Confirm that the log will not output credentials;
  7. Finally, the writing tools are opened.

MCP can expand Agent capabilities and also expand the attack surface. Files, browsers, databases, and cloud platform servers should not default to the same level of trust.

Using ACP with Zed or JetBrains

ACP lets the editor launch the Kimi Code CLI via standard input and output. Taking Zed as an example, the configuration structure is as follows:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  "agent_servers": {
    "Kimi Code CLI": {
      "type": "custom",
      "command": "kimi",
      "args": ["acp"],
      "env": {}
    }
  }
}

If the editor prompts that the process startup failed, first execute in the terminal of the same user environment:

1
kimi acp

Common reasons include the editor not inheriting the latest PATH, kimi being installed in a different user directory, Git Bash not being found, or /login not being completed yet.

What scenarios are video input suitable for?

Kimi Code CLI supports taking screen recordings or demo videos as input. It’s suitable for explaining UI behaviors that are difficult to describe in words, such as animation rhythms, replication steps, and reference effects.

Crop the video before use to avoid uploading account information, notifications, tokens, customer data and irrelevant desktop areas. The fact that the Agent can “understand the video” does not mean that it can automatically access the system that appears in the video. Actual modifications are still limited by the current workspace and tool permissions.

How to safely enable sub-Agents and Hooks

The built-in coder, explore and plan sub-agents can separate contexts, but multiple agents may still operate the same workspace. The task should specify:

  • explore read only;
  • plan does not write files;
  • coder only modifies the specified directory;
  • Deletion, installation and Git push must be confirmed;
  • Once completed, view the differences uniformly from the main session.

Lifecycle Hooks can be used to block high-risk commands, log tool calls, and send notifications. The Hook configuration itself is also an executable boundary and must be reviewed before installing third-party Hooks.

Legacy migration checklist

Project Inspection Method
Executable file kimi --version
Shell Confirm Git Bash with KIMI_SHELL_PATH
Login Check and execute a request after startup
Sessions Open an old session to confirm content
MCP View Server and Tool List
Provider Check API address, model and Key
Editor Retest kimi acp
Hooks Confirm old configuration is not duplicated or invalid

How to reduce risks when updating

CLI updates may change permission prompts, plugin interfaces, and configuration formats. Back up the configuration before upgrading and check the Release and migration instructions; after upgrading, first perform read-only tasks in the test repository. If the team relies on fixed workflows, don’t have all members automatically upgrade at different times.

Troubleshooting order

Phenomenon Priority Check
kimi not found New terminal, PATH, install user
Bash not found Git for Windows, KIMI_SHELL_PATH
Login successful but unable to request Quota, region, provider and model
MCP Unavailable Current Version, Server Startup and Certification
ACP startup failed Editor environment variables and kimi acp
Old sessions gone Migrating directories and backups
Command approval exception Hooks, permission settings and project strategies

Windows FAQ

Prompt cannot find kimi

First open a new terminal, and then check whether PATH has been added to the installation directory. Do not execute the installation script repeatedly in the old window.

Prompt that Bash cannot be found

Confirm that Git for Windows is installed and check KIMI_SHELL_PATH. The path should point to the real bash.exe, not the Git GUI or git.exe.

What should Agent do if he wants to execute dangerous commands?

Do not authorize the entire session at once. Check the command, working directory and target path first; confirm separately when deleting, overwriting, pushing or installing global software. The new version supports life cycle Hooks, which can further intercept high-risk tool calls.

Can I keep the old Kimi CLI after installing the new version?

The two may share command names and configurations. The official direction is to migrate to Kimi Code CLI; when you need to roll back, you should rely on the pre-migration backup and official uninstall instructions. It is not recommended to rely on the PATH sequence to try your luck after long-term coexistence.

Why can it run in PowerShell but not in the editor?

The editor is usually started before installation without reading updated user environment variables. Exit completely and reopen the editor, confirming the account and terminal environment it is using.

Summary

The key to installing Kimi Code CLI on Windows is to prepare Git Bash first, and then complete /login and read-only verification. Old Kimi CLI users should migrate as early as possible, but don’t just look at “installation successful” but also check session, MCP, provider and project paths item by item.