Kimi Code CLI
Moonshot AI's open-source terminal coding agent: it reads and edits code, runs shell commands, searches files and fetches web pages. Run it in EnvHaven from any browser, signed in once with your own account, and keep it working 24/7; or install it on your own machine.
Updated November 23, 2026 · Checked against Kimi Code CLI 2.1.1 in EnvHaven v1.9.0
| At a glance | |
|---|---|
| Made by | Moonshot AI |
| Command | kimi |
| Version checked | 2.1.1, in EnvHaven v1.9.0 |
| License | MIT, source |
| Documentation | moonshotai.github.io/kimi-code/en/ |
Use Kimi Code CLI in EnvHaven
- Open your workspace in any browser, on a laptop, a tablet or a phone.
- Tap Launch, choose Kimi Code CLI and tap Sign in: it runs
kimi login --region globalfor you in the terminal. - Start it with one tap: signed in, Kimi Code CLI gets a green dot in the Launch menu and an icon in the workspace’s top bar. Support is built in (2.1.1), so there is nothing to install or update.
- Give it a task. The image launches
kimiwith--auto. - Close the tab whenever you like. The workspace is an always-on Linux machine, so Kimi Code CLI keeps working, and every device you open it from shows the same session.
Every agent signs in with your own account: EnvHaven never resells tokens or adds a markup.
Install Kimi Code CLI on another machine
macOS, Linux:
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash
npm (Node.js 22.19 or later):
npm install -g @moonshot-ai/kimi-code
Sign in from the terminal
In a workspace the Launch menu does this for you. On any other machine, or when you would rather type it:
- Inside the app,
/loginoffers Kimi Code sign-in (a device code) or a Kimi Platform API key; from the shell,kimi loginruns the device-code flow. - Add
--region globalfor a kimi.ai account or--region mainland-cnfor kimi.com. Other providers go in~/.kimi-code/config.toml, or through/provider. - Kimi membership includes Kimi Code, with model access by tier; Remote Control needs a paid membership. Platform API keys are pay-as-you-go.
Run Kimi Code CLI without permission prompts
For one session:
kimi --auto
As the default, in ~/.kimi-code/config.toml:
default_permission_mode = "auto"
--auto starts in “Never Ask” mode: everything runs without interrupting you. --yolo is the milder “Ask When Needed” mode, where risky actions, questions and plans still ask. The two cannot be combined, and -p already runs with auto permission.
In EnvHaven: The image launches kimi with --auto. The details, and when full access is safe, are on the Kimi Code CLI full-access page.
Instructions file
Kimi Code CLI reads AGENTS.md, .kimi-code/AGENTS.md, ~/.kimi-code/AGENTS.md, ~/.agents/AGENTS.md.
Add MCP servers
In ~/.kimi-code/mcp.json (or .kimi-code/mcp.json in a trusted project):
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/config/workspace"]
}
}
}
The MCP config converter writes the same server for every agent at once.
Run it from scripts
kimi -p "<prompt>"
Headless runs cannot stop to ask, so they need the full-access setting above.
Kimi Code CLI away from your desk
Kimi Code CLI keeps working only while the machine it runs on is awake. In EnvHaven that machine is the workspace, which never sleeps: start a task, close the laptop and check on it from a phone.
- Kimi Code CLI in the browser
- Kimi Code CLI on iPhone
- Kimi Code CLI on iPad
- Kimi Code CLI on Android
- Kimi Code CLI on a Chromebook
- Kimi Code CLI on Windows
- Kimi Code CLI on a VPS
- Kimi Code CLI in Docker
- Kimi Code CLI on a Raspberry Pi
- Kimi Code CLI 24/7
Moonshot AI’s own options:
- Remote Control (
kimi rc, or/remote-controlin a session) prints a link and QR code to drive the machine from a phone or another computer; it needs a paid membership.
Compare Kimi Code CLI
When Kimi Code CLI misbehaves
- Kimi Code CLI: No model configured. Run
kimiand use /login to sign in, then retry; or set… - Is Kimi Code CLI down? Live status of the providers it depends on.