This file provides guidance to AI agents when working with the Kilo Code CLI package.
The CLI is a standalone Node.js process that embeds the VSCode extension core. Each CLI instance runs in its own process, enabling parallel execution - this is how the agent manager spawns multiple agents working simultaneously.
kilocode invocation is a separate process with its own stateClineProvider via handleCLIMessage() - all webview messages route through this methodcli/src/host/VSCode.ts provides a complete mock of the VSCode APIcli/src/host/ExtensionHost.ts loads the extension and registers as a webview providerCLI UI (Ink/React) → Jotai Atoms → ExtensionService → ExtensionHost → ClineProvider.handleCLIMessage()
The CLI sends messages to ClineProvider the same way the VSCode webview does, just through handleCLIMessage() instead of postMessage().
# From root: build extension + CLI
pnpm cli:bundle
# Run CLI
cd cli && pnpm start
# Development (watch mode)
cd cli && pnpm start:dev
| File | Purpose |
|---|---|
src/cli.ts |
Main CLI class |
src/host/ExtensionHost.ts |
Loads extension, routes messages |
src/host/VSCode.ts |
VSCode API mock |
src/services/extension.ts |
Service layer wrapper |