|
1 | | -# cli |
| 1 | +# `regtrace` CLI |
2 | 2 |
|
3 | | -To install dependencies: |
| 3 | +The regtrace CLI binary — evaluates LLM outputs against golden-set expectations across Factuality, Format, Tone, and Regression. |
| 4 | + |
| 5 | +## Development |
4 | 6 |
|
5 | 7 | ```bash |
6 | | -bun install |
| 8 | +bun install # install workspace deps |
| 9 | +bun run --cwd packages/cli test # run 159 tests |
| 10 | +bun test -t "test name" # single test by name |
7 | 11 | ``` |
8 | 12 |
|
9 | | -To run: |
| 13 | +## Build |
10 | 14 |
|
11 | 15 | ```bash |
12 | | -bun run index.ts |
| 16 | +bun run build # compile + minify → ./regtrace |
| 17 | +bun run build --outfile ./myname # custom output path |
| 18 | +``` |
| 19 | + |
| 20 | +Uses `bun build --compile --minify src/index.ts`. Version injected via `--define __VERSION__`. |
| 21 | + |
| 22 | +## Layout |
| 23 | + |
13 | 24 | ``` |
| 25 | +src/ |
| 26 | +├── cli/ Commander commands (run, init, list, history, watch, baseline) |
| 27 | +├── judge/ LLM providers (anthropic, openai, gemini, groq, ollama) |
| 28 | +├── metrics/ Evaluators (factuality, format, tone, regression) |
| 29 | +├── reports/ Terminal, JSON, markdown reporters + quality gates |
| 30 | +├── schema/ Zod v5 schemas (config, golden-set, run-record) |
| 31 | +├── storage/ Config/GS loading, JSON/SQLite persistence |
| 32 | +├── utils/ Concurrency, env, hashing, logging |
| 33 | +└── index.ts Entrypoint |
| 34 | +tests/ |
| 35 | +├── unit/ Unit tests mirrored to src/ structure |
| 36 | +├── integration/ cli.test.ts, baseline.test.ts |
| 37 | +└── fixtures/ Configs, golden sets, run records |
| 38 | +``` |
| 39 | + |
| 40 | +## Conventions |
| 41 | + |
| 42 | +- No comments in source. Self-documenting code only. |
| 43 | +- Zod v5 for schemas. No `z.infer` — write explicit types. |
| 44 | +- `noUncheckedIndexedAccess: true` — always guard array access. |
| 45 | +- Biome lint/format: tabs, double quotes. |
| 46 | +- CLI output via `src/cli/print.ts` — never raw `console.log`. |
| 47 | + |
| 48 | +## Integration tests |
14 | 49 |
|
15 | | -This project was created using `bun init` in bun v1.3.14. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime. |
| 50 | +Spawn `Bun.spawn` child processes with minimal env. Temp dirs under `.test-tmp/`. Two tests have pre-existing stream-race flakiness; CI uses `--retry 2`. |
0 commit comments