Kimi Code CLI is Moonshot AI's open-source terminal AI coding agent — it reads and edits code, runs shell commands, and plans its next step from your feedback.This quick reference collects the Kimi Code commands, slash commands, keyboard shortcuts, built-in tools, and daily workflows developers use most often. Keep it open next to your terminal, and use /help inside Kimi Code or kimi --help in your shell to check what your current version exposes.
For upstream details, see the official kimi command, slash commands, built-in tools, and keyboard shortcuts references.
Install Kimi Code CLI
For most developers, the official install script is the quickest path: it installs a single Kimi Code binary and does not require Node.js. Homebrew, npm, and pnpm are also available if they better match your local toolchain.
| Platform / manager | Command |
|---|---|
| macOS / Linux script | curl -fsSL https://code.kimi.com/kimi-code/install.sh \| bash |
| Homebrew | brew install kimi-code |
| Windows PowerShell | irm https://code.kimi.com/kimi-code/install.ps1 \| iex |
| npm | npm install -g @moonshot-ai/kimi-code |
| pnpm | pnpm add -g @moonshot-ai/kimi-code |
On Windows, install Git for Windows before first launch because Kimi Code CLI uses the bundled Git Bash as its shell environment. After installing, open a new terminal and verify the binary:
Start here
Use this minimum loop when you enter a project for the first time:
Use --yolo, /yolo, and /auto only in workspaces you trust. They reduce approval friction, but they also let Kimi Code act with more autonomy.
Most used commands
If you only memorize a handful, make it these — they cover most day-to-day sessions.
| Command | What it does |
|---|---|
kimi | Start an interactive session in the current directory |
kimi -C | Continue the most recent session here |
kimi -p "..." | Run a single prompt without opening the TUI |
/login | Sign in on first launch |
/init | Generate or refresh AGENTS.md |
/plan on | Enter Plan Mode for broad or risky changes |
/model | Switch the model for this session |
/compact | Free up context when the conversation gets long |
/sessions | Browse and resume past sessions |
/help | List all commands and shortcuts |
Shift-Tab | Toggle Plan Mode |
Launch & automation
Core CLI options
| Command / Flag | What it does |
|---|---|
kimi | Start an interactive session in the current directory |
kimi --continue, kimi -C | Continue the most recent session in this directory |
kimi --session [id], kimi -S [id] | Resume a session by ID, or open the session picker without an ID |
kimi -p "...", kimi --prompt "..." | Run a single non-interactive prompt without opening the TUI |
--output-format stream-json | Emit JSONL events for scripting; only works with --prompt |
kimi --model <model>, kimi -m <model> | Start with a specific model alias |
kimi --plan | Start a new session in Plan Mode |
kimi --yolo, kimi -y | Auto-approve regular tool calls; use only in trusted directories |
kimi --auto | Start in auto permission mode; approvals are handled automatically and the Agent will not ask questions |
--skills-dir <dir> | Load Skills from the specified directory, replacing auto-discovered user and project skill directories for this launch |
Non-interactive examples
CLI subcommands
| Subcommand | Purpose |
|---|---|
kimi login | Start Kimi Code OAuth device-code login without entering the TUI |
kimi acp | Run Kimi Code as an Agent Client Protocol server for IDE integration |
kimi server | Run, install, and manage the local REST/WebSocket/web service |
kimi web | Open Kimi's browser UI; equivalent to kimi server run --open |
kimi doctor | Validate config.toml and tui.toml |
kimi export [sessionId] | Package a session into a ZIP archive |
kimi migrate | Migrate local data from a legacy kimi-cli installation |
kimi upgrade | Check for the latest version and display update options |
kimi vis [sessionId] | Launch the session visualizer in your browser |
kimi provider | Manage providers from the terminal |
Useful server commands:
Slash commands
Slash commands are built-in TUI controls. Type / in the input box to open command completion; aliases are matched too. If a /-prefixed input does not match a built-in command or Skill command, it is sent to the Agent as a regular message.
Account & configuration
| Command | Alias | Purpose |
|---|---|---|
/login | — | Select an account or platform and log in |
/logout | — | Clear credentials for the current account |
/provider | — | Open the provider manager to view, add, and remove configured providers |
/model | — | Switch the LLM model used in the current session |
/settings | /config | Open the settings panel inside the TUI |
/experiments | /experimental | Open the experimental feature panel |
/permission | — | Select a permission mode |
/editor | — | Configure the external editor launched by Ctrl-G |
/theme | — | Switch the terminal UI color theme |
Session management
| Command | Alias | Purpose |
|---|---|---|
/new | /clear | Start a fresh session, discarding the current context |
/sessions | /resume | Browse historical sessions and switch to one |
/tasks | /task | Browse the background task list |
/fork | — | Fork a new session from the current conversation |
/title [...] | /rename | Show or set the current session title |
/compact [...] | — | Compact conversation context; optional text hints what to preserve |
/undo [n] | — | Undo recent prompts from the active context |
/reload | — | Reload the session and apply latest config.toml and tui.toml settings |
/reload-tui | — | Reload only tui.toml UI preferences |
/init | — | Analyze the codebase and generate AGENTS.md |
/export-md [...] | /export | Export the current session as Markdown |
/export-debug-zip | — | Export the current session as a debug ZIP archive |
Modes & run control
| Command | Alias | Purpose |
|---|---|---|
/yolo [on\|off] | /yes | Toggle YOLO mode; skips approval for regular tool calls when enabled |
/auto [on\|off] | — | Toggle auto permission mode; approvals are handled automatically and questions are skipped |
/plan [on\|off] | — | Toggle Plan Mode; simply toggling does not create an empty plan file |
/plan clear | — | Clear the current plan |
/swarm on\|off | — | Turn swarm mode on or off without sending a prompt |
/swarm <task> | — | Turn swarm mode on, send the task as a prompt, then turn swarm mode off after a normal turn |
/goal [...] | — | Start or manage an autonomous goal |
Plan Mode is for broad, risky, or unclear work. It prioritizes exploration and planning before file changes.
/plan on, let Kimi Code inspect the project, review the proposed plan, then approve before changes are made.Goal mode subcommands include /goal status, /goal pause, /goal resume, /goal cancel, /goal replace <objective>, /goal next <objective>, and /goal next manage.
Information & status
| Command | Alias | Purpose |
|---|---|---|
/help | /h, /? | Show keyboard shortcuts and available commands |
/btw [question] | — | Open a side conversation in a forked sub-Agent |
/usage | — | Show token usage, context consumption, and quota information |
/status | — | Show runtime state: version, model, working directory, permission mode, and more |
/mcp | — | List MCP servers and connection status |
/plugins | — | Open the plugin manager |
/version | — | Display the Kimi Code CLI version |
/feedback | — | Submit product feedback |
/exit | /quit, /q | Exit Kimi Code CLI |
Skills & extensions
| Command | Purpose |
|---|---|
/mcp-config | Configure MCP servers and handle MCP OAuth login |
/custom-theme [...] | Create or edit a custom TUI color theme |
/update-config | Inspect or edit config.toml and tui.toml |
/import-from-cc-codex | Import Claude Code and Codex instructions, Skills, and MCP settings |
/sub-skill | Discover and reorganize the local Skill inventory |
/skill:name [extra text] | Invoke an installed external Skill |
/name [extra text] | Shortcut for an external Skill when no system command has the same name |
/parent.child [extra text] | Invoke an external sub-skill exposed with a dotted command name |
Built-in tools
Built-in tools are provided by Kimi Code CLI itself. Read-only tools such as Read, Grep, and Glob are auto-allowed by default; tools that write files, execute commands, stop tasks, or create schedules normally require approval unless your permission mode allows them.
Files, shell, and web
| Tool | Default approval | Purpose |
|---|---|---|
Read | Auto-allow | Read text files |
Write | Requires approval | Create or overwrite files |
Edit | Requires approval | Replace exact file content |
Grep | Auto-allow | Search file contents with ripgrep |
Glob | Auto-allow | Find files by glob pattern |
ReadMediaFile | Auto-allow | Read an image or video file |
Bash | Requires approval | Execute shell commands |
WebSearch | Auto-allow | Search the web when available |
FetchURL | Auto-allow | Fetch the content of a specified URL |
Planning, state, and collaboration
| Tool | Default approval | Purpose |
|---|---|---|
EnterPlanMode | Auto-allow | Enter Plan Mode |
ExitPlanMode | Auto-allow; user confirms the plan | Exit Plan Mode and submit the plan |
TodoList | Auto-allow | Manage a visible task to-do list |
Agent | Auto-allow | Spawn a sub-Agent for a focused subtask |
AgentSwarm | Auto-allow in swarm mode; otherwise may require approval | Launch item-based subagents or resume existing subagents |
AskUserQuestion | Auto-allow | Ask structured multiple-choice questions |
Skill | Auto-allow | Invoke a registered inline Skill |
Background and scheduled tasks
| Tool | Default approval | Purpose |
|---|---|---|
TaskList | Auto-allow | List background tasks |
TaskOutput | Auto-allow | View the output of a background task |
TaskStop | Requires approval | Stop a running background task |
CronCreate | Requires approval | Schedule a prompt to fire in the future |
CronList | Auto-allow | List scheduled tasks |
CronDelete | Requires approval | Cancel a scheduled task |
Keyboard shortcuts
Type /help inside the TUI for the shortcut list available in your current version. See the official Keyboard Shortcuts reference for the full upstream list.
General input
| Shortcut | Action |
|---|---|
Enter | Submit the current input |
Shift-Enter / Ctrl-J | Insert a newline |
↑ / ↓ | Browse input history |
Esc | Close a popup, cancel completion, or interrupt streaming / compaction |
Ctrl-C | Interrupt streaming output or clear the input box |
Ctrl-D | Exit when the input box is empty |
Mode switching and editing
| Shortcut | Action |
|---|---|
Shift-Tab | Toggle Plan Mode |
Ctrl-G | Edit the current input in an external editor |
Ctrl-V | Paste an image or video from the clipboard on Unix / macOS |
Alt-V | Paste an image or video from the clipboard on Windows |
Ctrl-- | Undo input edit |
During streaming and tool output
| Shortcut | Action |
|---|---|
Ctrl-S | Steer: inject the current input into the running turn |
Esc | Interrupt the current streaming output |
Ctrl-C | Interrupt the current streaming output |
Ctrl-O | Expand or collapse tool output |
Approval panel and popups
| Shortcut | Action |
|---|---|
↑ / ↓ | Move between approval options or scroll a popup |
Enter | Confirm the selected approval option; also closes help popups |
1 – 9 | Select an approval option by number |
Esc / Ctrl-C / Ctrl-D | Reject the current approval request |
Ctrl-E | Expand or collapse full diff or file preview content in the approval panel |
PageUp / PageDown | Scroll a popup 10 lines at a time |
q / Q | Close a popup |
Common workflows
Start a new repo
Plan a refactor before editing
Run a background task
Then open /tasks to monitor background work, or let Kimi Code notify you when the task completes.
Resume yesterday's work
If you need a specific session, run kimi --session or use /sessions inside the TUI.
Export or debug a session
Conclusion
Kimi Code CLI works best when you treat it as a terminal teammate with explicit project context. Start with /init, use /plan for large or uncertain changes, watch long-running work with /tasks, keep /compact handy for long sessions, and choose a permission mode that matches the repository's trust level.
FAQ
kimi --continue in the same project directory to continue the most recent session. Use kimi --session [id] in the shell or /sessions inside the TUI to choose a specific session.--yolo skips approval for regular tool calls. Use it only in trusted, version-controlled workspaces. For unfamiliar repositories or production data, keep approvals on./skill:name, /mcp, and /mcp-config to discover and configure them.