kimi-code
kimi-code is the lmctl-maintained fork of Moonshot AI's Kimi Code CLI, patching stale ACP runtime bindings after session restore and batching queued prompts.
Quick reference
Run Kimi Code CLI interactively in the terminal, execute headless JSON-streaming prompts, or start the Agent Client Protocol (ACP) server for lmctl and IDEs.
kimi --version
kimi
kimi -p "Explain the main directories of this repository" --output-format stream-json
kimi acp
| Command or setting | Usage | Purpose |
|---|---|---|
| Interactive TUI | kimi | Launch the terminal coding agent with /login, /mcp-config, video input, and subagents (coder, explore, plan). |
| Headless prompt | kimi -p "<prompt>" --output-format stream-json | Execute a non-interactive prompt and emit structured JSONL events (assistant role content). |
| ACP server | kimi acp | Run the Agent Client Protocol stdio server for lmctl Teamfiles, Zed, and JetBrains IDEs. |
| Config file | ~/.kimi-code/config.toml | Declare default_model, [providers.<name>], and [models.<name>] for custom or loopback endpoints. |
| Disable auto-update | [upgrade] auto_install = false in ~/.kimi-code/tui.toml | Prevent background auto-updates from replacing the patched lmctl-ai binary with stock builds. |
Runnable configuration and headless prompt example targeting an OpenAI-compatible or loopback endpoint:
mkdir -p ~/.kimi-code
cat <<'EOF' > ~/.kimi-code/tui.toml
[upgrade]
auto_install = false
EOF
kimi --version
kimi -p "Reply with KIMI_READY" --output-format stream-json
Documentation pages
- Skill — LLM agent authoring rules, fork patches, headless and ACP commands, and verification steps for kimi-code.
- Guide — Detailed explanation of the acp-runtime-after-reap fix, batched queued prompt delivery, config.toml routing, and auto-update protection.
- Reference — CLI flags, config.toml and tui.toml schemas, subagents, and exit codes.