CLI Reference
Command Reference
All commands, flags, and exit codes for the gauntletci CLI tool.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success; no findings detected |
| 1 | Findings detected, or invalid input |
| 2 | Unhandled error or exception |
gauntletci analyze
Analyze a git diff for change-risk. Runs all enabled rules and reports findings. Exactly one diff source should be specified; if none is provided, diff content is read from stdin.
| Flag | Description |
|---|---|
| --diff <path> | Path to a .diff file |
| --commit <sha> | Commit SHA to analyze |
| --staged | Analyze staged changes (git diff --cached) |
| --unstaged | Analyze unstaged changes (git diff) |
| --all-changes | Analyze all local changes: staged and unstaged |
| --repo <path> | Repository root for config loading and git operations. Defaults to CWD. |
| --output <format> | Output format: text (default) or json |
| --sensitivity <level> | Confidence-based noise filter: strict (Block+High/Medium only), balanced (default: Block-all + Warn+High/Medium), permissive (all Block + all Warn) |
| --severity <level> | Minimum severity gate: info, warn (default), block. Applied before --sensitivity. |
| --verbose | Show Info-severity findings. Equivalent to --severity info. |
| --with-llm | Enable local LLM enrichment for High-confidence findings |
| --github-annotations | Emit GitHub Actions workflow commands for inline PR annotations |
| --no-baseline | Ignore the baseline file and show all findings |
| --show-context <n> | Include N surrounding diff lines around each finding |
| --no-banner | Suppress the ASCII banner |
Examples
# Analyze staged changes before a commit
$ gauntletci analyze --staged
# Analyze all local changes
$ gauntletci analyze --all-changes
# Analyze a specific commit
$ gauntletci analyze --commit abc1234
# Analyze from a saved diff file
$ gauntletci analyze --diff changes.diff
# Pipe from stdin
$ git diff HEAD | gauntletci analyze
# Output JSON for downstream tooling
$ gauntletci analyze --staged --output json
# Enable local LLM enrichment
$ gauntletci analyze --staged --with-llm
# Emit GitHub Actions inline annotations
$ gauntletci analyze --staged --github-annotations
# Strict CI gate: Block severity + High/Medium confidence only
$ gauntletci analyze --staged --sensitivity strict
# Show everything including low-confidence warnings
$ gauntletci analyze --staged --sensitivity permissive
gauntletci init
Install a pre-commit hook in the current repository. The hook runs gauntletci analyze --staged before every commit and blocks the commit if findings are detected.
gauntletci baseline
Manage finding baselines. Capture a snapshot of current findings to suppress them from future runs; only net-new risks introduced after the baseline will be reported.
$ gauntletci baseline capture --staged
# Save current findings to .gauntletci-baseline.json
gauntletci doctor
Validate your installation and configuration. Checks that git, the .NET runtime, and optional dependencies like Ollama are correctly configured.
Environment variables
| Variable | Description |
|---|---|
| GITHUB_TOKEN | Personal access token for GitHub API. Required for corpus commands on private repos. |
| GAUNTLETCI_NO_BANNER | Set to any non-empty value to suppress the ASCII banner. |
| CI | Suppresses banner and telemetry prompt automatically. |
| GITHUB_ACTIONS | Suppresses banner and telemetry prompt (set automatically by GitHub Actions runners). |
| TF_BUILD | Suppresses banner and telemetry prompt (Azure Pipelines). |
