- Bun 1.3+
- Node.js 22+ (for docs)
git clone https://github.com/decimozs/regtrace
cd regtrace
bun installregtrace/
├── packages/cli/ # CLI binary (source + tests)
│ ├── src/ # TypeScript source
│ │ ├── cli/ # Command implementations
│ │ ├── judge/ # LLM judge providers
│ │ ├── metrics/ # Evaluators (factuality, format, tone, regression)
│ │ ├── schema/ # Zod schemas + validators
│ │ ├── storage/ # Config loading, run persistence
│ │ └── reports/ # Output reporters (terminal, JSON, markdown)
│ └── tests/ # Unit + integration tests
├── apps/docs/ # Documentation site (Next.js + Fumadocs)
└── scripts/ # Build scripts
All commands run from the repo root or packages/cli/:
# Test
bun test # Run all 159 tests
bun run --cwd packages/cli test
# Typecheck
bun run --cwd packages/cli typecheck # tsc --noEmit
# Lint + format
bun run lint # biome check
# Build binary
bun run build # outputs ./regtrace (minified)
bun run build --outfile ./my-custom-name # custom output path
bun run build --minify # explicit minification flag
bun run build --no-minify # skip minification
# Build docs
bun run --cwd apps/docs build
# Dev (docs)
bun run --cwd apps/docs dev- Create
packages/cli/src/judge/providers/<name>.tsimplementingJudgeProvider - Register in
packages/cli/src/judge/providers.ts - Add provider string to
providerSchemainconfig.schema.ts - Add tests in
packages/cli/tests/unit/judge/ - Add
ANTHROPIC_API_KEY-style env var handling inproviders.ts
- Create
packages/cli/src/metrics/evaluators/<name>.evaluator.tsmatching theMetricEvaluatorinterface - Register in the
EVALUATOR_MAPinrunner.ts - Add config schema block in
config.schema.ts - Add tests in
packages/cli/tests/unit/metrics/
- Update version in
packages/cli/package.json git tag v<version>(e.g.,git tag v1.0.1)git push origin v<version>— triggers.github/workflows/release.yml- Workflow builds binaries for Linux x86-64, macOS ARM64, Windows x86-64 and creates a GitHub release
- No comments in source code. Code should be self-documenting.
- Zod v5 for validation. Use explicit types, never
z.infer. noUncheckedIndexedAccess: true— handle array access with checks or assertions.verbatimModuleSyntax: true— useimport typefor type-only imports.- Biome for linting and formatting (config at root and per-package).
- Conventional commits:
feat:,fix:,docs:,chore:, etc.