Skip to content

Development setup

Donovan Maidens edited this page Nov 19, 2026 · 1 revision

Development Setup

Requirements

  • Go at the version in the go line of go.mod (currently Go 1.26.11)
  • Node.js at the version in the engines field of package.json — brings npm, which runs the build/test scripts
  • Python 3 for npm run screens
  • git on your PATH

Install the lint and security tools once from the repository root:

npm run tools

Run from a clone

git clone https://github.com/djm56/kirsch.git
cd kirsch
go run ./cmd/kirsch

This runs Kirsch directly from source inside the clone directory (which is itself a Git repository).

Build and test

Run these from the repository root.

Task Command
Build the binary npm run build
Run from source npm start
Unit tests npm test
Tests with the race detector npm run test:race
Format, vet, lint, test and screens npm run check
Security scans npm run security
Fuzz targets npm run fuzz
Every CI job, run locally npm run ci:local

npm run check is the minimum before opening a pull request. npm run ci:local mirrors exactly what the CI workflow runs. It downloads the pinned golangci-lint version into bin/ (git-ignored) and overwrites govulncheck and gosec in your Go bin with their latest releases.

The built binary is written to bin/kirsch inside the checkout.

Golden screens

The golden screens are character grids in plan/spec/kirsch-ui-screens.md. A test compares the renderer's output with each grid. To regenerate them:

  1. Run the regen test:

    KIRSCH_REGEN=1 go test ./internal/tui -run TestGenerateGrids

    This writes the current render of every scenario to /tmp/kirsch-grids.txt. It does not change the screens document.

  2. Reconcile each changed grid in plan/spec/kirsch-ui-screens.md by hand.

  3. Run go test ./internal/tui, then npm run screens.

  4. A reviewer must look at the screens diff before it merges. Automated tools do not accept golden changes.

Smoke test

The smoke test runs one real task against testdata/repo-go-module with a live model. It needs an API key and spends tokens:

bash scripts/smoke-test.sh

It is not one of the npm scripts and is not run by CI. Set ANTHROPIC_API_KEY, OPENCODE_API_KEY, or their KIRSCH_ forms before running it.

Clone this wiki locally