cargo Command Examples

Manage Rust projects and their module dependencies (crates). Some subcommands such as build have their own usage documentation. More information: https://doc.rust-lang.org/cargo.

cargo search {{search_string}}

cargo install {{crate_name}}

cargo install --list

cargo init --{{bin|lib}} {{path/to/directory}}

cargo add {{dependency}}

cargo build --release

cargo +nightly build

cargo build --jobs {{number_of_threads}}