Skip to main content

Command Syntax

Arguments

string
default:"."
Project directory to scan. Defaults to the current directory.

Options

Scan Configuration

boolean
default:"true"
Enable linting checks. Can be overridden in config file.
boolean
Skip linting checks.
boolean
default:"true"
Enable dead code detection using Knip.
boolean
Skip dead code detection.
boolean
default:"false"
Show file details per rule in the output.

Output Options

boolean
default:"false"
Output only the score without diagnostic details.
boolean
default:"false"
Skip telemetry (anonymous, not stored, only used to calculate score).

Project Selection

string
Select workspace project(s). Use comma-separated values for multiple projects.
boolean
default:"false"
Skip prompts and scan all workspace projects automatically.

Differential Scanning

boolean | string
Scan only files changed vs base branch. If a branch name is provided, uses that as the base branch.

Error Handling

'error' | 'warning' | 'none'
default:"none"
Exit with non-zero code based on diagnostic severity:
  • error: Exit with code 1 if any errors are found
  • warning: Exit with code 1 if any warnings or errors are found
  • none: Always exit with code 0

Auto-fix

boolean
default:"false"
Open Ami to automatically fix all issues.
boolean
Skip Ami-related prompts.

Information

boolean
Display the version number.
boolean
Display help information.

Subcommands

fix

Open Ami to auto-fix react-doctor issues.
string
default:"."
Project directory. Defaults to current directory.

install-ami

Install Ami and open it to auto-fix issues.
string
default:"."
Project directory. Defaults to current directory.

Exit Codes

Success
Scan completed successfully (or no failures based on --fail-on setting).
Failure
Diagnostic issues found that match the --fail-on severity level.

Environment Variables

React Doctor detects automated environments and adjusts behavior accordingly. The following environment variables indicate an automated environment:
  • CI - Continuous Integration environment
  • CLAUDECODE - Claude Code environment
  • CURSOR_AGENT - Cursor Agent environment
  • CODEX_CI - Codex CI environment
  • OPENCODE - OpenCode environment
  • AMP_HOME - Amp environment
  • AMI - Ami environment
When an automated environment is detected:
  • Prompts are automatically skipped (equivalent to --yes)
  • TTY checks are bypassed

Examples

Basic scan

Scan specific directory with verbose output

Scan only changed files

Run in CI with fail on errors

Skip dead code analysis

Scan multiple workspace projects

Open Ami to fix issues