Kimi Code is a coding assistant that works inside your own project, from the terminal. This guide takes you from nothing installed to your first finished task, one small and safe step at a time.
Kimi Code reads your project, writes the code, runs the tests and shows you the result.
Kimi Code is Moonshot AI's coding assistant. You open it in your project folder, type what you want in plain words, and it does the work in your files. It is different from chatting at kimi.com because it can see your whole project and act on it.
It searches and reads your files to understand how the project fits together.
It edits code across several files, and asks you before each change.
It can run commands and tests, then fix what fails, with your approval.
| You need | Details |
|---|---|
| A way to pay for usage | A Kimi Code membership (usage is included), or an API key from the Kimi platform (pay as you go). The free chat plan does not cover Kimi Code. |
| A terminal | Terminal on Mac, any terminal on Linux, or PowerShell on Windows. |
| Windows only: Git for Windows | Install it before you start Kimi Code for the first time. Kimi Code uses the Git Bash that comes with it. |
| Node.js (optional) | Only if you install with npm or pnpm. You need version 22.19.0 or later. The install script does not need Node.js. |
| A project to practise on | Any small folder with code in it. A personal or test project is best for your first try. |
Not sure about plans? See Kimi pricing or the Kimi Code notes on the home page.
Open your terminal, copy the line for your system, paste it and press Enter.
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bashPaste into Terminal.
irm https://code.kimi.com/kimi-code/install.ps1 | iexPaste into PowerShell. Install Git for Windows first.
npm install -g @moonshot-ai/kimi-codeNeeds Node.js 22.19.0 or later.
Then check that it worked:
kimi --versionIf you see a version number, Kimi Code is installed.
code.kimi.com before you press Enter.Kimi Code works on the folder you start it in. So first move into your project folder, then start it.
cd your-projectkimiReplace your-project with the path to your own folder. When Kimi Code opens, you will see a box where you can type.
/help at any time to see every command and shortcut./login and press Enter./usage to confirm your plan and how much quota you have left./logout.Kimi Code can change files. Before your first task, save a snapshot of your project so you can always go back. If your project uses Git, run this in a normal terminal window:
git add -A && git commit -m "Before Kimi Code"No Git? Make a copy of the project folder instead. It takes ten seconds and does the same job.
Do this in three small moves: look, plan, then change. Each one builds your trust in the tool.
This only reads files, so nothing can break. Reading runs without asking you.
Read this project and explain how it is organized. List the main folders, what each one does, and how to run it. Do not change any files.
Press Shift + Tab to turn on Plan mode. Kimi Code will write a plan before it touches anything. Then ask for something small and easy to check.
I want to add a "Back to top" link to the footer of the home page. Make a short plan first. Tell me which files you will change and why, and wait for my OK.
A first task from start to finish. Your screen will look a little different.
Never skip this step. Kimi Code is good, but it can misunderstand you or make mistakes, like any assistant.
In a normal terminal, this shows every line that was added or removed.
git diffSave the work as a new snapshot.
git add -A && git commit -m "Add back to top link"This puts your edited files back to the last snapshot.
git restore .New files it created are not removed by this. Delete those by hand.
You can also ask Kimi Code itself: "Summarize what you changed, file by file." It is a quick way to check its work against the diff.
Once the first task works, try these. Each one is a little bigger than the last.
Run the tests. If any fail, find the cause, fix it, run the tests again and tell me what you changed.
Write tests for the main functions in this file. Cover the normal case and two edge cases. Run them and show me the result.
Explain what this file does in plain English, step by step. Point out anything that looks risky or confusing.
Suggest three small clean-ups for this file that do not change how it behaves. Show me the plan before you edit anything.
Read the project and write a clear README with what it does, how to install it and how to run it.
Here is a screenshot of a page design. Build it as a responsive web page and match the colours, spacing and fonts as closely as you can.
The last one uses Kimi's vision. Press Ctrl + V to paste an image. See the Visual Coding guide and Design to Code.
| Command | What it does |
|---|---|
/help | Shows all commands and shortcuts |
/login | Signs you in |
/model | Switches the model |
/usage | Shows your quota and plan |
/new | Starts a fresh session for a new task |
/sessions | Opens a past session again |
/compact | Shortens a long session so it keeps working well |
/exit | Closes Kimi Code |
| Keys | What they do |
|---|---|
| Shift + Tab | Turns Plan mode on or off |
| Esc | Stops the current answer |
| Ctrl + C | Stops the answer. Press twice when idle to exit |
| Ctrl + V | Pastes an image |
| Ctrl + O | Shows or hides long tool output |
| Ctrl + S | Sends a message while it is still working |
kimi -cContinues your last session.
kimi upgradeUpdates Kimi Code to the newest version.
Tick these off as you go.
Your ticks are not saved if you close or reload this page.
kimi --version again.node --version.KIMI_SHELL_PATH setting that points to bash.exe./login again for a fresh one./usage to see your plan and limits.git restore . in a normal terminal to put edited files back, or use your folder copy./new to start fresh for each new task./compact to shorten the current session.Is Kimi itself down? See Kimi not working.