Skip to main content
Complete command reference for all Switch Trust CLI commands.

switch-trust init

Setup wizard that configures Switch Trust CLI for first use. Creates the ~/.switch-trust directory with a .env file (LLM provider, API key, runtime settings) and a config.json skeleton. Runs automatically on first use in non-CI environments. You can re-run it at any time to reconfigure.
Initial setup for:
  1. LLM provider — gemini, openai, anthropic, or litellm
  2. Model name — Specific model to use (provider-specific defaults apply)
  3. API key — API key for the selected provider

switch-trust scan

The switch-trust scan command needs OpenGrep installed and an LLM provider installed. See Init for a guided setup, or Environment Variables for manual steps.
The model that powers AI reasoning and triage comes from GENERATOR_MODEL, not from a flag. See Environment variables. What gets scanned: a requirements.txt file, or a .py file that imports a supported framework. Point at a directory and the scan walks it for those files. Point at a single file that doesn’t qualify and the scan stops with No scannable targets found.

switch-trust eval

Before you can run switch-trust eval commands, you need a valid configuration file. switch-trust init creates this file by default in ~/.switch-trust/config.json. See the Configuration section for adding models and evaluations. Every switch-trust eval subcommand accepts these two flags:

Show models

Shows information about the configured models.

Show evaluations

Shows information about the configured evaluations (built-in and custom).

Model-evaluation assignments

Shows information about the assignments of evaluations to models.

Attach evaluations to models

Creates model-evaluation assignments. Accepts models and evaluations by ID (repeatable) or by tag. Creates the cross-product of all matched models and evaluations.
Duplicate assignments (same model + evaluation pair) are automatically skipped.

Detach evaluations from models

Removes model-evaluation assignments. Same flexible selection as attach. At least one of --model/--model-tag or --eval/--eval-tag is required.

Run evaluations

Runs evaluations as configured. Supports a series of parameters to filter which evaluations and models should be run.
--format applies to switch-trust eval run only. The other switch-trust eval subcommands print to the terminal.

Global options

--version is the only flag accepted before a command. Everything else belongs to a specific command: --log works on switch-trust scan and on any switch-trust eval subcommand, --config works on any switch-trust eval subcommand, and --output and --format work on switch-trust scan and switch-trust eval run.