Kimi Code CLI Cheatsheet - Moonshot Terminal AI Coding Agent
Kimi Code CLI is Moonshot AI terminal AI coding agent, wired out of the box to Kimi models, for developers in the Kimi ecosystem who want to edit code and ask questions with Kimi directly in the terminal. It is optimized for Kimi out of the box, removing manual model wiring. This sheet covers install, interactive and -p single instructions, session resume, and /model switching.
Install & Launch 4
npm install -g @moonshot-ai/kimi-codecurl -fsSL https://code.kimi.com/kimi-code/install.sh | bashkimi --versionkimiInteractive & Single Instructions 5
kimi -p "查看此项目的目录结构"kimi -C/login/logout/initSessions & Models 5
/model/compact/fork/sessionskimi acpTips
- Kimi Code CLI ships as a zero-dependency binary: one script install and it just works — no PATH fiddling, no conflicts with global modules.
- `kimi -p` runs a single instruction and `kimi -C` resumes a session — these are the workhorses for scripts and automation. Run `/init` before big tasks to generate AGENTS.md so the agent understands the project.
- To use other vendors (Anthropic/OpenAI/Google), just edit `~/.kimi-code/config.toml` with the corresponding API key.
FAQ
What is the relationship between the kimi command and the kimi-cli package?
This sheet covers Moonshot official Kimi Code CLI (npm package @moonshot-ai/kimi-code); the installed command is `kimi`. There is also a separate community Python package named kimi-cli, which is a different project.
Can Kimi Code CLI run on Windows?
Yes. On Windows run the install script `irm https://code.kimi.com/kimi-code/install.ps1 | iex` in PowerShell. Install Git for Windows first; the CLI uses its Git Bash as the shell environment.
Official References
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Aug 26, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us