> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bensevern.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# GoldenCheck CLI

> Commands, key flags, domain packs, and the goldencheck.yml config format.

## Commands

| Command                                 | Purpose                                                                                                                                                      |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `goldencheck <file>`                    | Scan and launch the interactive TUI.                                                                                                                         |
| `goldencheck scan <file>`               | Explicit scan (`--smart`, `--guided`).                                                                                                                       |
| `goldencheck validate <file>`           | Validate against `goldencheck.yml` rules.                                                                                                                    |
| `goldencheck review <file>`             | Scan plus validate, then launch the TUI.                                                                                                                     |
| `goldencheck init <file>`               | Interactive setup wizard (scan → config → CI).                                                                                                               |
| `goldencheck diff <file> [file2]`       | Compare two files, or against git HEAD (`--ref main`).                                                                                                       |
| `goldencheck watch <dir>`               | Poll a directory and re-scan on change (`--interval 30`).                                                                                                    |
| `goldencheck fix <file>`                | Auto-fix issues (`--mode safe\|moderate\|aggressive`, `--dry-run`).                                                                                          |
| `goldencheck baseline <file>`           | Deep-profile and save a statistical baseline to YAML.                                                                                                        |
| `goldencheck denial-constraints <file>` | Mine denial constraints — if-then / cross-tuple invariants — and list the rows that violate them (`--min-confidence`, `--sample-size`, `--max-constraints`). |
| `goldencheck learn <file>`              | Generate LLM validation rules.                                                                                                                               |
| `goldencheck history`                   | Show scan history and trends.                                                                                                                                |
| `goldencheck serve`                     | Start the REST API server (`--port 8000`).                                                                                                                   |
| `goldencheck scan-db <conn>`            | Scan a database table directly.                                                                                                                              |
| `goldencheck schedule <files>`          | Run scans on a cron schedule (`--interval`, `--webhook`).                                                                                                    |
| `goldencheck mcp-serve`                 | Start the MCP server (19 tools).                                                                                                                             |

The TypeScript CLI mirrors the core commands under `goldencheck-js` (`scan`, `validate`, `profile`, `health-score`, `baseline`, `fix`, `diff`, `demo`).

## Key flags

| Flag             | Values                               | Effect                                                                                                                                     |
| ---------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `--no-tui`       | —                                    | Print results to the console.                                                                                                              |
| `--json`         | —                                    | JSON output.                                                                                                                               |
| `--fail-on`      | `error`, `warning`                   | Exit non-zero at this severity.                                                                                                            |
| `--domain`       | `healthcare`, `finance`, `ecommerce` | Apply a domain pack.                                                                                                                       |
| `--llm-boost`    | —                                    | Enable LLM enhancement.                                                                                                                    |
| `--llm-provider` | `anthropic` (default), `openai`      | Choose the LLM provider.                                                                                                                   |
| `--mode`         | `safe`, `moderate`, `aggressive`     | Fix mode (for `fix`).                                                                                                                      |
| `--smart`        | —                                    | Auto-triage: pin high-confidence, dismiss low.                                                                                             |
| `--denial`       | —                                    | Opt-in: also mine denial constraints during `scan` (slower). `--deep` on top widens the DC engine's row-level pass to the full population. |
| `--webhook`      | URL                                  | POST findings to Slack, PagerDuty, or a custom endpoint.                                                                                   |
| `--baseline`     | path                                 | Baseline YAML for drift detection.                                                                                                         |

## Config

A `goldencheck.yml` pins explicit rules for CI:

```yaml theme={null}
version: 1

settings:
  sample_size: 100000
  fail_on: error

columns:
  email:
    type: string
    required: true
    format: email
    unique: true
  age:
    type: integer
    range: [0, 120]
  status:
    type: string
    enum: [active, inactive, pending, closed]

relations:
  - type: temporal_order
    columns: [start_date, end_date]

ignore:
  - column: notes
    check: nullability
```

Relation types: `temporal_order`, `null_correlation`, `numeric_cross_column`, and `age_vs_dob`.

## Environment variables

| Variable                   | Effect                                     |
| -------------------------- | ------------------------------------------ |
| `ANTHROPIC_API_KEY`        | LLM boost (default provider).              |
| `OPENAI_API_KEY`           | LLM boost (alternative provider).          |
| `GOLDENCHECK_LLM_BUDGET`   | Max spend per scan, in USD.                |
| `GOLDENCHECK_LLM_MODEL`    | Override the LLM model used for LLM boost. |
| `GOLDENCHECK_NATIVE`       | Native-kernel gate (`auto` / `1` / `0`).   |
| `GOLDENCHECK_SCAN_THREADS` | Scan thread-pool size.                     |
| `GOLDENCHECK_FORCE_TUI`    | Force the terminal UI.                     |
