Basic Usage
Run React Doctor in your project directory:Commands
Main Command
The main command scans your React codebase for issues.Project directory to scan
Fix Command
Open Ami to automatically fix detected issues.Install Ami Command
Install Ami and open it to fix issues.Options
Linting Options
Enable linting checks using oxlint
Skip linting checks
Dead Code Detection
Enable dead code detection using Knip
Skip dead code detection
Output Options
Show file details per rule, including line numbers for each diagnostic
Output only the score (0-100) without diagnostics
Project Selection
Select workspace project(s) to scan. Comma-separated for multiple projects.
Skip prompts and scan all workspace projects
Diff Mode
Scan only files changed vs base branch. If no base branch is specified, compares against uncommitted changes or the default base branch.
Diff mode automatically disables dead code detection since it requires a full codebase scan.
Error Handling
Exit with error code on diagnostics. Valid values:
error, warning, noneTelemetry
Skip telemetry. Telemetry is anonymous, not stored, and only used to calculate your health score.
Ami Integration
Open Ami to auto-fix all detected issues
Skip Ami-related prompts
Version
Display the version number
Common Workflows
Exit Codes
React Doctor uses exit codes to indicate scan results:0: Success (or no failures based on--fail-onsetting)1: Diagnostics detected that match the--fail-onlevel
Environment Variables
React Doctor detects automated environments and adjusts behavior accordingly:CI: Continuous IntegrationCLAUDECODE: Claude CodeCURSOR_AGENT: Cursor AgentOPENCODE: OpenCodeAMI: Ami environment
- Skips interactive prompts
- Scans all workspace projects automatically
- Disables Ami installation prompts
Output
Standard Output
A typical scan produces:- Project Detection: Framework, React version, TypeScript/JavaScript
- Diagnostics: Grouped by rule with severity, message, and help text
- Summary: Health score, error/warning counts, affected files
- Full Report: Diagnostics written to
/tmp/react-doctor-{uuid}/
Verbose Output
With--verbose, each diagnostic includes:
- File paths
- Line numbers for each occurrence
- Detailed context
Score-Only Output
With--score, outputs a single number (0-100):