Moonshot AI has released the KmCode CLI, an open-source coding agent that runs in the terminal. The tool reads and edits code, runs shell commands, searches files, and fetches web pages. It then chooses its next step based on the feedback received. This project is MIT-licensed and available on GitHub.
KM Code CLI is the successor to the older KM-CLI. The new agent is written in TypeScript and distributed via npm. It works out-of-the-box with Moonshot AI’s KM model. It can also be configured to use other compatible providers.
What is kmcode CLI?
KmCode is an AI agent for CLI software development and terminal operation. It can implement new features, fix bugs, and complete refactors. It can also explore an unfamiliar codebase and answer architectural questions. Batch file processing, builds, and serial test runs are also supported.
The execution model is feedback-driven. The agent plans the steps, modifies the code, runs tests, and reports its actions. Read-only operations run automatically by default. For file editing or shell commands, the agent asks for confirmation first. This approval flow keeps risky tasks under developer control.
The CLI itself is free and MIT-licensed. Model access requires a Kimi Code OAuth or Moonshot AI Open Platform API key.
key features
Moonshot lists several features aimed at longer, focused agent sessions:
- Single-binary distribution. One command installs it, which does not require Node.js setup.
- Fast startup. Moonshot says the TUI is ready in milliseconds.
- Purpose-built TUI. The interface is tuned for extended agent sessions.
- Video input. Insert a screen recording or demo clip into a chat.
- AI-native MCP configuration. Add and authenticate ModelContext Protocol Server
/mcp-config. - Subagent for parallel work. built-in dispatch
coder,exploreAndplanSubagents in discrete contexts. - Lifecycle hook. Run local commands to trigger get tool calls, audit decisions, or notifications.
Installation and first run
Two installation paths exist. The official script does not require pre-installed Node.js.
On MacOS or Linux, run the install script:
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash
On Windows, use Powershell:
irm https://code.kimi.com/kimi-code/install.ps1 | iex
Global npm install requires Node.js 24.15.0 or later:
npm install -g @moonshot-ai/kimi-code
Verify the binary, then open a project and start the interactive UI:
kimi --version
cd your-project
kimi
On first launch, type /login Inside the UI. You can choose Kimi Code OAuth or Moonshot AI Open Platform API key. To run a directive without UI, use kimi -p "your task". To resume a previous session, add -C.
use cases
- understanding a project: Ask for an architecture overview and a module dependency diagram.
- implement a feature: Describe signatures, options, and acceptance criteria in advance.
- fix a bug: Explain symptoms, reproductive stages and expected behavior together.
- Writing tests and refactoring: Remove repeated patterns, then run tests to confirm the behavior.
- One-time Automation: Analyze logs and output call counts with p50 and p99 latency.
- scheduled tasks: Ask the agent to set a reminder or recurring check via cron.
Available through planning mode Shift-Tab Or kimi --plan. It outputs a research plan before touching the files. For secure batch jobs, --yolo Or /yolo Leaves approval signals. /fork The command creates an experimental branch that you can drop. /compact The command compresses the context to free the token. For larger investigations, the main agent can dispatch subagents in parallel.
How does kmcode CLI compare
The KmCode CLI connects to many installed terminal coding agents. The table below compares it with three of them. Competitive details reflect mid-2026 and may change quickly.
| Property | km code cli | cloud code | OpenAI Codex CLI | gemini cli |
|---|---|---|---|---|
| developer | Moonshot AI | anthropic | OpenAI | |
| support model | km model | cloud model | gpt-5.3-codecs | gemini 2.5 pro |
| language/runtime | typescript | node.js | War | typescript |
| to install | Script or npm (Node.js ≥ 24.15.0) | Native Installer or NPM | npm/native | npm single binary |
| mcp support | Yes (/mcp-config) |
Yes | Yes | Yes |
| sub-agent | Yes (coder, explore, plan) |
Yes | Yes | no (sequential) |
| planning mode | Yes (Shift-Tab) |
Yes | Yes | Yes |
| IDE integration | ACP (Jade, JetBrains) | VS Code, JetBrains | VS Code, IDE | VS Code (Code Help) |
| license | MIT | property | open source | Apache 2.0 |
All four agent models support the Context Protocol. They differ on support models, languages, licenses, and orchestration. KM Code CLI and Codex CLI both ship native sub-agents. The Gemini CLI runs tasks sequentially without the support of subagents.
key takeaways
- KmCode CLI is an MIT-licensed terminal coding agent from Moonshot AI.
- It is written in TypeScript and installs via script or npm.
- Made in
coder,exploreAndplanSubagents run in different contexts. - MCP servers are configured interactively
/mcp-configNot raw JSON. - It replaces km-cli and migrates existing configuration and sessions.
MarketTechPost’s visual explainer
KM Code CLI Guide
01/09
check it out GitHub repo here. Also, feel free to follow us Twitter And don’t forget to join us 150k+ ml subreddit and subscribe our newsletter. wait! Are you on Telegram? Now you can also connect with us on Telegram.
Do you need to partner with us to promote your GitHub repo or Hugging Face page or product release or webinar, etc? join us

Michael Sutter is a data science professional and holds a Master of Science in Data Science from the University of Padova. With a solid foundation in statistical analysis, machine learning, and data engineering, Michael excels in transforming complex datasets into actionable insights.