cargo-fetch-source

Crates.iocargo-fetch-source
lib.rscargo-fetch-source
version0.1.2
created_at2025-08-26 12:49:42.232159+00
updated_at2025-09-01 15:28:04.727796+00
descriptionDeclare and fetch external sources programmatically
homepage
repositoryhttps://github.com/adamtuft/cargo-fetch-source
max_upload_size
id1811103
size111,629
Adam Tuft (adamtuft)

documentation

README

Readme

Fetch and cache external source trees specified in Cargo.toml

Installation

From crates.io (recommended)

cargo install cargo-fetch-source

From source

git clone https://github.com/adamtuft/cargo-fetch-source.git
cd cargo-fetch-source
cargo install --path cargo-fetch-source

Basic Usage

Declare external sources in Cargo.toml:

[package.metadata.fetch-source]
"syn::latest" = { git = "https://github.com/dtolnay/syn.git" }
"syn::1.0.0" = { tar = "https://github.com/dtolnay/syn/archive/refs/tags/1.0.0.tar.gz" }

List sources specified in a manifest file:

$ cargo fetch-source list
syn::latest:
   upstream: https://github.com/dtolnay/syn.git
   recursive: false
syn::1.0.0:
   upstream: https://github.com/dtolnay/syn/archive/refs/tags/1.0.0.tar.gz

Fetch declared sources:

$ cargo fetch-source fetch
[1/2] ✅  syn::latest -> /home/me/.cache/cargo-fetch-source/e919341bd778304b42215bfd5c9015df7113cf5addb1ad8b7bcd057887e35de3
[2/2] ✅  syn::1.0.0 -> /home/me/.cache/cargo-fetch-source/6366d155d905264e8697cbe862fe2d8519c1d958af0e4d784b79ca89a540678b

View all available commands and options:

$ cargo fetch-source --help
Fetch external source trees specified in Cargo.toml

Usage: fetch-source <COMMAND>

Commands:
  fetch   Fetch the sources specified in the manifest
  list    List the sources specified in the manifest without fetching them
  cached  List the cached sources. Defaults to `CARGO_FETCH_SOURCE_CACHE` environment variable then `~/.cache/cargo-fetch-source`
  help    Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

License

Copyright (c) 2025 Adam Tuft

Licensed under either of

at your option.

Contribution

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

Commit count: 169

cargo fmt