Orchestrate agents from your terminal. Plan, debug, and code fast with keyboard-first navigation on the command line.
The Kilo Code CLI uses the same underlying technology that powers the IDE extensions, so you can expect the same workflow to handle agentic coding tasks from start to finish.
npm install -g @kilocode/cli
Change directory to where you want to work and run kilocode:
# Start interactive chat session
kilocode
# Start with a specific mode
kilocode --mode architect
# Start with a specific workspace
kilocode --workspace /path/to/project
to start the CLI and begin a new task with your preferred model and relevant mode.
| Command | Description | Example |
|---|---|---|
kilocode |
Start interactive | |
/mode |
Switch between modes (architect, code, debug, ask, orchestrator) | /mode orchestrator |
/model |
Learn about available models and switch between them | |
/model list |
List available models | |
/model info |
Prints description for a specific model by name | /model info z-ai/glm-4.5v |
/model select |
Select and switch to a new model | |
/teams |
List all organizations you can switch into | |
/teams select |
Switch to a different organization | |
/config |
Open configuration editor (same as kilocode config) |
|
/new |
Start a new task with the agent with a clean slate | |
/help |
List available commands and how to use them | |
/exit |
Exit the CLI |
Kilo gives you the ability to bring your own keys for a number of model providers and AI gateways, like OpenRouter and Vercel AI Gateway. Each provider has unique configuration options and some let you set environment variables.
You can reference the Provider Configuration Guide for examples if you want to edit .config files manually. You can also run:
kilocode config
to complete configuration with an interactive workflow on the command line.
:::tip
You can also use the /config slash command during an interactive session, which is equivalent to running kilocode config.
:::
Parallel mode allows multiple Kilo Code instances to work in parallel on the same directory, without conflicts. You can spawn as many Kilo Code instances as you need! Once finished, changes will be available on a separate git branch.
# Prerequisite: must be within a valid git repository
# In interactive mode, changes will be committed on /exit
# Terminal 1
kilocode --parallel "improve xyz"
# Terminal 2
kilocode --parallel "improve abc"
# Pairs great with auto mode 🚀
# Terminal 1
kilocode --parallel --auto "improve xyz"
# Terminal 2
kilocode --parallel --auto "improve abc"
Autonomous mode allows Kilo Code to run in automated environments like CI/CD pipelines without requiring user interaction.
# Run in autonomous mode with a prompt
kilocode --auto "Implement feature X"
# Run in autonomous mode with piped input
echo "Fix the bug in app.ts" | kilocode --auto
# Run in autonomous mode with timeout (in seconds)
kilocode --auto "Run tests" --timeout 300
When running in Autonomous mode (--auto flag):
Autonomous mode respects your auto-approval configuration. Edit your config file with kilocode config to customize:
{
"autoApproval": {
"enabled": true,
"read": {
"enabled": true,
"outside": true
},
"write": {
"enabled": true,
"outside": false,
"protected": false
},
"execute": {
"enabled": true,
"allowed": ["npm", "git", "pnpm"],
"denied": ["rm -rf", "sudo"]
},
"browser": {
"enabled": false
},
"mcp": {
"enabled": true
},
"mode": {
"enabled": true
},
"subtasks": {
"enabled": true
},
"question": {
"enabled": false,
"timeout": 60
},
"retry": {
"enabled": true,
"delay": 10
},
"todo": {
"enabled": true
}
}
}
Configuration Options:
read: Auto-approve file read operations
outside: Allow reading files outside workspacewrite: Auto-approve file write operations
outside: Allow writing files outside workspaceprotected: Allow writing to protected files (e.g., package.json)execute: Auto-approve command execution
allowed: List of allowed command patterns (e.g., ["npm", "git"])denied: List of denied command patterns (takes precedence)browser: Auto-approve browser operationsmcp: Auto-approve MCP tool usagemode: Auto-approve mode switchingsubtasks: Auto-approve subtask creationquestion: Auto-approve follow-up questionsretry: Auto-approve API retry requeststodo: Auto-approve todo list updatesThe execute.allowed and execute.denied lists support hierarchical pattern matching:
"git" matches any git command (e.g., git status, git commit, git push)"git status" matches any git status command (e.g., git status --short, git status -v)"git status --short" only matches exactly git status --shortExample:
{
"execute": {
"enabled": true,
"allowed": [
"npm", // Allows all npm commands
"git status", // Allows all git status commands
"ls -la" // Only allows exactly "ls -la"
],
"denied": [
"git push --force" // Denies this specific command even if "git" is allowed
]
}
}
When running in interactive mode, command approval requests now show hierarchical options:
[!] Action Required:
> ✓ Run Command (y)
✓ Always run git (1)
✓ Always run git status (2)
✓ Always run git status --short --branch (3)
✗ Reject (n)
Selecting an "Always run" option will:
execute.allowed list in the configThis allows you to progressively build your auto-approval rules without manually editing the config file.
In Autonomous mode, when the AI asks a follow-up question, it receives this response:
"This process is running in non-interactive Autonomous mode. The user cannot make decisions, so you should make the decision autonomously."
This instructs the AI to proceed without user input.
0: Success (task completed)124: Timeout (task exceeded time limit)1: Error (initialization or execution failure)# GitHub Actions example
- name: Run Kilo Code
run: |
echo "Implement the new feature" | kilocode --auto --timeout 600
In order to run the CLI with devtools, add DEV=true to your pnpm start command, and then run npx react-devtools to show the devtools inspector.
Use the /teams command to see a list of all organizations you can switch into.
Use /teams select and start typing the team name to switch teams.
The process is the same when switching into a Team or Enterprise organization. The process is the same when switching into a Team or Enterprise organization.