Skip to main content

Kilo CLI

Kilo CLI is the terminal-based AI coding agent from Kilo Code, providing agentic coding capabilities directly in your terminal with multi-model support, MCP integration, and customizable agent workflows.

Prerequisites

Installation

curl -fsSL https://kilo.ai/install | bash

Configuration

Create or edit the configuration file at ~/.config/opencode/opencode.json:

{
"$schema": "https://kilo.ai/config.json",
"model": "apertis/claude-sonnet-4-6",
"small_model": "apertis/claude-haiku-4-5",
"theme": "catppuccin",
"autoupdate": true,
"share": "manual",
"snapshot": true,
"logLevel": "INFO",
"provider": {
"apertis": {
"options": {
"apiKey": "your_apertis_api_key",
"baseURL": "https://api.apertis.ai/v1"
},
"models": {
"claude-opus-4-6-thinking": {
"id": "claude-opus-4-6-thinking",
"name": "Claude Opus 4.6 Thinking (via Apertis)"
},
"claude-opus-4-6": {
"id": "claude-opus-4-6",
"name": "Claude Opus 4.6 (via Apertis)"
},
"claude-sonnet-4-6": {
"id": "claude-sonnet-4-6",
"name": "Claude Sonnet 4.6 (via Apertis)"
},
"claude-haiku-4-5": {
"id": "claude-haiku-4-5",
"name": "Claude Haiku 4.5 (via Apertis)"
},
"gemini-3.1-pro-preview": {
"id": "gemini-3.1-pro-preview",
"name": "Gemini 3.1 Pro Preview (via Apertis)"
}
}
}
},
"agent": {
"build": {
"model": "apertis/claude-sonnet-4-6",
"temperature": 0.7,
"maxSteps": 50,
"permission": {
"edit": "allow",
"bash": {
"npm": "allow",
"git": "allow",
"go": "allow",
"make": "allow",
"*": "ask"
},
"webfetch": "allow"
}
},
"plan": {
"model": "apertis/claude-opus-4-6-thinking",
"permission": {
"edit": "deny",
"bash": "ask"
}
}
},
"mcp": {
"context7": {
"type": "local",
"command": ["npx", "-y", "@upstash/context7-mcp@latest"],
"enabled": true
}
},
"instructions": ["./AGENTS.md", "./CLAUDE.md"],
"keybinds": {
"leader": "ctrl+k",
"session_new": "ctrl+n",
"agent_cycle": "tab"
},
"lsp": {
"typescript": {
"command": ["typescript-language-server", "--stdio"],
"extensions": [".ts", ".tsx", ".js", ".jsx"]
}
}
}

Replace your_apertis_api_key with your actual API key from Apertis Dashboard.

Configuration Fields

FieldDescription
modelDefault model for general use. Format: apertis/<model-id>.
small_modelLightweight model for quick tasks. Format: apertis/<model-id>.
provider.apertis.options.apiKeyYour API key from Apertis Dashboard.
provider.apertis.options.baseURLApertis API endpoint. Typically no change needed.
provider.apertis.modelsAvailable models to register. Add or remove as needed.
agent.buildAgent config for implementation tasks (model, permissions, max steps).
agent.planAgent config for planning tasks (typically a thinking model).
mcpMCP server integrations (e.g., Context7, Supabase, Cloudflare).
instructionsInstruction files to load (e.g., AGENTS.md, CLAUDE.md).
keybindsCustom keyboard shortcuts.
lspLanguage server configurations for code intelligence.

Available Model IDs

Model IDDescription
claude-opus-4-6-thinkingClaude Opus 4.6 with extended thinking
claude-opus-4-6Claude Opus 4.6 — most capable
claude-sonnet-4-6Claude Sonnet 4.6 — balanced speed and capability
claude-haiku-4-5Claude Haiku 4.5 — fastest
gemini-3.1-pro-previewGemini 3.1 Pro Preview

For the full list of available models, check the Model List.

Agent Modes

Kilo CLI supports multiple agent modes with different model and permission configurations:

AgentPurposeRecommended Model
buildImplementation, coding, file editingapertis/claude-sonnet-4-6
planArchitecture planning, read-only analysisapertis/claude-opus-4-6-thinking

MCP Server Examples

Add MCP servers to extend Kilo CLI's capabilities:

{
"mcp": {
"supabase": {
"type": "remote",
"url": "https://mcp.supabase.com/mcp?project_ref=your_project_ref"
},
"cloudflare-observability": {
"type": "local",
"command": ["npx", "mcp-remote", "https://observability.mcp.cloudflare.com/mcp"],
"enabled": true
},
"context7": {
"type": "local",
"command": ["npx", "-y", "@upstash/context7-mcp@latest"],
"enabled": true
}
}
}

Launch

kilo

Keybinds

KeybindAction
ctrl+kLeader key
ctrl+nNew session
tabCycle between agents

Troubleshooting

Connection Issues

  • Verify your API key at Apertis Dashboard
  • Ensure baseURL in config is https://api.apertis.ai/v1
  • Check your network connection and firewall settings

Config Not Loading

  • Verify the config file is at ~/.config/opencode/opencode.json
  • Validate JSON syntax (no trailing commas, correct quotes)
  • Restart Kilo CLI after config changes