Install
Package types

Cargo

Publish crates to a sparse Cargo registry, and fetch crates.io dependencies through it.

This command adds the repository to ~/.cargo/config.toml as a registry named after it, with a token:

relic package setup cargo cargo --write

Publish a crate:

cargo publish --registry cargo

To fetch crates.io dependencies through Relic, add to ~/.cargo/config.toml:

[source.crates-io]
replace-with = "cargo"

Build:

cargo build

By hand, add the sparse registry to ~/.cargo/config.toml:

[registry]
global-credential-providers = ["cargo:token"]
[registries.relic]
index = "sparse+https://relic.example.com/cargo/cargo/index/"
[source.crates-io]
replace-with = "relic"

Store the token:

echo "Bearer <token>" | cargo login --registry relic

A virtual repository merges its members' indexes (for example a local and a remote of https://index.crates.io) and publishes to its default deployment repository.