Kimi Code: How to Use Kimi K3 for Coding

Install the Kimi Code CLI, connect your account, and safely start using Kimi K3 on a real codebase.

Saganote
Saganote ·
11 Min Read

Kimi Code brings an AI coding agent into the terminal. Instead of copying individual files into a chat, you can open a project, let Kimi inspect its structure, ask questions about the code, and then have it make changes or run commands when you approve them. This guide walks through the current Kimi Code CLI setup and a safe first workflow with Kimi K3.

If Kimi K3 is new to you, start with our guide to Kimi K3 and how it compares with other leading models. For a broader explanation of how coding agents work, see what an AI agent is and how it can act for you.

What you need before starting

Kimi Code CLI runs in a terminal and is currently distributed as a TypeScript application that runs on Node.js. Kimi recommends its installation script, which does not require Node.js to be installed first. On Windows, Kimi says Git for Windows should be installed before the first launch because the CLI uses the bundled Git Bash environment. Kimi Code getting started guide and Kimi's preparation guide.

  • A Mac, Linux, or Windows computer with a terminal.
  • A Kimi account or a Kimi Platform API key for authentication.
  • A project directory you can safely work in.
  • A clean or otherwise recoverable working tree before asking an AI agent to edit files.
  • On Windows, Git for Windows installed before the first Kimi Code launch. Kimi Code getting started guide.
Start with a project you can undo

Kimi Code can modify files and run shell commands. Keep a backup or use Git so you can review and revert changes. The CLI normally asks for confirmation before write and execution operations, but that approval step should be treated as a safety check, not a substitute for reviewing the work. Kimi Code's built-in tools reference and interaction and approval guide.

1. Install Kimi Code

The current Kimi Code documentation recommends the official install script. Choose the command for your operating system and run it in your terminal. Kimi Code getting started guide.

macOS or Linux

curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash

Windows PowerShell

irm https://code.kimi.com/kimi-code/install.ps1 | iex

The installer downloads the latest release, verifies its checksum, and places the kimi executable on your PATH. If you prefer npm, the official documentation lists Node.js 22.19.0 or later as the requirement. Kimi Code getting started guide.

After installation, verify that the command is available:

kimi --version
Terminal showing the kimi --version command after Kimi Code installation.
Verify that the Kimi Code CLI is installed and available from the terminal.

2. Open Kimi Code inside your project

Kimi Code works from the directory you launch it in, so move into the project you want to work on before starting a session. Kimi Code getting started guide.

cd your-project
kimi

Replace your-project with the path to your project. For example, if a project is in your Documents folder, change into that folder first and then run kimi.

The first launch opens Kimi Code's interactive terminal interface. From here, you can ask questions in natural language and use slash commands for account and session controls. Kimi Code CLI interaction guide and slash commands reference.

Kimi Code CLI open in a terminal with its interactive prompt.
Kimi Code opens an interactive coding-agent session in the current project directory.

3. Sign in to Kimi Code

On the first launch, enter /login in the Kimi Code interface. The current login flow lets you choose Kimi Code OAuth or authenticate with a Kimi Platform API key. With OAuth, the device-code flow opens a link where you authorize the account and enter the displayed code. Kimi Code getting started guide and kimi command reference.

/login

If you only want to use the normal Kimi Code membership flow, OAuth is the straightforward starting point. API-key authentication is useful when you specifically need to connect through the Kimi Platform.

The official Kimi Code overview also notes that members can use Kimi Code benefits through the official client and supported third-party tools. If you are mainly interested in costs, plans, and what each tier includes, see our Kimi K3 pricing guide.

Kimi Code login interface showing authentication options.
Use the /login command to connect Kimi Code to a Kimi account or API key.

4. Start with a read-only project check

Before asking Kimi K3 to change anything, let it inspect the project. This gives you a quick way to see whether the agent understands the repository and establishes useful context for the rest of the session.

A good first prompt from Kimi's own getting-started documentation is:

Take a look at this project's directory structure and briefly describe what each directory is for.

Kimi Code can automatically use file-reading and search tools to inspect relevant content, as described in the Kimi Code interaction guide. Read-only operations normally run without a confirmation prompt, while file modifications and shell commands require approval in the default permission mode.

Kimi Code analyzing a project's directory structure in the terminal.
Start with a read-only request so Kimi can map the project before making changes.

5. Give Kimi K3 a small coding task

Once Kimi understands the project, move to a small change that is easy to inspect. Avoid starting with a large refactor or a request that touches many unrelated files.

For example:

Add a function in src/utils that converts any string to kebab-case, and add a unit test for it.

This kind of request gives the agent a clear target and a concrete way to check the result. Kimi's documentation describes a workflow where the CLI plans the task, modifies the code, runs tests, and reports what it did. Kimi Code getting started guide.

For larger changes, you can also use Plan mode first. Plan mode is read-only while Kimi explores the project and prepares an implementation plan, so it is useful when you want to review the approach before code is changed. You can start it with kimi --plan, /plan, or the Shift-Tab shortcut. Kimi Code work modes guide.

6. Review Kimi's approval requests

When Kimi needs to edit a file or execute a shell command, the CLI displays an approval panel. In the default Always Ask mode, read-only operations are allowed automatically, while other actions ask for confirmation one at a time. Kimi Code interaction guide.

  • Allow: approve the requested operation.
  • Allow for this session: allow similar operations without asking again during the session.
  • Deny: reject the operation.

