Reference

Source specifiers

Grammar and resolution of the strings rig use, rig inspect, and rig hub update accept.

A source specifier is the argument to rig use and rig inspect.

Grammar

<source> := <hub-source>
          | <github-source>
          | <registry-source>
          | <local-source>

<hub-source>      := "hub:"  <author> "/" <name> [ "@" <version> ]
<github-source>   := "github:" <user> "/" <repo> [ "@" <tag> ]
<registry-source> := "registry:" <author> "/" <name> [ "@" <version> ]
<local-source>    := ( "./" | "/" ) <path-to-rig-tgz>

Resolution table

SourceResolves toVerification
hub:a/nlatest version of a/n on the HubSHA-256 from X-Rig-SHA256 response header
hub:a/n@vspecific versionSHA-256
github:u/rlatest release; first .rig.tgz assetnone
github:u/r@trelease tagged tnone
registry:a/nlatest version per index.jsonSHA-256 from index.json
registry:a/n@vspecific version per index.jsonSHA-256
./path.rig.tgzlocal filenone
/abs/path.rig.tgzlocal filenone

Hub HTTP endpoints used

For hub:a/n[@v]:

GET  {RIG_HUB_URL}/api/v1/packages/{a}/{n}                       # metadata
GET  {RIG_HUB_URL}/api/v1/packages/{a}/{n}/{v}/artifact          # download

{RIG_HUB_URL} defaults to https://userig.xyz. Override via the RIG_HUB_URL env var.

Local registry layout

For registry:a/n[@v]:

{RIG_REGISTRY_DIR}/index.json
{RIG_REGISTRY_DIR}/blobs/{a}__{n}__{v}.rig.tgz

{RIG_REGISTRY_DIR} is set by the RIG_REGISTRY_DIR env var or via a CLI flag.

Version omitted

If @<version> is omitted, the resolver picks the latest stable:

  • hub: — latest from the Hub's metadata.
  • github:latest release per GitHub's API.
  • registry: — highest semver in index.json excluding pre-releases.

Pre-releases (e.g. 1.0.0-alpha.1) are only chosen when explicitly named with @.

Errors

ErrorCause
Unknown source schemeNone of the supported prefixes matched.
Package not foundHub or registry has no a/n.
Version not foundThe requested @v isn't in the index.
SHA256 mismatchThe downloaded blob's hash doesn't match the expected.
Artifact missing from releasegithub: source's release has no .rig.tgz asset.

See also