Kai CLI

Command-line interface for Kai

The Kai CLI provides a powerful terminal interface with persistent memory, background agents, and 21+ skills for AI-powered development.

Desktop App (macOS)

Download Kai Desktop

Native macOS app with built-in Node.js runtime. No dependencies required. Just drag to Applications and run.

Download for Mac (Apple Silicon)

Check GitHub Releases for downloads. For Intel Macs, use npm install below.

Installation (npm)

npm global installCopy
npm install -g kai

Or install locally in your project:

npm install --save-dev kai

Environment Setup

Create a .env file with your API keys:

OPENROUTER_API_KEY=your_key_here
MODEL_ID=moonshotai/kimi-k2.5 # optional
TAVILY_API_KEY=your_key # optional, for web search

Get an OpenRouter API key at openrouter.ai/keys

Quick Start

1

Navigate to your project

cd my-project
2

Start Kai

kai

Or run a one-shot query: kai "explain this code"

3

Use slash commands

/git commit

Kai has AI-powered git workflows, agents, and 21+ skills.

CLI Commands

kai

Start interactive REPL mode

$ kai > explain this codebase
kai "query"

One-shot query without interactive mode

$ kai "review this file"
kai start

Start web server with UI and agents

$ kai start --port 3141
kai agent

Manage background agents

$ kai agent list $ kai agent run <id>
/git commit

AI-generated commit messages

> /git commit --push
/skill

List and manage skills

> /skill reload
CommandDescription
kai --continueResume most recent session
kai --resume <id>Resume specific session
kai --name "name"Name the session
kai --yesAuto-approve all tool calls
kai agent create <name> <workflow.yaml>Create agent with optional --schedule
kai mcp listList configured MCP servers

REPL Slash Commands

CommandDescription
/helpShow all available commands
/clearClear conversation history
/compactCompress context to save tokens
/sessionsList recent sessions
/soulView core memory + recall stats
/diffShow all changes made this session
/gitGit status + changed files
/git diffColorized diff (staged + unstaged)
/git commit [msg] [--push]AI-generated commit + optional push
/git pr [title]Create PR (branch + commit + push + open)
/agentList background agents
/doctorRun system diagnostics

Configuration

Kai loads config from (highest priority first):

  1. .kai/settings.json (project-level)
  2. kai.config.json (project-level)
  3. ~/.kai/settings.json (user-level)
{
  "model": "moonshotai/kimi-k2.5",
  "mcp": {
    "servers": {...}
  },
  "permissions": {
    "mode": "default",
    "allow": [],
    "deny": []
  }
}

Next Steps