Read the requested operation before approving it. If a command is unexpected, broad, destructive, or unrelated to the task, deny it and ask Kimi to explain or use a narrower approach.

7. Review the changed files and tests

After Kimi makes a change, do not stop at the agent's summary. Open the changed files, inspect the diff, and run the relevant tests yourself when practical. This is especially important when a request touches configuration, dependencies, authentication, deployment files, or more than one part of a project.

Kimi Code also supports file references with @. Type @ in the input area to select a file or directory path and give the agent that specific context. Kimi Code interaction guide.

@src/utils/

A focused follow-up can then ask Kimi to explain a particular change, add a missing test, or revise one part of the implementation rather than reopening the entire task.

Useful Kimi Code commands

You do not need to memorize every command to get started. These are the ones most useful for a first session:

CommandWhat it does
`kimi`Starts a new interactive session in the current directory
`kimi --version`Shows the installed Kimi Code version
`kimi -c`Continues the most recent session in the current working directory
`/login`Starts the account or API-key login flow
`/sessions`Lists and switches between sessions
`/model`Selects the model for the session
`/compact`Compacts the current context
`/exit`Exits Kimi Code
`kimi --plan`Starts a new session in Plan mode

These commands and their current behavior are documented in the Kimi Code CLI command reference and slash commands reference.

Prompts that work well for a first session

The best prompts are specific about the goal and the part of the project that should change. Instead of asking Kimi to "improve the app," give it a bounded task and a way to verify the result.

  • "Explain how authentication flows through this project and point me to the main files involved."
  • "Find the code responsible for this error and explain the likely cause before changing anything."
  • "Add a unit test for the existing date formatter in src/utils, then run the relevant tests."
  • "Review this function for edge cases. Do not edit it yet."
  • "Refactor this function without changing its public behavior, then run the existing tests."

For unfamiliar repositories, start with questions and read-only analysis. For implementation work, define the target files, expected behavior, and tests whenever you can.

Kimi Code vs. Kimi K3: what is the difference?

Kimi Code and Kimi K3 are related, but they are not the same thing. Kimi Code is the coding service and agent workflow that operates in your development environment. Kimi K3 is an underlying Kimi model that can be used for coding tasks through supported Kimi Code plans and workflows. Kimi's official overview describes Kimi Code as a programming-focused service and Kimi K3 as part of its current model offering. Kimi Code overview and Kimi Code product page.

That distinction matters when comparing tools. Kimi Code gives you the terminal workflow, file tools, approvals, sessions, and related coding features. The model determines the reasoning and code-generation capabilities used inside that workflow.

Common problems

`kimi` is not found after installation

Close and reopen the terminal so the updated PATH is loaded. Then run:

kimi --version

If you installed through npm, verify that the installed executable directory is on your PATH and that you are using a supported Node.js version. The official npm route currently requires Node.js 22.19.0 or later. Kimi Code getting started guide.

Login shows no available models

Kimi's official FAQ says an empty model list can be caused by an invalid or expired API key or by network connectivity problems. It also warns that Kimi Code and Kimi Open Platform use different base URLs and billing models, so make sure the credential matches the platform you selected. Kimi Code FAQ.

Kimi asks for approval too often

That is expected in the default Always Ask mode. You can approve a similar operation for the rest of the session, or use another permission mode when you understand the risks. Kimi's documentation distinguishes Always Ask, Ask When Needed, and Never Ask modes. Kimi Code interaction guide.

Be careful with unattended modes

Kimi documents Ask When Needed and Never Ask modes for reducing approval prompts. Never Ask can automatically handle even sensitive file access and plan exits, so it should not be treated as the default safety setting for an unfamiliar project. Kimi Code interaction guide.

Frequently Asked Questions

Frequently Asked Questions

Is Kimi Code the same as Kimi K3?
No. Kimi Code is the coding service and agent workflow, while Kimi K3 is a Kimi model that can power coding work through supported Kimi Code workflows.
Do I need Node.js to install Kimi Code?
Not if you use Kimi's recommended installation script. The script installs the current CLI directly. The npm installation method requires Node.js 22.19.0 or later. Kimi Code getting started guide.
Does Kimi Code change files without asking?
In the default Always Ask mode, read-only operations run automatically, while file edits and shell commands require approval. Other permission modes can reduce or remove those prompts, so use them carefully. Kimi Code's built-in tools reference and interaction and approval guide.
Can I use Kimi Code without opening an interactive session?
Yes. The CLI supports a -p option for running a single instruction and -c for continuing the most recent session. Kimi Code getting started guide.
Can Kimi Code work with a project that is not a Git repository?
Yes. Kimi's interaction documentation says @ file references work in both Git and non-Git directories. Git is still strongly recommended for projects where you want an easy way to review and revert changes. Kimi Code interaction guide.

Final thoughts

The easiest way to learn Kimi Code is to start small. Install the CLI, open a project, ask Kimi K3 to explain the codebase, and only then give it a bounded coding task. Keep approval prompts enabled while you learn the workflow, and review the resulting diff and tests before accepting the change.

Once that workflow feels comfortable, you can explore sessions, Plan mode, file references, and other Kimi Code features without changing how you control the underlying project.


Share this
Saganote

About Author

Saganote

Saganote is an independent technology publication covering artificial intelligence, cybersecurity, startups, software, consumer technology, and innovation. Our editorial team researches, writes, and reviews original news, analysis, and explainers to provide accurate, timely, and well-sourced coverage of the technology industry.