CLI Reference

Command Reference

All commands, flags, and exit codes for the gauntletci CLI tool.

Exit codes

CodeMeaning
0Success; no findings detected
1Findings detected, or invalid input
2Unhandled 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.

FlagDescription
--diff <path>Path to a .diff file
--commit <sha>Commit SHA to analyze
--stagedAnalyze staged changes (git diff --cached)
--unstagedAnalyze unstaged changes (git diff)
--all-changesAnalyze 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.
--verboseShow Info-severity findings. Equivalent to --severity info.
--with-llmEnable local LLM enrichment for High-confidence findings
--github-annotationsEmit GitHub Actions workflow commands for inline PR annotations
--no-baselineIgnore the baseline file and show all findings
--show-context <n>Include N surrounding diff lines around each finding
--no-bannerSuppress 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 init

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.

$ gauntletci doctor

Environment variables

VariableDescription
GITHUB_TOKENPersonal access token for GitHub API. Required for corpus commands on private repos.
GAUNTLETCI_NO_BANNERSet to any non-empty value to suppress the ASCII banner.
CISuppresses banner and telemetry prompt automatically.
GITHUB_ACTIONSSuppresses banner and telemetry prompt (set automatically by GitHub Actions runners).
TF_BUILDSuppresses banner and telemetry prompt (Azure Pipelines).

Next steps