Link Search Menu Expand Document

cargo Cheat Sheet

cargo CLI

All commands are to be run within the source root directory

cargo build
cargo run
cargo test

cargo new <name>
cargo check

cargo publish

cargo install <binary>
cargo uninstall <binary>

Configure private crate mirror

For example via user skeleton:

cat <<EOF > /etc/skel/.cargo/config.toml

registry = "$PRIVATE_MIRROR_URL"

replace-with = "crates-io-mirror"

and provide credentials

cat <<EOF > /etc/skel/.cargo/credentials.toml
token = "${MYTOKEN}"