Rust
Cargo commands for building, testing, and publishing Rust projects. Manage dependencies and compile optimized binaries.
61 commands
Browse by Topic
Getting Started
Quick setup and installation
Project
Project management
Build
Building & running
Test
Testing & benchmarks
Quality
Clippy, fmt, audit
Docs
Documentation
Publish
Publishing to crates.io
Dependencies
Dependency management
Rustup
Toolchain management
Utilities
Install & clean
Install Rust
Install Rust using rustup (official installer)
Check Rust version
Display installed Rust compiler version
Create new project
Create a new Rust project with Cargo
Create new project
Create new Cargo binary project.
Create library
Create new Cargo library project.
Initialize in existing dir
Initialize Cargo project in current directory.
Add dependency
Add crate to dependencies.
Add with features
Add crate with specific features.
Add dev dependency
Add development dependency.
Add from git
Add crate from git repository.
Build debug
Compile project in debug mode.
Build release
Build optimized release binary.
Check without building
Check for errors without producing binary (faster).
Run project
Build and run the binary.
Run with features
Run with specific feature flags.
Build for target
Cross-compile for specific target.
Build WASM
Compile to WebAssembly.
Build all features
Build with all optional features enabled.
Run all tests
Run all tests in project.
Run specific test
Run tests matching pattern.
Run with output
Run tests showing println! output.
Run library tests
Run only library unit tests.
Run doc tests
Run documentation tests.
Run ignored tests
Run tests marked with #[ignore].
Run benchmarks
Run all benchmarks.
Use nextest
Run tests with cargo-nextest (faster, better output).
Format code
Format all code with rustfmt.
Check formatting
Check formatting without modifying.
Run clippy
Run Clippy linter.
Clippy deny warnings
Run Clippy and fail on warnings (CI mode).
Clippy auto-fix
Auto-fix Clippy issues where possible.
Auto-fix warnings
Automatically fix compiler warnings.
Security audit
Check for known vulnerabilities.
Generate docs
Build documentation for project.
Open docs in browser
Build and open docs in browser.
Docs without deps
Build docs for current crate only.
Include private items
Document private items too.
Login to crates.io
Authenticate with crates.io.
Package crate
Create distributable package.
List package files
Show files that would be packaged.
Publish to crates.io
Publish crate to registry.
Publish dry run
Test publish without uploading.
Yank version
Remove version from new dependency resolution.
Update dependencies
Update all dependencies within semver constraints.
Update specific dep
Update specific package.
Show dependency tree
Display dependency tree.
Find duplicates
Show duplicate dependencies.
Reverse dependencies
Show what depends on a package.
Vendor dependencies
Copy dependencies to vendor directory.
Update toolchains
Update all installed toolchains.
Install nightly
Install nightly toolchain.
Set default
Set default toolchain.
Add target
Add compilation target.
Add component
Add toolchain components.
List installed
Show installed toolchains and targets.
Override for directory
Use specific toolchain for current directory.
Run with toolchain
Use specific toolchain for one command.
Install tool
Install binary crate globally.
List installed tools
Show globally installed binaries.
Clean build
Remove target directory.
Search crates
Search crates.io for packages.
Discussion
Loading comments...