Edit icon Edit This Page

Download cargo artifacts

Download the .crate file of a crate version from a Cargo registry. rp reads <repo>/config.json, then the sparse index file of the crate (one JSON line for each published version), picks the version, and downloads it from the “dl” address of config.json (<repo>/api/v1/crates/<crate>/<version>/download). The index publishes the SHA-256 of every crate, and the download is verified against it.

Without –version rp takes the highest release that is not yanked, else the highest pre-release that is not yanked. A version named with –version is downloaded even when it is yanked, as cargo does for a locked version. The server keeps crate names in lower case with ‘_’ in place of ‘-’, so rp download cargo my-crate finds the crate published as my_crate. The file is stored as <crate>-<version>.crate, with the crate spelled as you wrote it.

The token is sent when the repository asks for it: as Basic (the default for Repsy), or as the scheme –auth-scheme names (basic, bearer, raw).

rp download cargo <crate> [flags]

Options

      --auth-scheme string   Send the token as basic, bearer or raw (without a scheme) when the repository asks for it (default: the scheme the server's challenge names)
      --dir string           Directory to store the file in (created when missing) (default ".")
      --force                Replace the file when it already exists
      --repo string          Repository to download from (required)
      --version string       Version to download (default: the newest the format knows)

Options inherited from parent commands

      --api-url string           Panel API URL of the profile, overrides the stored value
      --ca-file string           PEM file with extra trusted CA certificates
      --debug                    Print debug output with secrets redacted
      --hostname string          Repsy host to use instead of the current profile
      --insecure                 Do not verify TLS certificates (unsafe; plain http is chosen with the URL, not with this flag)
      --insecure-storage         Keep credentials in a plain 0600 file instead of the OS keyring (unsafe; a warning is printed once per command)
      --jq string                Filter JSON output with a jq expression (implies --output json)
      --no-color                 Disable colored output
      --no-input                 Never prompt; fail when input is needed
      --output table|json|yaml   Output format: table, json or yaml (default table; json when --jq is given)
      --owner string             Owner segment of Cloud protocol URLs; --owner= means none
      --registry-url string      Protocol host URL of the profile, overrides the stored value
      --type os|cloud            Product of the host, overrides detection
      --web-url string           Panel UI URL of the profile (where /cli/auth lives), overrides the stored value
      --yes                      Answer yes to confirmation prompts

See also

Found a problem with this page?