kimi
moonshot AI's command-line agent for AI-driven coding and terminal operations
TLDR
SYNOPSIS
kimi [options]kimi command [options]
DESCRIPTION
Kimi Code CLI is Moonshot AI's command-line agent for AI-driven coding and terminal operations. It can read and edit code, run shell commands, search files, fetch web pages, and plan its next steps based on feedback. It works with Moonshot AI's Kimi models out of the box and can be configured for other compatible providers.Interactive sessions offer slash commands such as /login, /model, /plan, /sessions and /mcp-config. MCP servers are configured in ~/.kimi-code/mcp.json (user level) or .kimi-code/mcp.json (project level), or conversationally with /mcp-config.
PARAMETERS
-p, --prompt PROMPT
Run a single prompt non-interactively and write the answer to stdout.--output-format text|stream-json
Output format for non-interactive runs.-c, --continue
Resume the most recent session in the current directory.-S, --session [ID]
Resume a previous session; without an ID a session picker opens.-m, --model MODEL
Model alias to use for this launch.-y, --yolo
"Ask When Needed" mode: routine edits and commands run without approval.--auto
"Never Ask" mode: never interrupts for approval.--plan
Start in Plan mode (read-only exploration).--agent NAME, --agent-file PATH
Use a named agent, or load a custom agent from a Markdown file, as the main agent.--skills-dir DIR
Load skills from an extra directory (repeatable).--add-dir DIR
Add an extra workspace directory (repeatable).-V, --version
Print the version.-h, --help
Show help.
COMMANDS
login
Log in via OAuth without opening the TUIacp
Start as Agent Client Protocol server for IDE integration (Zed, JetBrains)web
Run a local server with a web UIdoctor
Validate configuration filesexport [sessionid_]
Package a session into a ZIP fileprovider add|remove|list|catalog
Manage model providersmigrate
Import config, MCP servers and sessions from the legacy Python Kimi CLIupgrade
Check for and install updates
KEYBOARD SHORTCUTS
!
Enter shell mode (on an empty input line) to run shell commands directlyShift+Tab
Toggle Plan modeCtrl+G
Edit the input in an external editorEsc
Interrupt the current turn
CAVEATS
Requires a Kimi Code account or a Moonshot AI Open Platform API key (run /login on first launch). The kimi mcp subcommands and Ctrl+X shell toggle of the legacy Python Kimi CLI do not exist in Kimi Code CLI; use /mcp-config and ! instead.
HISTORY
Moonshot AI first released Kimi CLI in 2025 as an open-source Python tool (Apache 2.0) built around the Kimi K2 models. In 2026 it was archived and replaced by Kimi Code CLI, a TypeScript rewrite distributed as a single binary under the MIT license, which keeps the kimi command name and can migrate legacy data from ~/.kimi/ with kimi migrate.
