Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Registries

A registry is where HPM looks up package metadata — names, versions, download URLs, checksums, and dependency lists. HPM supports two flavors:

  • API registries speak HTTP and serve JSON from a handful of endpoints.
  • Git registries are Cargo-style indexes: a Git repository with one JSON-lines file per package.

This page covers how to add and manage registries, how HPM resolves through them, and how to configure them per user or per project. To host one, see Run a studio registry and Registry formats.

Adding a registry

hpm registry add <URL> [--name <alias>] [--type api|git] [--if-not-exists]

Examples:

# Git-index registry
hpm registry add git@git.studio.example:pipeline/hpm-index.git --name studio --type git

# API registry
hpm registry add https://registry.vendor.example/v1/registry --name vendor

# No --name: HPM infers an alias from the URL
hpm registry add https://api.vendor.example/registry
# → added as "registry"

# Idempotent add: succeed silently if a registry with this name already
# exists, instead of erroring. Useful in provisioning scripts.
hpm registry add git@git.studio.example:pipeline/hpm-index.git --name studio --type git --if-not-exists

By default, adding a registry whose name already exists is an error. Pass --if-not-exists to treat that as a no-op (exit 0) so automated setup can re-run safely.

This writes to ~/.hpm/config.toml:

[[registries]]
name = "studio"
url = "git@git.studio.example:pipeline/hpm-index.git"
type = "git"

[[registries]]
name = "vendor"
url = "https://registry.vendor.example/v1/registry"
type = "api"

A git registry’s url may be an https://, ssh:// or file:// URL, an scp-style git@host:path, or a local or network path to the index repository. HPM refuses git:// and http:// (unauthenticated plaintext), the <transport>::<address> remote-helper syntax, anything starting with -, and a host starting with - (which ssh would read as an option), both in config.toml and in a project’s hpm.toml. Git runs with only the https, ssh and file transports enabled.

Listing

hpm registry list

Per-user vs per-project

Registries can be declared in two places:

  1. Per-user — ~/.hpm/config.toml. Managed by hpm registry add/remove/list. Applies to every project you work on.
  2. Per-project — hpm.toml under [[registries]]. Applies only to that project. Additive to per-user registries.

Per-project registries are useful when a studio wants each project to pin the registries it resolves against:

# hpm.toml
[[registries]]
name = "studio"
url = "git@git.studio.example:pipeline/hpm-index.git"
type = "git"

[[registries]]
name = "vendor"
url = "https://registry.vendor.example/v1/registry"
type = "api"

[dependencies]
"acme/rock-tools" = { version = "0.1.0", registry = "studio" }

Every team member who clones the project gets the same registry set, without needing to run hpm registry add themselves.

Targeting a specific registry from a dependency

By default, HPM resolves a dependency by querying every configured registry in order and taking the first match. To pin a dependency to one registry, use the detailed dependency form:

[dependencies]
"acme/rock-tools" = { version = "0.1.0", registry = "studio" }

Or from the command line, which records the pin in hpm.toml for you:

hpm add acme/rock-tools@0.1.0 --registry studio

The pin is authoritative. Resolution, install, and hpm update consult only the named registry — there is no fallback to the rest of the set, since falling back is exactly what a pin exists to prevent. Naming a registry that is not configured is an error rather than a silent search elsewhere.

This is useful when:

  • A package exists under the same name in multiple registries and you want to be unambiguous.
  • A private registry should always win over a public one for specific packages.
  • You want a dependency’s source to survive someone else adding a registry that happens to carry the same name.

Note the lock file does not record which registry a dependency came from — it pins the version, checksum, and resolved URL. The registry key in hpm.toml is what makes the source reproducible.

Refreshing and removing

hpm registry update           # refresh every configured registry's cache
hpm registry remove studio    # drop a registry from the config

hpm registry update does the right thing for each type:

  • API registries: nothing to do — API registries are always queried live, so there is no cache to invalidate. HPM reports OK (live).
  • Git registries: git pull the index repository to pick up new packages and versions.

Run hpm registry update after a new version is published to a Git registry. For API registries a newly published version is visible immediately, with no refresh step.

Auto-detection of registry type

If you don’t pass --type, hpm registry add infers it from the URL:

URL patternInferred type
Ends with .gitgit
Contains github.comgit
Contains giteagit
Anything elseapi

Override with --type api or --type git when the heuristic gets it wrong, for example for a Git index on a host not named above, or a local path.

Searching

hpm search <query>

hpm search queries each configured registry in turn, in the order they appear in the config. If no registries are configured, HPM prints a hint to run hpm registry add and exits cleanly (emitting [] under --output json).

With --output json, results are emitted as a JSON array suitable for piping into other tooling:

hpm --output json search geometry | jq '.[].name'

Each entry includes the package name, version, optional description, and optional Houdini compatibility string — one entry per version, even for a package published for several platforms (see Multi-platform packages). A yanked: true entry signals that the maintainer pulled that version; HPM still shows it in search results.

How a yank affects resolution depends on how you asked for the version:

  • A range requirement (^1, *, >=2, <3) skips yanked versions when picking the highest match.
  • An exact pin (1.2.0) still resolves, yanked or not. This is deliberate, so that a lockfile pinning a version that was later yanked keeps installing rather than breaking.

Multi-platform packages

A package that declares [compat].platforms publishes one archive per platform, and the registry stores each as its own record. HPM shows you versions, not archives: a release built for Windows and Linux appears once in hpm search and in any version listing, not twice.

Which archive you get is decided at install time, from the host: an exact platform match first, then a universal build, and otherwise NoCompatibleBuild rather than a silent fall back to some other platform’s archive. A version that has no build for your platform still lists — you can see it exists, and see its Houdini compatibility — it just won’t install here. When hpm install chooses a version for a package the project does not pin, it passes over such a version.

Use --platform on hpm pack to build for a platform other than the host; see hpm pack.

Caching

HPM caches Git registry indexes under ~/.hpm/registry/<digest>/, where the directory name is a digest of the registry’s remote URL. The cache is per-remote, not per-project, so every project using the same remote shares one clone, while two registries that share a display name but not a URL never read each other’s index. A clone whose origin no longer matches its remote is discarded and cloned again.

  • Git cache: a local clone of the index repository. Updated by hpm registry update.
  • API registries are not cached. Every resolution and search hits the API live, so there is nothing under ~/.hpm/registry/ for them.

The cache is advisory — if it’s corrupted or deleted, HPM re-fetches on the next operation. Never edit it by hand.