Type-check without producing binaries
Validate code quickly without final artifacts.
cargo checkFaster than a full build for many edit-compile cycles.
Everyday Cargo workflows for checking, building, running, testing, formatting, linting, and cleaning Rust CLI projects.
Fast iteration commands for local development.
Validate code quickly without final artifacts.
cargo checkFaster than a full build for many edit-compile cycles.
cargo buildBuilds binaries and libraries for selected packages and targets.
cargo build --releaseUses the `release` profile for optimized builds.
cargo runPass app arguments after `--` when needed.
cargo run -- --helpArguments after `--` are forwarded to the compiled binary.
Choose which binary to execute in multi-bin packages.
cargo run --bin admin-toolUseful when the package exposes more than one executable.
cargo run --example demoExamples can be useful for smoke tests and documentation.
Test execution, filtering, and output control.
cargo testThe default workflow for unit tests, integration tests, and doctests.
cargo test parse_argsGreat for tight feedback loops while debugging one area.
cargo test -- --nocaptureThe flags after the separator go to the test harness, not Cargo.
cargo test -- --test-threads=1Helps when tests share global state or external ports.
cargo benchBenchmark support is available through Cargo benchmark targets.
Keep code consistent and remove stale artifacts.
cargo fmtRequires the rustfmt component to be installed.
cargo fmt -- --checkCommon CI guard to enforce formatting.
cargo clippyRequires the Clippy component to be installed.
cargo clippy -- -D warningsA stricter CI pattern for keeping lint debt low.
cargo cleanUseful when debugging stale builds or reclaiming disk space.
Build specific targets or profiles.
cargo build --bin admin-toolTargets can be selected individually in multi-target packages.
cargo build --example demoUseful for verifying example code compiles.
cargo test --no-runGood for CI stages or debugging compilation failures in tests.
Type-check binaries, tests, examples, and benches.
cargo check --all-targetsBroad validation helps catch code paths not built by default.