rust-doctor

CLI Reference

Complete reference for all rust-doctor command-line options and flags.

Usage

rust-doctor [OPTIONS] [DIRECTORY]
rust-doctor <COMMAND>

DIRECTORY defaults to . (current directory).

Subcommands

CommandDescription
setupInteractive setup wizard — auto-detects AI agents (Claude Code, Cursor, Windsurf) and configures MCP server or installs CLI skills
# Launch the setup wizard
rust-doctor setup

The wizard offers two modes:

  • CLI + Skills (default) — installs a SKILL.md that teaches your agent to use rust-doctor deeply
  • MCP Server — writes the MCP stdio server config to your agent's config file

Options

Output modes

FlagDescription
--scorePrint only the bare integer score to stdout (for CI piping)
--jsonOutput full scan results as JSON
--sarifOutput results in SARIF 2.1.0 format (for GitHub Code Scanning)
-v, --verboseShow detailed file:line information per diagnostic

These are mutually exclusive — you can only use one output mode at a time.

Filtering

FlagDescription
--diff [BASE]Scan only changed files vs a base branch. Defaults to auto (detects main/master)
--project NAMESScan only specific workspace members (comma-separated)

CI integration

FlagDescription
--fail-on <LEVEL>Exit with code 1 when this severity is reached. Values: error, warning

Fixing and planning

FlagDescription
--fixApply machine-applicable fixes from custom rules (modifies source files)
--planShow a prioritized remediation plan after scanning

Configuration

FlagDescription
--offlineSkip network-dependent checks (cargo-audit advisory DB fetch)
--no-project-configIgnore the project's rust-doctor.toml config file
--install-depsCheck and install missing external tools

MCP server

FlagDescription
--mcpRun as an MCP stdio server for AI tool integration

Examples

Scan the current directory:

rust-doctor .

Get just the score for CI:

rust-doctor --score .
echo $?  # 0 if score > 0

Scan only changed files on a PR:

rust-doctor --diff main --fail-on warning .

Output SARIF for GitHub Code Scanning:

rust-doctor --sarif . > results.sarif

Scan specific workspace members:

rust-doctor --project api,core .

On this page