{"slug": "kimi-code-cli-a-beginner-friendly-guide-to-moonshot-ai-s-terminal-coding-agent", "title": "Kimi Code CLI: A Beginner-Friendly Guide to Moonshot AI's Terminal Coding Agent", "summary": "Moonshot AI has released Kimi Code CLI, an open-source terminal-based AI coding agent that reads and edits code, runs shell commands, and works through tasks step by step. The tool is written in TypeScript, MIT licensed, and distributed as a single binary, supporting Moonshot AI's Kimi models as well as other providers like Anthropic, OpenAI, or Google. It features a conversational MCP configuration, parallel subagents for coding, exploration, and planning, and can be installed via script, Homebrew, or npm.", "body_md": "If you have used tools like Claude Code or similar terminal-based AI agents, Kimi Code CLI will feel familiar. It is Moonshot AI's open-source coding agent that lives in your terminal, reads and edits your code, runs shell commands, and works through tasks step by step based on the results it gets back.\n\nThis post explains what Kimi Code CLI is, why it might be useful to you, and walks through installing and using it for the first time.\n\nKimi Code CLI is an AI coding agent that runs directly in your terminal. Instead of copying code back and forth between a chat window and your editor, you describe a task in plain language, and the agent:\n\nIt works out of the box with Moonshot AI's Kimi models, and it can also be pointed at other compatible providers like Anthropic, OpenAI, or Google by editing a config file.\n\nThe project is written in TypeScript, MIT licensed, and distributed as a single binary, so you do not need a Node.js setup just to run it.\n\nA few design choices make it worth trying if you already use a terminal-based AI agent, or are looking for your first one:\n\n`/mcp-config`\n\n, instead of hand-editing JSON files.`coder`\n\n, `explore`\n\n, and `plan`\n\nsubagents can run in isolated contexts in parallel, keeping your main conversation clean.You have two main installation paths: the official install script, or npm.\n\n**macOS or Linux**\n\n```\ncurl -fsSL https://code.kimi.com/kimi-code/install.sh | bash\n```\n\n**Windows (PowerShell)**\n\n```\nirm https://code.kimi.com/kimi-code/install.ps1 | iex\n```\n\nOn Windows, install [Git for Windows](https://gitforwindows.org/) first, since Kimi Code CLI uses the bundled Git Bash as its shell environment. If Git Bash is in a non-standard location, set the `KIMI_SHELL_PATH`\n\nenvironment variable to the full path of `bash.exe`\n\n.\n\n**Homebrew (macOS/Linux)**\n\n```\nbrew install kimi-code\n```\n\nThe script downloads the latest release, verifies its checksum, and adds the `kimi`\n\nexecutable to your PATH.\n\nIf you already have Node.js 22.19.0 or later:\n\n```\nnode --version\nnpm install -g @moonshot-ai/kimi-code\n```\n\nOr with pnpm:\n\n```\npnpm add -g @moonshot-ai/kimi-code\n```\n\nOpen a new shell session and run:\n\n```\nkimi --version\n```\n\nIf that prints a version number, you are ready to go.\n\nMove into a project directory and start the interactive UI:\n\n```\ncd your-project\nkimi\n```\n\nOn first launch, log in from inside the CLI:\n\n```\n/login\n```\n\nThis opens a platform selector with two options:\n\n`platform.kimi.com`\n\nor `platform.kimi.ai`\n\n.To log out later, run `/logout`\n\n.\n\nIf you would rather use Anthropic, OpenAI, Google, or another compatible provider, edit `~/.kimi-code/config.toml`\n\ndirectly and add your API key there.\n\nOnce logged in, just describe what you want in plain English. A good first prompt is to have it explore your project:\n\n```\nTake a look at this project's directory structure and briefly describe what each directory is for.\n```\n\nKimi Code CLI will call its file-reading and search tools automatically to gather context before answering. Read-only operations run without asking for confirmation. Anything that modifies files or runs shell commands will prompt you to approve it first.\n\nYou can also hand it a concrete coding task:\n\n```\nAdd a function in src/utils that converts any string to kebab-case, and add a unit test for it.\n```\n\nThe agent plans the steps, edits the code, runs the tests, and reports back what it did.\n\n```\nkimi -p \"Take a look at this project's directory structure\"\nkimi -c\n```\n\n| Command | What it does |\n|---|---|\n`/help` |\nOpens the command and shortcut panel |\n`/new` |\nStarts a new session, clearing current context |\n`/sessions` |\nBrowse and resume past sessions |\n`/model` |\nSwitch the active model |\n`/compact` |\nManually compress context to free up tokens |\n`/fork` |\nFork the current session, keeping history but continuing separately |\n`/mcp-config` |\nAdd and authenticate MCP servers conversationally |\n`/exit` |\nExit the CLI |\n\nHandy keyboard shortcuts:\n\n| Shortcut | What it does |\n|---|---|\n`Esc` |\nInterrupt streaming output or close a popup |\n`Ctrl-C` |\nInterrupt output; press twice while idle to exit |\n`Shift-Tab` |\nToggle Plan mode |\n`Ctrl-S` |\nInject a message mid-stream |\n`Ctrl-O` |\nCollapse or expand tool output |\n\nKimi Code CLI supports the Agent Client Protocol, which lets editors like Zed and JetBrains drive a session directly.\n\nFor Zed, add this to `~/.config/zed/settings.json`\n\n:\n\n```\n{\n  \"agent_servers\": {\n    \"Kimi Code CLI\": {\n      \"type\": \"custom\",\n      \"command\": \"kimi\",\n      \"args\": [\"acp\"],\n      \"env\": {}\n    }\n  }\n}\n```\n\nThen open a new conversation in Zed's Agent panel. No extra login is needed since it reuses your existing CLI credentials.\n\nKimi Code CLI stores config files, session records, logs, and its update cache under `~/.kimi-code/`\n\nby default. If you want to move that elsewhere, set the `KIMI_CODE_HOME`\n\nenvironment variable to a different path.\n\n**Upgrade**\n\n```\nkimi upgrade\n```\n\nOr, if you installed via npm:\n\n```\nnpm install -g @moonshot-ai/kimi-code@latest\n```\n\n**Uninstall**\n\nIf you installed via the script, just delete the `kimi`\n\nexecutable. If you installed via npm:\n\n```\nnpm uninstall -g @moonshot-ai/kimi-code\n```\n\nIf you want to contribute or run the latest code from `main`\n\n:\n\n```\ngit clone https://github.com/MoonshotAI/kimi-code.git\ncd kimi-code\npnpm install\npnpm dev:cli    # run the CLI in dev mode\npnpm test       # run tests\npnpm typecheck  # TypeScript check\npnpm lint       # oxlint\npnpm build      # build all packages\n```\n\nThis requires Node.js 24.15.0 or later and pnpm 10.33.0. Check `CONTRIBUTING.md`\n\nin the repo for the full contribution guide.\n\nKimi Code CLI brings together a lot of what people already like about terminal-based AI coding agents: a fast single-binary install, a clean TUI, subagents, MCP support, and editor integration through ACP. The video input feature and the conversational MCP setup are the two pieces that stand out as genuinely different from similar tools.\n\nIf you want to try it, the fastest path is the install script followed by `/login`\n\n. From there, just start describing what you want done.\n\n**Links**", "url": "https://wpnews.pro/news/kimi-code-cli-a-beginner-friendly-guide-to-moonshot-ai-s-terminal-coding-agent", "canonical_source": "https://dev.to/arshtechpro/kimi-code-cli-a-beginner-friendly-guide-to-moonshot-ais-terminal-coding-agent-39db", "published_at": "2026-07-19 04:49:26+00:00", "updated_at": "2026-07-19 05:27:53.645437+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "large-language-models", "ai-agents"], "entities": ["Moonshot AI", "Kimi Code CLI", "Anthropic", "OpenAI", "Google", "TypeScript", "MIT"], "alternates": {"html": "https://wpnews.pro/news/kimi-code-cli-a-beginner-friendly-guide-to-moonshot-ai-s-terminal-coding-agent", "markdown": "https://wpnews.pro/news/kimi-code-cli-a-beginner-friendly-guide-to-moonshot-ai-s-terminal-coding-agent.md", "text": "https://wpnews.pro/news/kimi-code-cli-a-beginner-friendly-guide-to-moonshot-ai-s-terminal-coding-agent.txt", "jsonld": "https://wpnews.pro/news/kimi-code-cli-a-beginner-friendly-guide-to-moonshot-ai-s-terminal-coding-agent.jsonld"}}