Welcome to the Kilo Code development guide! This document will help you set up your development environment and understand how to work with the codebase. Whether you're fixing bugs, adding features, or just exploring the code, this guide will get you started.
Before you begin, make sure you have the following installed:
Fork and Clone the Repository:
Clone Your Fork:
git clone https://github.com/[YOUR-USERNAME]/kilocode.git
cd kilocode
Replace [YOUR-USERNAME] with your actual GitHub username.
Install dependencies:
npm run install:all
This command will install dependencies for the main extension, webview UI, and e2e tests.
Install VSCode Extensions:
While not strictly necessary for running the extension, these extensions are recommended for development:
The full list of recommended extensions is here
The project is organized into several key directories:
src/ - Core extension code
core/ - Core functionality and toolsservices/ - Service implementationswebview-ui/ - Frontend UI codee2e/ - End-to-end testsscripts/ - Utility scriptsassets/ - Static assets like images and iconsTo run the extension in development mode:
F5 (or select Run → Start Debugging) in VSCodeIn development mode (NODE_ENV="development"), changing the core code will trigger a workbench.action.reloadWindow command, so it is no longer necessary to manually start/stop the debugger and tasks.
Important: In production builds, when making changes to the core extension, you need to:
- Stop the debugging process
- Kill any npm tasks running in the background (see screenshot below)
- Start debugging again
To build a production-ready .vsix file:
npm run build
This will:
.vsix file in the bin/ directoryTo install your built extension:
code --install-extension "$(ls -1v bin/kilo-code-*.vsix | tail -n1)"
Replace [version] with the current version number.
Kilo Code uses several types of tests to ensure quality:
Run unit tests with:
npm test
This runs both extension and webview tests.
To run specific test suites:
npm run test:extension # Run only extension tests
npm run test:webview # Run only webview tests
E2E tests verify the extension works correctly within VSCode:
Create a .env.local file in the root with required API keys:
OPENROUTER_API_KEY=sk-or-v1-...
Run the integration tests:
npm run test:integration
For more details on E2E tests, see e2e/VSCODE_INTEGRATION_TESTS.md.
Ensure your code meets our quality standards:
npm run lint # Run ESLint
npm run check-types # Run TypeScript type checking
This project uses Husky to manage Git hooks, which automate certain checks before commits and pushes. The hooks are located in the .husky/ directory.
Before a commit is finalized, the .husky/pre-commit hook runs:
main branch.npm run generate-types.src/exports/roo-code.d.ts by the type generation are staged.lint-staged to lint and format staged files.Before changes are pushed to the remote repository, the .husky/pre-push hook runs:
main branch.npm run compile to ensure the project builds successfully..changeset/ and reminds you to create one using npm run changeset if necessary.These hooks help maintain code quality and consistency. If you encounter issues with commits or pushes, check the output from these hooks for error messages.
npm run install:allconsole.log() statements in your code for debuggingWe welcome contributions to Kilo Code! Here's how you can help:
Your contributions are welcome! For questions or ideas, please join our Discord server: https://discord.gg/Ja6BkfyTzJ
We look forward to your contributions and feedback!