Skip to content

CLI reference

Agent Evaluation commands extend the sp CLI with the same --json envelope as Testing. Commands resolve or execute a WorkflowVersion (framework suite + subject + environment + runner).

Commands

CommandPurpose
sp eval packClose FrameworkDefinition (hash all file refs)
sp eval validateValidate pins, runner capabilities, closed definition
sp eval runExecute FrameworkAttempt locally or on managed host
sp eval compareDiff selected fields / projections across WorkflowRuns
sp eval publishUpload local JSONL bundle to thelake (managed)
sp eval promoteRecord authorized workflow/gate promotion for release audit

Pack and validate

bash
sp eval pack --dir ./promptfoo-suite --out .softprobe/definition.json --json

sp eval validate \
  --definition .softprobe/definition.json \
  --runner promptfoo-runner@2.1.0 \
  --subject support-router@sha256:... \
  --environment ci-noop@sha256:... \
  --out .softprobe/workflow.resolved.json \
  --json

Returns typed diagnostics for unpinned files, disallowed capabilities, and runner compatibility — no assertion translation and no model spend.

Run

bash
sp eval run --workflow .softprobe/workflow.resolved.json \
  --out-dir .sp-work/runs/latest \
  --json

Local execution writes JSONL events plus content-addressed artifacts (including the native result bundle). Exit code 1 when GateDecision fails (unless --no-gate).

Compare

bash
sp eval compare --baseline run-a --candidate run-b \
  --gate-policy sha256:... \
  --json

Emits selected field/projection deltas and gate outcome for promotion workflows.

JSON envelope

Same contract as Testing output contract:

json
{
  "ok": true,
  "command": "eval run",
  "data": { "workflow_run_id": "...", "gate": "pass" }
}

Exit codes

CodeMeaning
0Success; gate passed (if evaluated)
1API/kernel error or gate failed
2Usage / invalid workflow
3Auth / tenant context missing

See Result status for FrameworkAttempt statuses (distinct from CLI exit codes).

Zero code changes · Full-context visibility · Cost optimization