Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions docs/content/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,26 @@ npx diffsplain \

## Check your setup

Run the doctor command to see Node, Git, GitHub CLI, and coding agent paths and
versions:
Run the doctor command to see the separate local review, agent note, and pull
request lookup capabilities:

```sh
npx diffsplain doctor
```

The report lists every supported agent, even when it is not installed. Its
status says when no agent is available and whether pull request lookup can use
`gh`.
The report lists every supported agent, even when it is not installed. It keeps
installation, compatibility, authentication, and smoke-test results separate.
Missing agents do not stop a plain local review with `--no-agent`.

Use JSON for setup checks in scripts or cloud jobs:

```sh
npx diffsplain doctor --json
```

The normal check does not send prompts to a provider. `--deep` runs local
`--help` checks for installed providers after a warning; it does not send a
provider prompt.

## Run from source

Expand Down
16 changes: 13 additions & 3 deletions scripts/cli-args.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ Show the current checkout against its default branch:
diffsplain

Commands:
doctor Check Git, GitHub CLI, and coding agents
doctor [--json] [--deep]
Check review, agent, and pull request capabilities

Targets:
--branch NAME Show a remote branch against its default branch
Expand Down Expand Up @@ -81,6 +82,7 @@ Cursor:
Examples:
diffsplain
diffsplain doctor
diffsplain doctor --json
diffsplain --repo owner/project --pr 42
diffsplain owner/project --branch feature/search
diffsplain --agent claude`;
Expand Down Expand Up @@ -147,8 +149,16 @@ export function parseCliArgs(
} = {},
) {
if (rawArgs[0] === 'doctor') {
if (rawArgs.length > 1) fail('doctor does not take arguments or options');
return { doctor: true };
const options = new Set(rawArgs.slice(1));
for (const option of options) {
if (!['--json', '--deep'].includes(option)) {
fail('doctor only accepts --json and --deep');
}
}
if (options.size !== rawArgs.length - 1) {
fail('doctor options can only be passed once');
}
return { doctor: { json: options.has('--json'), deep: options.has('--deep') } };
}

const options = new Map();
Expand Down
Loading
Loading