Install
CLI

Package managers

Configure package manager clients for a repository, check package versions and publish modules.

Client setup

relic package setup <client> <repository> prints the configuration a client needs for a repository, as Set me up does. --write writes it and runs the client's own login.

With --write or --show-token, the client gets its own token, described as relic package setup <client> <repository>, so signing out or in again leaves it working. It lasts 90 days unless --expires-days says otherwise. Revoke it with relic auth token revoke. A --token or RELIC_TOKEN token is passed on as it is.

Print the ~/.npmrc for a repository, with the token shown as <token>:

relic package setup npm npm-virtual

Write the ~/.npmrc:

relic package setup npm npm-virtual --write

Write ~/.m2/settings.xml (--force replaces an existing one):

relic package setup maven maven-virtual --write

Configure Go, keeping modules under git.example.com out of the public checksum database:

relic package setup go go-virtual --private 'git.example.com/*' --write

Run docker login:

relic package setup docker docker-virtual --write

Configure apt for Debian bookworm, as root:

relic package setup apt debian-remote --distribution bookworm --write

Configure dnf and yum, as root:

relic package setup dnf rpm-virtual --write

The clients are npm, pnpm, yarn, maven, gradle, go, pip, pipenv, poetry, twine, docker, podman, nuget, conan, ruby, terraform, helm, cargo, apk, apt, dnf, nix and huggingface. --help lists what each writes.

  • User files go under --home, and the client commands relic runs use it as their home. System files (apk, apt, dnf) go under --root.
  • Files holding the token get mode 0600.
  • In shared files (.npmrc, .netrc, .terraformrc, …), relic writes and later replaces only a block marked with the repository's name.
  • .yarnrc.yml holds one such block, since YAML allows a key once: setting up another repository replaces the earlier block, and relic refuses to write when the file sets npmRegistryServer, npmAlwaysAuth or npmAuthToken outside it.
  • When the context trusts a private certificate authority (relic auth login --ca-file), setup writes it to ~/.config/relic/certificate-authorities/<host>.crt (system clients: /etc/relic/certificate-authorities/). pip, twine, Poetry, Helm, Podman, apt and dnf are configured to trust it for the repository; for the other clients setup prints the setting or variable to use.

Checking a package version

Check whether a package version may be used through a repository. The command exits with status 1 when Relic refuses it:

relic package check pkg:npm/lodash@4.17.21 --repository npm-virtual

AI agents lists the reasons for a refusal.

Publishing

Publish a Go module (zip, go.mod and .info):

relic package publish go go-local v1.4.0 --dir ./lib

Publish a Terraform module, used as source = "<host>/tf-local__acme/network/aws":

relic package publish terraform tf-local 1.0.0 --namespace acme --provider aws --dir modules/network

Upload a Hugging Face model as a new commit on main:

relic package huggingface upload ./bert-tiny hf-local acme/bert-tiny

Download a model at a revision:

relic package huggingface download hf-remote google-bert/bert-base-uncased ./bert --revision main

--build <name>/<number> on publish and upload records the files in that build run (Builds and images).