Kimi Code CLI: Free Open-Source Alternative to Claude Code

By Prahlad Menon 3 min read

Claude Code is great but costs money. Kimi Code CLI from Moonshot AI is a free, MIT-licensed alternative that runs in your terminal. It reads/edits code, runs shell commands, and iterates on tasks — the standard agent loop — with some genuinely useful additions like video input and IDE integration.

Install and Start Using (2 Minutes)

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

# Or Homebrew
brew install kimi-code

Open any project and start:

cd your-project
kimi

First run, type /login and authenticate with OAuth or API key. Then just ask:

> Add input validation to the user registration form

The agent reads your code, proposes changes, and asks before writing. Standard stuff, but it works.

Practical Use Cases

1. Refactoring with Context

Instead of explaining your codebase:

> Look at src/api/ and refactor the error handling to use a consistent pattern

Kimi scans the directory, understands the existing patterns, and applies changes consistently.

2. Video-to-Code (Actually Useful)

Record a 30-second screen capture of the UI behavior you want. Drop it in:

> [paste video] Implement this interaction in React

The agent watches the video and generates code matching the behavior. This is genuinely novel — no other CLI agent does this.

Real examples:

  • Record a drag-and-drop interaction → get the implementation
  • Capture a loading animation → get the CSS/JS
  • Show a reference app’s UX → get a similar implementation

3. Multi-File Changes with Subagents

For big tasks, dispatch focused subagents:

> /explore Find all API endpoints that don't have rate limiting
> /plan Create a plan to add rate limiting to each
> /coder Implement the plan

Each runs in isolated context so they don’t get confused. The main conversation stays clean.

4. IDE Integration (Not Terminal-Only)

Works natively in Zed, JetBrains, or any ACP-compatible editor:

// ~/.config/zed/settings.json
{
  "agent_servers": {
    "Kimi Code CLI": {
      "type": "custom",
      "command": "kimi",
      "args": ["acp"],
      "env": {}
    }
  }
}

Now you have the agent in your editor’s sidebar, not a separate terminal.

5. Adding MCP Servers Conversationally

Instead of editing JSON configs:

> /mcp-config Add the GitHub MCP server so I can create PRs

Kimi figures out the config and sets it up. Much easier than hunting down server URLs and auth configs.

When to Use Kimi vs Claude Code

Use Kimi Code CLI when…Use Claude Code when…
You want free usageBudget isn’t a constraint
You need video inputYou need the best model quality
You prefer open source (MIT)You want Anthropic’s reliability
You’re cost-sensitive on a teamYou need enterprise support

The honest trade-off: Kimi K3 is solid, but Claude remains better at complex reasoning. For straightforward refactoring, file editing, and code generation, Kimi handles it fine. For tricky architectural decisions, Claude still wins.

Workflow Example: Adding a Feature

cd my-project
kimi

> Add a dark mode toggle to the settings page

# Kimi proposes:
# 1. Add ThemeContext in src/context/
# 2. Modify SettingsPage component
# 3. Update CSS variables in globals.css
# Approve? (y/n)

y

# Files modified, changes applied

> The toggle should persist across sessions

# Kimi adds localStorage logic

> Test it

# Kimi runs npm test, shows results

This back-and-forth loop is where CLI agents shine. You stay in the terminal, iterate fast, and keep context.

Lifecycle Hooks (For Teams)

Run custom commands at decision points:

# .kimi/hooks.yaml
before_write:
  - ./scripts/check-style.sh
after_shell:
  - notify-send "Kimi ran a command"

Useful for: code style enforcement, audit logging, Slack notifications when the agent does something.

If you’re paying for Claude Code and want to experiment with a free alternative, Kimi Code CLI is the most polished option right now. The video input alone makes it worth trying.