CLI and GitHub Action
Run evals from the command line or in GitHub Actions with neurouter eval, fail a build below a minimum score, and keep the report.
The neurouter CLI runs the same eval engine as the console. Without a config it starts a temporary in-process server with a mock of your spec, so it needs nothing but the spec and your model key.
neurouter eval
npx neurouter eval --spec ./openapi.yaml --overlay ./acme-orders.overlay.yaml \
--suite ./suite.json --modes tool,code --repeats 3 \
--min-score 75 --out report.json --md report.md
| Option | Meaning |
|---|---|
--spec <file or url> / --overlay <file> | What to evaluate, without a config file |
--config neurouter.yaml --server <slug> | Or a server from your config |
--suite suite.json / --generate | Use a frozen suite, or generate tasks (the default without --suite; --counts per category, default 8,8,4,4) |
--save-suite suite.json | Keep the generated suite for the next run |
--models, --modes tool,code, --repeats 3 | What to run (--models defaults to the server's eval model) |
--env mock | Target environment (never prod) |
--min-score 75 | Exit 1 when the headline score is lower |
--out report.json, --md report.md | Write the report |
--suggest | Also print fix suggestions in the terminal |
Exit codes: 0 score at or above the minimum (or no minimum), 1 below the minimum, 2 error. The key for each model's provider is required (OPENAI_API_KEY for the default gpt-6-luna).
Freeze a suite with --save-suite once and pass it with --suite afterwards, so scores compare like with like.
GitHub Action
name: agent-readiness
on: pull_request
jobs:
readiness:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: neurouter/core/actions/eval@v0.2.1
with:
spec: openapi.yaml
overlay: neurouter/acme-orders.overlay.yaml
suite: neurouter/suite.json
min-score: 75
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
| Input | Default |
|---|---|
spec | required unless config and server are set |
config, server | — (a neurouter.yaml and the server to evaluate, instead of spec) |
overlay, suite | — |
models | gpt-6-luna |
modes | tool,code |
repeats | 3 |
min-score | 0 |
neurouter-version | the action's version: its tag (@v0.2.1 runs neurouter@0.2.1), or the CLI version at the referenced commit |
openai-api-key, anthropic-api-key, gemini-api-key | the one for each model's provider (openai-api-key for the default) |
The action writes the Markdown report to the job summary, uploads the JSON report as an artifact, and sets the outputs score, recommended-mode and report-path. The step fails when the CLI exits non-zero.
Results stay in the report
There is no upload command. A --spec run uses a temporary in-memory database, and a --config run writes to ./.neurouter, so a run appears in a server's eval history only when that server uses the same database. Keep the JSON and Markdown reports (the Action uploads the JSON report as the neurouter-report artifact).
Other commands
npx neurouter serve [--config neurouter.yaml] [--port 3000] [--host 127.0.0.1] [--data ./.neurouter] [--embeddings]
npx neurouter console-link [--data ./.neurouter]
npx neurouter validate [--config neurouter.yaml] [--print-schema]
npx neurouter compile --spec <file|url> [--overlay o.yaml] [--out tools.json] [--stubs dir/] [--namespace ns]
npx neurouter compile --graphql-endpoint <url> [--out tools.json]
npx neurouter mock --spec <file|url> [--port 4010] [--seed 42]
npx neurouter keys gen [keyId]
npx neurouter keys create --server <slug> --env <slug> [--scopes tools:read,code:run] [--name cli] [--data ./.neurouter]
compile exits 1 when the spec or the overlay has errors; with an invalid overlay it writes neither --out nor --stubs.