Skip to content
Kimi CLI logo

Kimi CLI cheat sheet

$ kimi Moonshot AI Official docs

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.

Install
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
Start & run
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

FlagWhat it does
-p, --promptRun one prompt then exit (-c, --command alias)
--printNon-interactive print mode (implies --afk auto-approve)
--quiet= --print --output-format text --final-message-only
-C, --continueContinue 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-thinkingToggle thinking mode
--planStart in plan mode (read-only exploration)
-y, --yoloAuto-approve all tool calls

In-session slash commands

CommandWhat it does
/login (/setup)Log in / configure platform + model
/modelSwitch model and thinking mode
/initAnalyze 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 · /forkRoll back a turn · fork the session
/mcp · /hooksConnected 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.

Config
~/.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
Common one-liners
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.