Thanks for your interest in contributing. This guide covers everything you need to get started.
- Bun — runtime, package manager, and test runner
- Git
- PostgreSQL (optional) — required only for database-backed tests and local runs with persistence
git clone https://github.com/kodiai/kodiai.git
cd kodiai
bun install
cp .env.example .envEdit .env with your configuration. See .env.example for all available variables with descriptions. At minimum you need:
GITHUB_APP_ID,GITHUB_PRIVATE_KEY(orGITHUB_PRIVATE_KEY_BASE64),GITHUB_WEBHOOK_SECRETCLAUDE_CODE_OAUTH_TOKENDATABASE_URL— PostgreSQL connection string
bun run dev # Start with file watching (auto-restart on changes)
bun run start # Start without watchingThe server listens on PORT (default 3000).
Run the full test suite:
bun testTests are located alongside source files as *.test.ts. The test runner is configured to scan src/ only (see bunfig.toml).
Tests that require PostgreSQL use the describe.skipIf pattern to skip automatically when no database is available:
const TEST_DB_URL = process.env.TEST_DATABASE_URL;
describe.skipIf(!TEST_DB_URL)("MyStore (pgvector)", () => {
// tests that need a live database
});To run database tests, set TEST_DATABASE_URL in your environment:
TEST_DATABASE_URL="postgresql://localhost:5432/kodiai_test" bun testWithout TEST_DATABASE_URL, these tests are silently skipped — the rest of the suite still runs.
The project uses TypeScript with strict mode enabled (tsconfig.json). All code should pass tsc with no errors.
Use pino for structured logging — not console.log. The app initializes a pino logger; import and use it for any runtime output.
Use Zod schemas for input validation, configuration parsing, and data shape enforcement. Prefer Zod over manual validation logic.
Use bun:test (describe, it, expect) for all tests. Test files live next to the code they test with a .test.ts suffix.
- Branch from
main - Write descriptive commit messages
- Ensure
bun testpasses (non-DB tests at minimum) - Open a PR with a clear description of what changed and why
- Address review feedback
For a detailed module map and architectural overview, see docs/architecture.md.
Key top-level directories:
src/— application source codedocs/— project documentationscripts/— operational and migration scripts