Clone this repo:
  1. 246ab4b Bump cargo from `569507e` to `339d9f9` by dependabot[bot] · 6 months ago master
  2. 25b6f77 Bump cargo from `5d96734` to `569507e` by dependabot[bot] · 6 months ago
  3. 8ed7d0f Merge pull request #147 from alexcrichton/cargo-git by Alex Crichton · 6 months ago
  4. f23c96c Bump Cargo dependency to a git dependency by Alex Crichton · 6 months ago
  5. 5cf5310 Bump env_logger from 0.5.13 to 0.6.0 by dependabot[bot] · 6 months ago


Build Status Build status

This is a Cargo subcommand which vendors all dependencies into a local directory using Cargo's support for source replacement.


Currently this can be installed with:

$ cargo install cargo-vendor

You can also install precompiled binaries that are assembled on the CI for this crate.

Example Usage

Simply run cargo vendor inside of any Cargo project:

$ cargo vendor
add this to your .cargo/config for this project:

    replace-with = 'vendored-sources'

    directory = '/home/alex/code/cargo-vendor/vendor'

This will populate the vendor directory which contains the source of all dependencies. When configured, Cargo will then use this directory instead of looking at

Also note that the output of cargo vendor that should be configuration is all on stdout (as opposed to stderr where other messages go), so you can also do:

$ cargo vendor > .cargo/config

to vendor and initialize your config in the same step!

Flag --no-merge-sources

If the vendored Cargo project makes use of [replace] sections it can happen that the vendoring operation fails, e.g. with an error like this:

found duplicate version of package `libc v0.2.43` vendored from two sources:

The flag --no-merge-sources should be able to solve that. Make sure to grab the .cargo/config file directly from standard output since the config gets more complicated and unpredictable.


$ cargo vendor --no-merge-sources > .cargo/config


This project is licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in cargo-vendor by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.