CLI reference

Run React Doctor from the command line:

react-doctor [directory] [options]

If directory is omitted, React Doctor scans the current directory.

Common commands

npx react-doctor@latest
npx react-doctor@latest --verbose --diff
npx react-doctor@latest install
npx react-doctor@latest install --agent-hooks

Options

OptionDescription
-v, --versionPrint the installed version
--no-lintSkip lint diagnostics
--verboseShow every rule and per-file details
--scoreOutput only the numeric score
--jsonOutput a structured JSON report
--json-compact

Emit compact JSON with --json

-y, --yesSkip prompts
--fullForce a full scan
--project <name>Select workspace project, comma-separated for multiple
--diff [base]Scan files changed against a base branch
--offlineSkip score API and share URL
--stagedScan staged files for pre-commit hooks
--fail-on <level>

Exit non-zero on error, warning, or none

--annotationsEmit GitHub Actions annotations
--pr-commentTune output for sticky PR comments
--explain <file:line>Explain a diagnostic or suppression
--why <file:line>

Alias for --explain

--respect-inline-disablesRespect inline disables
--no-respect-inline-disablesAudit mode for inline disables

Install command

react-doctor install [options]
OptionDescription
-y, --yesSkip prompts and install for all detected agents
--dry-runShow what would be installed
--agent-hooksInstall native Claude Code and Cursor hooks
--cwd <cwd>Project root for install

JSON output

Use --json when another tool needs to parse the scan:

npx react-doctor@latest --json

Human-readable output is suppressed. Errors still produce JSON with ok: false, so stdout remains parseable.

Explaining suppressions

Use --explain when a diagnostic or suppression is confusing:

npx react-doctor@latest --explain src/App.tsx:42

The output reports what React Doctor sees at that location and why a nearby suppression did or did not apply.