# 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](https://github.com/MoonshotAI/kimi-code) |
| Documentation | [moonshotai.github.io/kimi-code/en/](https://moonshotai.github.io/kimi-code/en/) |

## Use Kimi Code CLI in EnvHaven

1. Open your workspace in any browser, on a laptop, a tablet or a phone.
2. Tap **Launch**, choose Kimi Code CLI and tap **Sign in**: it runs `kimi login --region global` for you in the terminal.
3. 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.
4. Give it a task. The image launches `kimi` with `--auto`.
5. 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:

```bash
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash
```

npm (Node.js 22.19 or later):

```bash
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, `/login` offers Kimi Code sign-in (a device code) or a Kimi Platform API key; from the shell, `kimi login` runs the device-code flow.
- Add `--region global` for a kimi.ai account or `--region mainland-cn` for 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:

```bash
kimi --auto
```

As the default, in ~/.kimi-code/config.toml:

```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](https://envhaven.com/yolo/kimi-code-cli).

## 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):

```json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/config/workspace"]
    }
  }
}
```

The [MCP config converter](https://envhaven.com/mcp-config) writes the same server for every agent at once.

## Run it from scripts

```bash
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](https://envhaven.com/agents/kimi-code-cli/browser)
- [Kimi Code CLI on iPhone](https://envhaven.com/agents/kimi-code-cli/iphone)
- [Kimi Code CLI on iPad](https://envhaven.com/agents/kimi-code-cli/ipad)
- [Kimi Code CLI on Android](https://envhaven.com/agents/kimi-code-cli/android)
- [Kimi Code CLI on a Chromebook](https://envhaven.com/agents/kimi-code-cli/chromebook)
- [Kimi Code CLI on Windows](https://envhaven.com/agents/kimi-code-cli/windows)
- [Kimi Code CLI on a VPS](https://envhaven.com/agents/kimi-code-cli/vps)
- [Kimi Code CLI in Docker](https://envhaven.com/agents/kimi-code-cli/docker)
- [Kimi Code CLI on a Raspberry Pi](https://envhaven.com/agents/kimi-code-cli/raspberry-pi)
- [Kimi Code CLI 24/7](https://envhaven.com/agents/kimi-code-cli/24-7)

Moonshot AI's own options:

- Remote Control (`kimi rc`, or `/remote-control` in 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

- [Kimi Code CLI vs Claude Code](https://envhaven.com/compare/kimi-code-cli-vs-claude-code)

## When Kimi Code CLI misbehaves

- [Kimi Code CLI: No model configured. Run `kimi` and use /login to sign in, then retry; or set…](https://envhaven.com/errors/kimi-code-cli/no-model-configured)
- [Is Kimi Code CLI down?](https://envhaven.com/status/kimi-code-cli) Live status of the providers it depends on.

## Keep reading

- [Kimi Code CLI full-access mode](https://envhaven.com/yolo/kimi-code-cli)
- [Kimi Code CLI in the browser](https://envhaven.com/agents/kimi-code-cli/browser)
- [Kimi Code CLI on iPhone](https://envhaven.com/agents/kimi-code-cli/iphone)
- [Kimi Code CLI on iPad](https://envhaven.com/agents/kimi-code-cli/ipad)
- [Kimi Code CLI vs Claude Code](https://envhaven.com/compare/kimi-code-cli-vs-claude-code)

Source: https://envhaven.com/agents/kimi-code-cli
