Repolode
rust-lang

rust-lang/cargo

Rust's official package manager, which downloads project dependencies and compiles Rust code.

Stars
15,681
Forks
3,114
Open issues
1,708
Last commit
2 days ago

What is it?

Cargo is the package manager that ships with Rust. It fetches the dependencies a Rust project declares, then builds the project with the Rust compiler. Developers use it as the everyday entry point for creating, building and managing Rust crates.

Cargo is designed to be extended with new subcommands without modifying Cargo itself, and a community list of third-party subcommands is maintained separately. Cargo releases coincide with Rust releases. The repository can also be cloned and built from source with a C compiler, git, and optional system libraries such as OpenSSL, libcurl, libgit2 and libssh2.

The code is dual-licensed under MIT and Apache-2.0. The Cargo team states that the crate is primarily meant for the Cargo binary itself and is not intended as a general-purpose library, though it is distributed with Rust.

Key features

  • 01Downloads and resolves Rust crate dependencies for a project.
  • 02Compiles Rust projects through the Rust compiler.
  • 03Extensible with third-party subcommands.
  • 04Can build from source with optional system or vendored C libraries.

Use cases

  • Creating, building and managing Rust applications and libraries.
  • Setting up a Rust development environment that needs a standard build tool.
  • Building Cargo itself from source to contribute to its development.

Quick start

  1. 1

    Clone the repository

    git clone https://github.com/rust-lang/cargo.git
  2. 2

    Enter the cloned directory

    cd cargo
  3. 3

    Build Cargo in release mode (requires an existing cargo install)

    cargo build --release

Things to know

  • Building from source requires an existing Rust toolchain with cargo and rustc.
  • The README says this crate is primarily maintained for Cargo's own use and may make major API changes.

In collections

Topics

FAQ

What is cargo?
Rust's official package manager, which downloads project dependencies and compiles Rust code. Cargo is the package manager that ships with Rust. It fetches the dependencies a Rust project declares, then builds the project with the Rust compiler. Developers use it as the everyday entry point for creating, building and managing Rust crates.
Is cargo free to use? What license does it have?
cargo is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is cargo still maintained?
Actively maintained. The last commit to cargo was on Nov 5, 2026.
What can I use cargo for?
Creating, building and managing Rust applications and libraries. Setting up a Rust development environment that needs a standard build tool. Building Cargo itself from source to contribute to its development.
How do I install cargo?
Clone the repository: git clone https://github.com/rust-lang/cargo.git Enter the cloned directory: cd cargo Build Cargo in release mode (requires an existing cargo install): cargo build --release
Where can I get cargo?
The source code and installation instructions are on GitHub: https://github.com/rust-lang/cargo

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects