Rust CLI Build, Run, Test, and Lint/Run a specific binary target

Choose which binary to execute in multi-bin packages.

Section: Build and run

Run a specific binary target

bash
bash
cargo run --bin admin-tool
Explanation

Useful when the package exposes more than one executable.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Build and run
Build and run the default binary
Compile if needed and execute the program.
OpenIn sheetbashsame section
Pass arguments to the binary
Separate Cargo flags from program flags with `--`.
OpenIn sheetbashsame section
Run an example target
Build and execute example code.
OpenIn sheetbashsame section
Type-check without producing binaries
Validate code quickly without final artifacts.
OpenIn sheetbashsame section
Build debug artifacts
Compile the package in the dev profile.
OpenIn sheetbashsame section
Build optimized release artifacts
Compile with the release profile.
OpenIn sheetbashsame section