Kimi CLI cheat sheet
Every command, flag and slash command for kimi — Moonshot's terminal agent — doubles as a shell (Ctrl-X), MCP + ACP, powered by Kimi K2. 18+ commands, verified July 2026.
Rebranding to Kimi Code (github.com/MoonshotAI/kimi-code) — the kimi command + kimi-cli package still work and installing Kimi Code auto-migrates config/sessions.
curl -LsSf https://code.kimi.com/install.sh | bash # macOS / Linux (installs uv + kimi-cli)
uv tool install --python 3.13 kimi-cli # if you already have uv (Python 3.12–3.14)
kimi --version · uv tool upgrade kimi-cli
kimi # interactive session in the current dir
kimi login # OAuth login (or /login in-session)
kimi --print -p "query" # headless: print and exit (implies auto-approve)
echo "explain this" | kimi --print
kimi --continue # continue the last session here
kimi --resume <id> # resume a specific session (no id → picker)
Key flags
| Flag | What it does |
|---|---|
-p, --prompt | Run one prompt then exit (-c, --command alias) |
--print | Non-interactive print mode (implies --afk auto-approve) |
--quiet | = --print --output-format text --final-message-only |
-C, --continue | Continue the previous session in this dir |
-S, --session [id] / -r, --resume [id] | Resume a session (or open the picker) |
-m, --model <name> | Override the default model |
--thinking / --no-thinking | Toggle thinking mode |
--plan | Start in plan mode (read-only exploration) |
-y, --yolo | Auto-approve all tool calls |
In-session slash commands
| Command | What it does |
|---|---|
/login (/setup) | Log in / configure platform + model |
/model | Switch model and thinking mode |
/init | Analyze the project → generate an AGENTS.md |
/plan [on|off|view] | Toggle plan mode |
/new · /sessions (/resume) | New session · list/switch |
/compact [instructions] | Compact context to save tokens |
/undo · /fork | Roll back a turn · fork the session |
/mcp · /hooks | Connected MCP servers · hooks |
/skill:<name> · /flow:<name> | Load a skill · run a flow |
Keys: Ctrl-X toggles agent ↔ shell mode · Shift-Tab plan mode · Ctrl-S steer the running turn.
~/.kimi/config.toml # providers, models, default_model (TOML or JSON)
~/.kimi/ # sessions, credentials, logs, mcp.json
export KIMI_API_KEY="…" # KIMI_BASE_URL, KIMI_MODEL_NAME also honored
# base URL: https://api.moonshot.ai/v1 (global) or …moonshot.cn/v1
kimi --print -p "Add type annotations to src/utils.py"
git diff --staged | kimi --quiet -p "Write a Conventional Commits message"
kimi mcp add -t http context7 https://mcp.context7.com/mcp -H "CONTEXT7_API_KEY: …"
kimi --resume # pick a past session
More CLI cheat sheets
Stop memorizing flags
Run Kimi CLI — and every other agent — from one app
TheVibeFather orchestrates Kimi CLI alongside every other coding CLI in one native macOS app. Bring the models you already pay for; keep your keys.
Claude Code
Gemini CLI
Aider
Goose
Qwen Code
Crush
Grok CLI
OpenHands CLI
Cline CLI
Roo Code CLI
Continue CLI