Skip to content

Commit 1ca93aa

Browse files
authored
Merge pull request #44 from itsjling/codex/issue-020-doctor-capabilities
Report doctor capabilities separately
2 parents 6123a2b + 561ca79 commit 1ca93aa

7 files changed

Lines changed: 428 additions & 106 deletions

File tree

docs/content/cli.mdx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,26 @@ npx diffsplain \
8080

8181
## Check your setup
8282

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

8686
```sh
8787
npx diffsplain doctor
8888
```
8989

90-
The report lists every supported agent, even when it is not installed. Its
91-
status says when no agent is available and whether pull request lookup can use
92-
`gh`.
90+
The report lists every supported agent, even when it is not installed. It keeps
91+
installation, compatibility, authentication, and smoke-test results separate.
92+
Missing agents do not stop a plain local review with `--no-agent`.
93+
94+
Use JSON for setup checks in scripts or cloud jobs:
95+
96+
```sh
97+
npx diffsplain doctor --json
98+
```
99+
100+
The normal check does not send prompts to a provider. `--deep` runs local
101+
`--help` checks for installed providers after a warning; it does not send a
102+
provider prompt.
93103

94104
## Run from source
95105

scripts/cli-args.mjs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ Show the current checkout against its default branch:
4545
diffsplain
4646
4747
Commands:
48-
doctor Check Git, GitHub CLI, and coding agents
48+
doctor [--json] [--deep]
49+
Check review, agent, and pull request capabilities
4950
5051
Targets:
5152
--branch NAME Show a remote branch against its default branch
@@ -81,6 +82,7 @@ Cursor:
8182
Examples:
8283
diffsplain
8384
diffsplain doctor
85+
diffsplain doctor --json
8486
diffsplain --repo owner/project --pr 42
8587
diffsplain owner/project --branch feature/search
8688
diffsplain --agent claude`;
@@ -147,8 +149,16 @@ export function parseCliArgs(
147149
} = {},
148150
) {
149151
if (rawArgs[0] === 'doctor') {
150-
if (rawArgs.length > 1) fail('doctor does not take arguments or options');
151-
return { doctor: true };
152+
const options = new Set(rawArgs.slice(1));
153+
for (const option of options) {
154+
if (!['--json', '--deep'].includes(option)) {
155+
fail('doctor only accepts --json and --deep');
156+
}
157+
}
158+
if (options.size !== rawArgs.length - 1) {
159+
fail('doctor options can only be passed once');
160+
}
161+
return { doctor: { json: options.has('--json'), deep: options.has('--deep') } };
152162
}
153163

154164
const options = new Map();

0 commit comments

Comments
 (0)