Getting started with Kimi Code

Kimi Code CLI is an AI Agent that runs in your terminal, helping you complete software development tasks and terminal operations. It can read and edit code, execute Shell commands, search and scrape the web, and autonomously plan and adjust its actions during execution.

Use cases

  • Write and Modify Code: Implementing new features, fixing bugs, and refactoring code.
  • Understand Projects: Exploring unfamiliar codebases and answering questions about architecture and implementation.
  • Automate Tasks: Batch processing files, executing builds and tests, and running scripts.

If you have any issues suggestions, provide feedback on GitHub Issues

Ways to use

MethodCommandDescription
Interactive TerminalkimiChat with the AI in your terminal — ideal for daily development
Browser Interfacekimi webOpen an interactive UI in your browser
Agent Integrationkimi acpIntegrate into your IDE via the ACP protocol

Installation

Run the installation script to complete the setup. The script will first install uv and then install Kimi Code CLI via uv:

screenshot 23
Bash

After installation, verify that it was installed successfully:

Bash

If the kimi command is not found, try reopening your terminal or running source ~/.bashrc (or ~/.zshrc).

First run

Startup and login

Navigate to your project directory:

Bash

Run the /login command to complete authorization:

Text

The system will prompt you to select a login method — follow the instructions to complete authorization.

Core Capabilities

You can interact with Kimi Code CLI using natural language:

Ask Questions: Understand project architecture and entry points.

Modify Code: Let Kimi write features or fix bugs with your approval.

Run Commands: Execute tests and automate terminal tasks.

Common Commands Cheat Sheet

CommandDescription
kimiStart interactive dialogue
kimi webOpen browser graphical interface
/loginConfigure or switch API sources
/usageCheck remaining balance and quota
/helpView all commands and shortcuts
Ctrl-JNew line (do not submit)
Ctrl-C / Ctrl-DInterrupt current operation / Exit

FAQ

I entered my API Key, but it says authentication failed.

First, confirm that your Key and Base URL belong to the same platform. api.kimi.com and api.moonshot.cn are two completely independent account systems, and their API Keys are not interchangeable:

The kimi command is not found after installation.

The installation script adds kimi to your PATH, but you need to restart the terminal or run source ~/.bashrc (or source ~/.bashrc) for it to take effect. If it's still not found, check if ~/.local/bin is in your PATH.

The browser did not pop up after running /login.

In a remote server or headless environment, /login will display a URL. Manually copy it into your browser to complete the authorization.

Upgrade and uninstallation

Upgrade to the latest version:

Bash

Uninstall Kimi Code CLI:

Bash