See the Documentation for details on contributing.
There are lots of ways to contribute to the project:
- Code Contributions: Implement new features or fix bugs
- Documentation: Improve existing docs or create new guides
- Bug Reports: Report issues you encounter
- Feature Requests: Suggest new features or improvements
- Community Support: Help other users in the community
The Kilo Community is on Discord.
- Node.js 24 (
.nvmrcpins24.14.1) — required for all packages. - pnpm 11.1.2 — use Corepack so the active version matches
package.jsonpackageManager:corepack enable corepack prepare pnpm@11.1.2 --activate - Docker / Docker Compose — required to run the local PostgreSQL database.
nvm install && nvm use
pnpm installRun the interactive setup CLI to bootstrap .env.local from the example:
pnpm dev:setup-envThis prompts for the 8 required env vars only, generates secrets automatically where appropriate, then writes .env.local. If you already have a .env.local (e.g., from Vercel pull or a previous setup), the CLI warns you before overwriting anything.
After it completes, run:
pnpm dev:envFor the full list of environment variables, see ENVIRONMENT.md.
Kilo employees adding or rotating shared web env vars should use pnpm web:env set <VARIABLE> instead of editing Vercel projects or tracked dotenv defaults independently. The helper coordinates tracked dotenv files, Vercel deployments, and 1Password where needed.
docker compose -f dev/docker-compose.yml up -dThis starts PostgreSQL on localhost:5432 with user postgres / password postgres.
pnpm drizzle migrateRe-run this after pulling new migrations. To fully reset:
pnpm dev:db:reset
pnpm drizzle migrateTo smoke-test migrations from a fresh database:
pnpm drizzle:verify-bootstrappnpm dev:startThis launches a tmux dashboard with the Next.js app and local infrastructure. The web app is available at http://localhost:3000.
To stop all services:
pnpm dev:stoppnpm testAll tests should pass against the local PostgreSQL database.
Key locations:
apps/web/— Next.js web application and main UI codeapps/mobile/— React Native mobile appservices/— Cloudflare Worker services (KiloClaw, cloud agent, etc.)packages/— shared libraries (@kilocode/db,@kilocode/trpc,@kilocode/worker-utils)dev/— local dev tooling (docker-compose, tmux scripts, env sync, seed data)scripts/— CI and one-off scriptspackages/db/src/schema.ts— database schema; migrations inpackages/db/src/migrations/apps/web/src/routers/— tRPC routers
The repo includes a seed runner for creating local fixtures via pnpm dev:seed. Run it with no args to see all available topics.
pnpm dev:seed app:create-user <name> <email>— creates akilocode_usersrow with a real Stripe test customer, pre-bypassing onboarding gates so you can use the app immediately.pnpm dev:seed app:add-credits <user-id> <usd>— grants credits to an existing user, updating thetotal_microdollars_acquiredbalance and creating acredit_transactionsrow. Supports--paid/--free,--category,--expires-in-days, etc. Useful for testing billing and credit flows without manual DB edits.
pnpm dev:seed kiloclaw:fake-instance <user-id> [options]— creates a fake personal KiloClaw instance + subscription in the database only (no real container or Worker). Before creating, it retires any prior fake personal instances for that user. Supports--plan=trial|standard|commitand--days=<n>. For paid plans, it also grants enough credits to cover the plan cost and then deducts the subscription cost.pnpm dev:seed kiloclaw:fake-org-instance <user-id> <org-id> [options]— same as above, but creates an instance belonging to an organization rather than a personal account.pnpm dev:seed kiloclaw:referrals-<scenario>— seeds KiloClaw referral fixtures. Topics includereferrals-happy-path,referrals-pending-referrer,referrals-cap-boundary, andreferrals-support-override.pnpm dev:seed kiloclaw-billing:inactive-trials— seeds inactive-trial billing fixtures. One user is provisioned through the real KiloClaw worker endpoint (/api/platform/provision), while others are DB-only rows representing users in recently-started, support-marked, or eligible inactive-trial states.
| Command | Description |
|---|---|
pnpm dev:start |
Start all local services in a tmux dashboard |
pnpm dev:stop |
Stop the tmux session and all services |
pnpm dev:status |
Live status of running services |
pnpm dev:restart |
Restart a running service |
pnpm dev:env |
Sync .dev.vars files from .env.local |
pnpm web:env set <VARIABLE> |
Add or rotate shared web env vars across dotenv defaults, Vercel, and 1Password |
pnpm test |
Run the Jest test suite |
pnpm test:e2e |
Run Playwright end-to-end tests |
pnpm typecheck |
Run TypeScript type checking |
pnpm lint |
Lint all source files |
pnpm format |
Auto-format all supported files with oxfmt |
pnpm validate |
Run typecheck, lint, and tests together |
pnpm drizzle migrate |
Apply pending database migrations |
pnpm drizzle generate |
Generate a new migration after schema changes |
pnpm --filter <package> testWorkers are started individually as needed:
cd services/<worker-name>
pnpm dev # or: wrangler devUse pnpm dev:start <group> to run groups of related services via the tmux dashboard. The easiest way to manage workers during development is through the dev dashboard.
Sign in without real OAuth:
http://localhost:3000/users/sign_in?fakeUser=<email>
Use an @admin.example.com email for fake admin access:
http://localhost:3000/users/sign_in?fakeUser=<email>@admin.example.com
Append callbackPath to redirect after login:
http://localhost:3000/users/sign_in?fakeUser=<email>&callbackPath=/profile
- Direct commits to
mainare blocked. Always work on a feature branch. - The pre-push hook runs
pnpm format:check,pnpm lint, andpnpm typecheck --changes-only.
Use conventional commit style PR titles:
feat: add MCP settings tabfix: correct Windows path handlingdocs: clarify issue template requirementschore: bump TypeScript versionrefactor: extract diff renderer into a hooktest: cover ServerManager orphan cleanup
AI and coding agents are allowed, but contributors own the work they submit. Before requesting review, make sure you personally understand the change, have tested it appropriately, can explain the diff, and understand how it interacts with the affected packages and the rest of the repo.
Maintainers may close PRs that appear to be submitted without credible contributor ownership or understanding, including AI-assisted work that the contributor cannot explain or has not meaningfully reviewed.
Do not submit batches of agent-generated, untested, or weakly reviewed PRs.
Please keep concurrent PRs focused and limited. As a rule, open no more than three PRs at a time, especially if you are a new contributor. Prioritize high-impact or high-priority issues first instead of opening many speculative fixes. If a contributor opens a large batch of low-value or duplicative PRs, maintainers may close the batch and ask the contributor to choose one PR to reopen, focus, and bring up to the documented review bar before submitting more.
For issues, do not mass-create tickets through automation or agents. Search existing issues first, open issues only when you have enough context for someone to act, and prioritize the most important reports instead of filing every possible finding. Maintainers may close duplicate, low-signal, automated, or weakly reviewed issues without action.
Repeated disregard of this contribution guide, or high-volume automated or agent-generated tracker spam across issues or PRs, may result in maintainers blocking the responsible account.