# csb lint

Check a wiki for broken links, orphan pages and bad frontmatter, from any directory.

## Usage

```bash
csb lint [<name>…] [--brain <name>] [--path <dir>] [--all] [--json]
```

With no target, `csb lint` shows a multi-select of your registered brains with the default brain preselected, and lints each one you pick. When there's no terminal to prompt in, or with `--json`, it lints the default brain.

It's a thin wrapper: it runs `pnpm lint:wiki` inside each vault (passing `--json` through), the same script [`/lint`](https://jessepinkman9900.github.io/claude-second-brain/skills/lint) starts with. Vaults scaffolded before `lint:wiki` existed use the copy bundled with the CLI.

## Checks

| Check | Severity | What it finds |
|-------|----------|---------------|
| `broken-link` | error | A `[[wikilink]]` that points to no file in the vault. |
| `frontmatter` | error | A page with no frontmatter, or a missing or invalid `type` or `updated`. |
| `orphan` | warning | A page no other wiki page links to. |
| `short-link` | warning | A link that only resolves by bare name, not the full `[[wiki/...]]` path. |
| `contradiction` | info | An open `[!WARNING] Contradiction` callout. |

Exits 0 when no target has errors, 1 when any target has errors, and 2 on bad usage or a folder with no `wiki/`.

## Options

### `<name>`, --brain \<name>

Lint a registered brain. Repeat to lint several.

```bash
csb lint work personal
```

### --path \<dir>

Lint any vault folder, registered or not. Repeatable. `--vault` is an alias.

```bash
csb lint --path ~/notes/my-vault
```

### --all

Lint every registered brain.

### --json

Print a JSON report with `summary`, `issues` and `missingPages`. With several targets, prints an array of `{ target, path, exitCode, report }`.

```bash
csb lint --all --json
```

### -h, --help

Displays help message.

```bash
csb lint --help
```
