cargo-vendor
Vendor all dependencies locally
TLDR
SYNOPSIS
cargo vendor [options] [path]
DESCRIPTION
cargo vendor downloads and copies all crates.io and git dependencies into a local directory (default: `vendor/`). It outputs the Cargo configuration needed to redirect dependency resolution to the vendored sources.This is primarily used for offline builds, air-gapped environments, and reproducible build systems where network access during compilation is not available or not desired. The vendored sources are read-only; to modify a vendored crate, use the `[patch]` section in Cargo.toml instead of editing files directly in the vendor directory.
PARAMETERS
-s, --sync path
Additional Cargo.toml to sync--no-delete
Don't delete existing vendor directory--versioned-dirs
Use versioned directory names--respect-source-config
Respect [source] config when vendoring--manifest-path path
Path to Cargo.toml-v, --verbose
Verbose output-q, --quiet
Suppress output
CONFIGURATION
.cargo/config.toml
Source replacement settings that redirect dependency resolution to the vendored directory. The output of `cargo vendor` provides the exact configuration to add.
OFFLINE BUILDS
After vendoring:
CAVEATS
Vendored sources are read-only. Use [patch] for modifications. Resolution may differ from online mode. Run cargo fetch first for complete dependency download.
SEE ALSO
cargo(1), cargo-fetch(1)
