Skip to content

CLI reference

Every option rust-doctor accepts, and what each one changes.

rust-doctor [OPTIONS] [PATH]
rust-doctor inspect [OPTIONS] [PATH]

Every command on this page is replayed against the binary when the rule catalog is generated, so an example that stopped working fails the build rather than your terminal.

rust-doctor .

PATH defaults to the current directory. Use the explicit inspect subcommand when the path you mean is literally named inspect: rust-doctor ./inspect.

A scan runs cargo clippy inside the workspace, and Cargo executes that workspace's build.rs files and procedural macros. Inspect local paths you trust.

#Output

#--json

rust-doctor --json .

Prints the machine-readable report instead of the human one. Paths are workspace-relative, and the payload carries no absolute path, no environment variable and no user data. The shape is versioned; see Report.

#--verbose

Prints every finding rather than the ranked head of the report.

#--yes

Answers nothing interactively and prints the linear report. Use it for any scripted or agent-driven run.

The interactive report opens only when stdin and stdout are both terminals and none of --json, --yes or --verbose was passed, because those readers are pipes, CI and agents.

#Policy

#--rule <RULE_ID=LEVEL>

Overrides one rule. LEVEL is off, warn or error. Repeatable.

rust-doctor --rule clippy::unwrap_used=error .

#--category <CATEGORY=LEVEL>

Overrides a whole category, with the same levels. Repeatable. The six categories are security, correctness, reliability, performance, dependencies and maintainability.

rust-doctor --category security=error .

A --rule override wins over a --category override, and both win over the project's rust-doctor.toml. See Configuration.

#--blocking <LEVEL>

Sets the severity at which the process exits non-zero: none, error or warning. This is the knob CI uses to decide what breaks a build.

rust-doctor --blocking none .

#Scope

#--scope <MODE>

  • full: the whole workspace. The default.
  • files: only files that changed against --base.
  • baseline: only findings the change introduces, judged against --base.

baseline is the mode CI wants on a pull request: the existing backlog is not the contributor's problem. It needs full git history, so a shallow clone is not enough.

#--base <REF>

The git ref that files and baseline compare against, typically the base branch of the pull request.

rust-doctor --scope baseline --base HEAD --blocking none .

#Version and help

rust-doctor --version
rust-doctor --help