Judgment Labs Logo
Documentation

Judgment CLI (Deprecated)

Legacy documentation for the deprecated Judgment CLI

Deprecated as of July 9, 2026. The Judgment CLI is no longer under active development and is not recommended for new workflows. Existing releases remain available, but compatibility with future API changes is not guaranteed. Use the Judgment MCP server for agent workflows or the Python SDK and TypeScript SDK for programmatic integrations. Existing installations are not being shut down as part of this change. We may revisit a CLI in the future.

The documentation below is retained for existing CLI users.

For the full command and flag reference, see the CLI reference.

Legacy installation

curl -fsSL https://judgmentlabs.ai/install.sh | bash

Pin a specific version:

curl -fsSL https://github.com/JudgmentLabs/cli/releases/download/v0.1.0/install.sh | bash

The installer creates an isolated venv at ~/.local/share/judgment-cli/venv and symlinks judgment into ~/.local/bin. Override locations with INSTALL_DIR=... and PREFIX=.... Requires Python ≥ 3.9 — set PYTHON=... to pick a specific interpreter. Set NO_COMPLETIONS=1 to skip wiring up shell completions.

brew install JudgmentLabs/tap/judgment-cli

brew upgrade judgment-cli picks up new releases automatically. Formula source: JudgmentLabs/homebrew-tap.

The formula installs the zsh completion script in $(brew --prefix)/share/zsh/site-functions/. zsh picks it up once you've followed Homebrew's one-time shell-completion setup.

Authenticate

Log in

judgment login
# Opens your browser to authorize the CLI.

By default, judgment login opens your browser to complete an OAuth flow. Two flags adjust this behavior:

judgment login --api-key     # prompt for an API key instead of opening the browser
judgment login --no-browser  # print the authorization URL instead of opening a browser (useful for remote shells)

OAuth access tokens are refreshed automatically when they expire, so you stay logged in without re-running judgment login.

Credentials are written atomically with 0600 permissions to a platform-appropriate config dir resolved via platformdirs:

OSPath
macOS~/Library/Application Support/judgment/credentials.json
Linux$XDG_CONFIG_HOME/judgment/credentials.json (default ~/.config/...)
Windows%APPDATA%\JudgmentLabs\judgment\credentials.json

Use judgment configure to update stored credentials interactively, judgment status to see which sources are resolved, and judgment logout to delete the credentials file.

Other credential sources

PriorityMethodVariables / Path
1Env varsJUDGMENT_API_KEY, JUDGMENT_ORG_ID, JUDGMENT_BASE_URL, JUDGMENT_AUTH_URL
2Config fileWritten by judgment login

Environment variables always win over the config file.

Shell completion

The curl installer wires up completions automatically (zsh, bash, fish). To install completions manually:

# bash (~/.bashrc, or ~/.bash_profile on macOS)
eval "$(judgment completion bash)"

# zsh (~/.zshrc)
autoload -Uz compinit && compinit
eval "$(judgment completion zsh)"

# fish (~/.config/fish/completions/judgment.fish — auto-loaded)
judgment completion fish > ~/.config/fish/completions/judgment.fish

Quickstart

Run judgment --help for the full command list, and judgment <group> <command> --help for the flags on a specific command. JSON-shaped flags (filters, pagination, conditions, actions) accept inline JSON strings.

# Projects
judgment projects list <ORGANIZATION_ID>
judgment projects create <ORGANIZATION_ID> "My Project"

# Traces
judgment traces search    <ORGANIZATION_ID> <PROJECT_ID> --pagination '{"limit":25,"cursorSortValue":null,"cursorItemId":null}'
judgment traces get       <ORGANIZATION_ID> <PROJECT_ID> <TRACE_ID>
judgment traces spans     <ORGANIZATION_ID> <PROJECT_ID> <TRACE_ID>
judgment traces add-tags  <ORGANIZATION_ID> <PROJECT_ID> <TRACE_ID> --tags reviewed --tags urgent
judgment traces evaluate  <ORGANIZATION_ID> <PROJECT_ID> --trace-ids <TRACE_ID>

# Sessions
judgment sessions search          <ORGANIZATION_ID> <PROJECT_ID> --pagination '{"limit":25,"cursorSortValue":null,"cursorItemId":null}'
judgment sessions get             <ORGANIZATION_ID> <PROJECT_ID> <SESSION_ID>
judgment sessions trace-behaviors <ORGANIZATION_ID> <PROJECT_ID> <SESSION_ID>

# Behaviors / judges / automations
judgment behaviors list   <ORGANIZATION_ID> <PROJECT_ID>
judgment judges list      <ORGANIZATION_ID> <PROJECT_ID>
judgment judges upload    ./my_judge.py -o <ORGANIZATION_ID> -p <PROJECT_ID>
judgment automations list <ORGANIZATION_ID> <PROJECT_ID>

# Prompts
judgment prompts list     <ORGANIZATION_ID> <PROJECT_ID>
judgment prompts get      <ORGANIZATION_ID> <PROJECT_ID> <PROMPT_NAME> [--commit-id <SHA> | --tag <TAG>]
judgment prompts versions <ORGANIZATION_ID> <PROJECT_ID> <PROMPT_NAME>
judgment prompts commit   <ORGANIZATION_ID> <PROJECT_ID> <PROMPT_NAME> "<PROMPT_TEXT>" [--tags production --tags staging]
judgment prompts tag      <ORGANIZATION_ID> <PROJECT_ID> <PROMPT_NAME> <COMMIT_ID> --tags production
judgment prompts untag    <ORGANIZATION_ID> <PROJECT_ID> <PROMPT_NAME> --tags production

# Docs
judgment docs search   "how do I instrument my app"
judgment docs get-page /docs/getting-started

For the per-group, per-command, per-flag reference — including the JSON shapes accepted by complex flags like --conditions, --actions, --filters, and --span-triggers — see the CLI reference.

Development

The CLI source lives at JudgmentLabs/cli. Most command implementations are regenerated from the API's OpenAPI spec:

uv sync --extra dev
uv run python scripts/generate_cli.py

generate_cli.py rewrites src/judgment_cli/generated_commands.py from the OpenAPI spec. Pass --spec <url-or-file> to point at a different spec.

Last updated on