---
title: "CLI reference"
description: "Every command and flag."
---

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

# CLI reference

Doctors live in `./doctors/` (repo), `~/.any-doctor/doctors/` (global),
and the bundled pack (lowest priority). Generation delegates to your
installed agent — `run` and `verify` never touch a model.

## generate

```bash
any-doctor generate "<intent>" [--global] [--stdout | --format json]
```

Prints the exact prompt for your agent to build a doctor for the
described mistake. `--global` targets `~/.any-doctor/doctors/` instead of
the repo's `./doctors/`. `--stdout` avoids clipboard interaction;
`--format json` returns the machine-readable generation result.

## scaffold

```bash
any-doctor scaffold <kebab-case-slug>
```

Create an intentionally incomplete doctor and fixture pair. This is a file
scaffold, not a substitute for the discovery and challenge workflow printed by
`help author`.

## capabilities

```bash
any-doctor capabilities [name] [--format json]
```

List the shared analysis facts, Value Path contract, recipe schemas, examples and
known limits an author should use before proposing private analysis machinery.

## run

```bash
any-doctor run [--all] [--include-tests] [doctor.(m)js] [dir]
```

Scan. No argument = every doctor in one review tree. Flags:

| Flag | Does |
| ---- | ---- |
| `--all` | Run every doctor |
| `--include-tests` | Include test files in the scan (some checks need this) |
| `--format report\|json` | Human report or machine JSON (see the [JSON reference](/agents/json-reference)) |
| `--base <ref>` | Diff mode: `added` / `continuing` / `noLongerDetected` against the merge base |
| `--fail-on none\|error\|warning\|info` | Set the gate bar over RAW findings (`none` is the default) |

Exit code is nonzero when a gate fails or when doctors crash, break, or
get skipped — those are infrastructure failures, always.

## verify

```bash
any-doctor verify [--all] [doctor.(m)js]
```

The fixture gate. With no doctor argument, a fuzzy picker; `--all` runs
every doctor. Expected findings must appear, lookalikes must stay
silent, and a check without a claim cannot be certified.

## decide

```bash
any-doctor decide (--key K | --file F --line N [--check C]) (--accepted|--not-applicable) --reason R
```

Record a decision on a finding. `--key` resolves without scanning and is
what agents should use; `--file`/`--line` re-scans to resolve. The reason
is required. See [remembered decisions](/scans/decisions).

## decisions

```bash
any-doctor decisions [dir] [--json] [--reverse K]
```

List remembered decisions for a directory, or reverse one by key.

## help

```bash
any-doctor help [agents|author]
```

General help, `help agents` for the machine interface, or `help author` for the
complete doctor-authoring command sequence. The agent content matches the
[agent guide](/agents/agent-guide) and is printed by the CLI itself.

Source: https://anydoctor.dev/reference/cli/index.mdx
