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

# dino lint

> Audit SDL description coverage and detect documentation regressions

Check that your schema operations have SDL descriptions. Compares against the most recent snapshot to detect **regressions only** -- new operations missing descriptions or existing descriptions that were removed.

## Usage

```bash theme={null}
dino lint --tenant <id> [flags]
```

## Flags

| Flag                     | Type                   | Default           | Description                                           |
| ------------------------ | ---------------------- | ----------------- | ----------------------------------------------------- |
| `--tenant`               | `string`               | —                 | **Required.** Tenant ID (or set in `.dino.yml`)       |
| `--env`                  | `string`               | Tenant default    | Target environment                                    |
| `--format`               | `"markdown" \| "json"` | `"markdown"`      | Output format                                         |
| `--quiet`                | `boolean`              | `false`           | Suppress stdout output                                |
| `--snapshot-dir`         | `string`               | `.dino/snapshots` | Directory for reading and writing snapshots           |
| `--fail-on-undocumented` | `boolean`              | `false`           | Exit with code 1 if description regressions are found |

## How It Works

1. **Discover** -- Introspects the live API schema
2. **Load baseline** -- Reads the most recent snapshot from disk
3. **Audit** -- Compares current descriptions against the baseline
4. **Save snapshot** -- Writes the current schema as the new baseline
5. **Report** -- Outputs coverage stats and any regressions

The audit tracks three categories:

| Category                | Meaning                                                               |
| ----------------------- | --------------------------------------------------------------------- |
| **New undocumented**    | Operations added since the last snapshot that have no SDL description |
| **Description removed** | Operations that previously had a description but no longer do         |
| **Description added**   | Operations that gained a description since the last snapshot          |

<Note>
  On the first run (no previous snapshot), the command saves a baseline, reports current coverage, and exits with code 0. No regressions are possible without a baseline.
</Note>

## Examples

### Check description coverage

```bash theme={null}
dino lint --tenant acme --env staging
```

```text theme={null}
# SDL Description Audit — acme / staging

Coverage: 87% (142/163 operations documented)

## Regressions
  New undocumented: 2
    - Mutation createBulkImport
    - Query rawMetrics

  Descriptions removed: 0

## Improvements
  Descriptions added: 4
    - Query getUser
    - Query listTeams
    - Mutation updateProfile
    - Mutation deleteAccount

Result: FAIL (2 regressions)
```

### CI gate for documentation

```bash theme={null}
dino lint --tenant acme --env production --fail-on-undocumented
```

Returns exit code `1` when new undocumented operations are introduced or existing descriptions are removed. Use this to enforce documentation standards in CI.

<CodeGroup>
  ```yaml GitHub Actions theme={null}
  - name: SDL description check
    run: dino lint --tenant acme --env production --fail-on-undocumented
  ```

  ```yaml GitLab CI theme={null}
  lint-descriptions:
    script:
      - dino lint --tenant acme --env production --fail-on-undocumented
  ```
</CodeGroup>

### JSON output

```bash theme={null}
dino lint --tenant acme --format json
```

<Tip>
  Pair `dino lint --fail-on-undocumented` with `dino diff --fail-on-breaking` in your CI pipeline to catch both schema breakage and documentation regressions.
</Tip>

## Exit Codes

| Code | Meaning                                                                         |
| ---- | ------------------------------------------------------------------------------- |
| `0`  | No regressions, first run (baseline saved), or `--fail-on-undocumented` not set |
| `1`  | Regressions detected with `--fail-on-undocumented`, or command error            |

## Related

* [`dino diff`](/cli/diff) -- Schema change detection
* [`dino scan`](/cli/scan) -- Full pipeline run
* [`dino changelog`](/cli/changelog) -- API changelog from schema diffs
