๐Ÿ“ฆ

Cargo

Cargo is Rust's official build tool and package manager, developed and maintained by the Rust project as part of the core toolchain. It's tied for #18 among the most-used developer tools, reported in roughly 14.4% of developer surveys. Every Rust installation bundles it, and it's widely regarded as one of the best-designed dependency systems in any language โ€” handling compiling, testing, documentation generation, and publishing to the crates.io registry from a single command-line tool.

Quick facts
Type: Build tool & package manager
Made by: The Rust project (open-source)
License: Free / open-source (MIT/Apache-2.0)
Platforms/Hosting: Cross-platform (Windows, macOS, Linux) โ€” runs locally, bundled with rustup
Primary use case: Building, testing, and managing dependencies for Rust projects
Jump to: ExampleGetting startedBest for

Example

Every Cargo project is described by a Cargo.toml manifest file, where dependencies are declared by name and version.

cargo new myproject
# creates myproject/Cargo.toml and myproject/src/main.rs

# Cargo.toml
[package]
name = "myproject"
version = "0.1.0"
edition = "2021"

[dependencies]
serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1", features = ["full"] }

Getting started

Cargo comes bundled with Rust โ€” install both together via rustup, then use Cargo to build and run any project.

# install Rust + Cargo (Linux/macOS)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# build and run the current project
cargo build
cargo run
Best for: Any Rust project, from small CLIs to large systems software โ€” Cargo's dependency resolution, built-in test runner, and crates.io integration make it the default choice with essentially no competing alternative in the Rust ecosystem.