ScriptsJul 21, 2026·3 min read

Kimi CLI — AI Coding Agent for the Terminal by MoonshotAI

An open-source command-line coding agent from MoonshotAI that uses Kimi models to understand codebases, write code, and execute shell commands directly in the terminal.

Agent ready

Safe staging for this asset

This asset is staged first. The copied prompt tells the agent to inspect the staged files and ask before activating scripts, MCP config, or global config.

Stage only · 29/100Policy: stage
Agent surface
Any MCP/CLI agent
Kind
CLI Tool
Install
Single
Trust
Trust: Established
Entrypoint
Kimi CLI Overview
Safe staging command
npx -y tokrepo@latest install ce30f936-84c1-11f1-9bc6-00163e2b0d79 --target codex

Stages files first; activation requires review of the staged README and plan.

Introduction

Kimi CLI is an open-source terminal-based coding agent developed by MoonshotAI. It connects to Kimi language models to perform code editing, file management, and shell operations within your existing development environment. The agent reads your codebase context and executes multi-step coding tasks conversationally.

What Kimi CLI Does

  • Accepts natural language instructions to modify code in your repository
  • Reads and understands project structure and file contents for context-aware edits
  • Executes shell commands and interprets their output within the agent loop
  • Supports multi-turn conversations for iterative code refinement
  • Creates, edits, and deletes files based on task requirements

Architecture Overview

Kimi CLI runs as a Node.js process in your terminal. It scans the working directory to build a file tree and sends relevant context along with your prompt to Kimi's API. The model responds with a plan of file edits and shell commands. The CLI applies edits to disk and executes commands, feeding results back to the model for the next step. A permission system gates destructive operations.

Self-Hosting & Configuration

  • Install globally via npm or use npx for one-off runs
  • Authenticate with your MoonshotAI account using kimi login
  • Configure model selection and context window size in settings
  • Set up project-specific instructions in a local config file
  • Optionally configure proxy settings for network-restricted environments

Key Features

  • Context-aware coding with automatic codebase scanning
  • Multi-step task execution with shell command support
  • Permission-gated file operations for safety
  • Conversational interface for iterative development
  • Open source with active development by MoonshotAI

Comparison with Similar Tools

  • Claude Code — Anthropic's terminal agent with broad model support; Kimi CLI is optimized for Kimi models
  • OpenAI Codex CLI — OpenAI's terminal agent; Kimi CLI uses MoonshotAI's Kimi models as the backend
  • Aider — Git-aware pair programming tool; Kimi CLI focuses on agentic multi-step task execution
  • Gemini CLI — Google's terminal agent; Kimi CLI targets the Kimi model ecosystem

FAQ

Q: Which models does Kimi CLI use? A: Kimi CLI connects to MoonshotAI's Kimi model family, including their latest long-context models.

Q: Is Kimi CLI free to use? A: The CLI is open source. API usage may require a MoonshotAI account with applicable usage limits.

Q: Can Kimi CLI work with other LLM providers? A: Kimi CLI is designed for Kimi models. For multi-provider support, consider tools like Claude Code or Aider.

Q: Does Kimi CLI support long codebases? A: Yes. Kimi models support long context windows, making them suitable for large codebase analysis.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets