Subcommands
The CLI uses the project of your
langwatch login, or the key in LANGWATCH_API_KEY. Reading runs needs analytics:view; starting or cancelling one needs analytics:manage.
run
--ask when you want several. estimate takes the same flags, less --name, --estimate, --detach and --show.
What run prints
The statement it wrote and the two window values, then one progress line that updates in place:results command that reads the rest:
status line that reads it back.
Exit code
run exits 0 when the run finished and non-zero when it failed, was cancelled or was interrupted before it ended, so a script can tell a red run from a green one. --detach exits 0 as soon as the run is created.
estimate
status
- its id, name and status
- rows judged over rows total, the matched count, and the unjudged rows
- the tokens and the cost
- the questions, the matches per question, and the statement
--wait to follow the run until it ends, for up to 45 minutes or the number of minutes you give. It exits non-zero when the run failed.
A run’s status is one of queued, planning, running, finished, failed or cancelled.
list
results
Each verdict prints as the trace, the question, the status, the answer with its probability, and the conversation. See Results for the JSON shape.
sample
-n, --number <n> sets how many rows to read, at most 25 (default 5). The text is re-read through the run’s own statement, so sampling judges no row again and is not charged. A text longer than 2,000 characters is cut on screen; read it whole with -o json.
cancel
instant_eval_already_finished.
Output formats
Every subcommand takes the shared output flags:-o table|json|agents|yaml, --json <fields> and --jq <path>.
In -o json, run still waits for the run and prints one document holding the run and the verdicts of the rows it showed. The statement is a field of that document rather than a printed block, and the progress line goes to standard error, so standard output holds one object.