Installation
Run rust-doctor with npx, install it with cargo binstall or cargo, or build it from source.
#npx (recommended)
The npm package is a launcher: it resolves the prebuilt binary for your platform and executes it. Nothing to install.
npx -y rust-doctor@latest .To keep it around:
npm install -g rust-doctorPrebuilt binaries ship for Linux, macOS and Windows on x64, plus Linux and macOS on arm64. Node 20.19 or later.
#cargo binstall
cargo binstall rust-doctorDownloads the prebuilt binary from the GitHub Release instead of compiling it,
for the same five platforms npx serves, and puts it in ~/.cargo/bin. Each
release carries one rust-doctor-<target>.tar.gz per platform, and the release
is immutable once published. A platform without an archive falls back to
cargo install.
#cargo
cargo install rust-doctor --lockedCompiles the crate and puts the binary in ~/.cargo/bin. Requires Rust 1.95 or
later, and takes as long as building the tool, where npx downloads a binary
already built. Keep --locked: without it Cargo ignores the shipped
Cargo.lock and can resolve dependency versions that do not compile together.
Read a version below 0.4.0 on either registry with care. npm unpublished 0.1.1 through 0.2.0, and crates.io still serves its own 0.2.0, an earlier build of this same tool published in June 2026 before the rewrite: same name, same author, different product. 0.4.0 is the first version that means the same code on both, and one workflow now publishes them from one tag.
#From source
git clone https://github.com/arthjean/rust-doctor
cd rust-doctor
cargo build --releaseThe binary lands in target/release/rust-doctor. Requires Rust 1.95 or later.
#What the scan needs
Rust Doctor runs cargo clippy inside the workspace it inspects, so the
workspace needs a Rust toolchain with the clippy component. Everything else
is native: the four other producers parse source text, read manifests, or ask
git what it tracks, and build nothing.
Clippy is required. The scan resolves cargo, rustc and clippy before any pass runs, and a toolchain missing one of them fails with exit code 2 and names what to install rather than scoring a workspace it never read. On CI, the toolchain actions install rustup's minimal profile, which has no clippy:
- uses: dtolnay/rust-toolchain@stable
with:
components: clippyLocally, rustup component add clippy is the same fix.
#Verify
rust-doctor --version