CLI reference

augur <command> [options]

Commands: check (default), gate, calibrate, explain. All commands require git on PATH. augur runs on macOS and Linux.

Scope (shared by check, gate, explain)

augur is range-first. Pick one scope; the default is the working tree.

FlagScope
(none)Working tree vs HEAD (staged + unstaged).
--range <a..b>An explicit git range, e.g. main..HEAD.
--stagedStaged changes only (git diff --cached); ideal for pre-commit.
-C, --path <dir>Path to the repository (default .).

check

Assess a change and print a risk verdict.

augur check                          # working-tree changes
augur check --range main..HEAD       # a range
augur check --staged                 # staged changes
augur check -v                       # show every contributing signal
augur check --json                   # machine-readable, sorted-key JSON
augur check --sarif                  # SARIF 2.1.0 for GitHub code scanning
augur check --sarif-out augur.sarif  # write SARIF to a file (implies --sarif)
augur check --cached                 # reuse .augur/cache.json (run `calibrate` first)
augur check --coverage lcov.info     # sharpen test-gap with coverage
augur check --exclude 'vendor/**'    # drop paths from the assessment (repeatable)
FlagEffect
-v, --verboseShow every contributing signal per file (not just the top one).
--jsonEmit stable, sorted-key JSON. Mutually exclusive with --sarif.
--sarifEmit SARIF 2.1.0. See ci-integration.md.
--sarif-out <path>Write SARIF to a file (implies --sarif).
--cachedReuse the calibration cache instead of re-walking git log.
--coverage <path>Coverage report to sharpen test-gap. See coverage.md.
--no-coverageDisable coverage auto-detection.
--exclude <glob>Exclude matching paths (repeatable). See glob syntax.
--no-excludeIgnore [exclude] from config (CLI --exclude still applies).
--no-codeownersDisable CODEOWNERS discovery (the codeowners signal stays neutral).
--config <path>Use an explicit .augur.toml.
--no-configIgnore any .augur.toml.
--color <mode>auto (default), always, or never. See Color output.

check always exits 0 (it reports; it does not gate). Use gate for CI.

Color output

The human-readable report is colored by meaning: the verdict and per-file markers are tinted green (proceed) / amber (review) / red (block), the / risk meter is tinted by the same scale, file paths are cyan, and secondary detail is dimmed.

--color controls it, and applies to check, gate, and explain:

ModeBehavior
auto (default)Color only when stdout is an interactive TTY.
alwaysForce color even when piped or redirected.
neverNever emit ANSI codes.

In auto, augur also honors the NO_COLOR convention: if NO_COLOR is set in the environment, color is disabled. --json and --sarif output is always plain regardless of --color, so machine-readable streams never carry escape codes.

gate

Assess, then exit non-zero when the verdict meets or exceeds a threshold. For CI pipelines and agent loops.

augur gate --threshold review        # exit 1 if verdict >= review
augur gate --threshold block --staged
augur gate --json
FlagEffect
--threshold <verdict>proceed, review, or block (default review).
--jsonEmit JSON (else a one-line summary).

gate also accepts every scope, coverage, exclude, codeowners, and config flag that check does.

Exit codes:

CodeMeaning
0Verdict below the threshold (or no changes to assess).
1Verdict met or exceeded the threshold.
2Usage / validation error (e.g. an invalid --threshold).

calibrate

Walk history once and cache the calibration model to .augur/cache.json, pinned to HEAD, so check --cached can skip the git log walk.

augur calibrate
augur calibrate --json
FlagEffect
-C, --path <dir>Path to the repository.
--jsonEmit the cache as JSON.

Output reports the cached HEAD, the commit/incident volume, and the calibration band (prior-only / weak / history-backed).

explain

Optional AI explanation of an assessment, delegated to fledge ask. augur itself stays AI-free; this is purely additive and needs no key of its own if fledge is configured.

augur explain
augur explain --range main..HEAD

If fledge is unavailable, the plain assessment is printed and augur notes that no AI is required to use it.

Glob syntax

Used by --exclude / [exclude] and (after gitignore-style translation) CODEOWNERS. Patterns are anchored to the whole path:

TokenMatches
*Any run of characters except / (within one path segment).
**Any run of characters including / (and zero or more segments).
?Exactly one character.
otherLiteral (regex metacharacters are escaped).

Examples: vendor/** matches vendor, vendor/a, and vendor/a/b/c.swift but not src/vendor/x. src/*.swift matches src/x.swift but not src/sub/x.swift. **/*.generated.swift matches at any depth. Paths are normalized (leading ./, duplicate/trailing slashes) before matching.

JSON shape

--json emits a stable, sorted-key object. Top level:

{
  "scope": "working-tree",
  "riskScore": 19.18,
  "verdict": "proceed",
  "calibration": { "band": "...", "confidence": 0.0, "totalCommits": 1, "incidentCommits": 0 },
  "thresholds": { "review": 35, "block": 65 },
  "excludedPaths": [],
  "files": [
    {
      "path": "lib/helper.swift",
      "riskScore": 19.18,
      "signals": [
        { "name": "codeowners", "risk": 0.6, "weight": 0.08, "detail": "no CODEOWNERS owner" }
        // ...sensitivity, test-gap, churn, coupling, diff-shape, ownership, incident
      ]
    }
  ]
}