cargo

cargo vendor

Collect remote dependency sources into a local directory for controlled builds. Review the generated configuration before merging it into the project configuration. A vendor snapshot still needs review for licenses and vulnerabilities. Example format: shell. Illustrative only; do not execute against real accounts or unreviewed sources. Expected result (not executed): For a project with an existing valid lockfile and available sources, the vendor directory and configuration guidance are produced. No remote sources are included in this lab. Common mistake: Assuming vendor copies every path dependency or guarantees security.

Formal Syntax & Structure

rust syntaxrust
cargo vendor [OPTIONS] [PATH]

Working Example

Example Snippetrust
cargo vendor --locked vendor
Rust Reference