Browse the docs

Build cache and registries

This page lists how the remote build cache and the four package registries work, who can read and write them, and which command manages each.

Both use short-lived credentials. The platform stores no registry key and no cache key for you. A tool asks for a token when it needs one.

Build cache

The platform runs a remote build cache, so builds reuse task results across machines and CI. The cache is a platform bucket. putnami cloud setup configures it.

Fact Detail
Config file .putnami/cache.json. It holds enabled, url and a token source (a command that mints a token), never a bearer. It is safe to commit.
Who writes Hosted Putnami CI only.
Who reads Your laptop, and any workspace machine token. They write nothing.
Refused write The cache answers a developer credential reads the shared cache; only CI writes to it, even to a token created with cache.write.
Pull request runs Store each task's result and its files under 16 MiB. A file of 16 MiB or more, such as a service executable, is left out, and a run that needs it rebuilds it. Runs on main store every file.
Retention 7 days.
Mode minimal, toplevel or full, set at setup time. Without --cache-mode the file records no mode: a run picks minimal when hosted and full on a developer machine. PUTNAMI_CACHE_MODE sets it too.

Tokens for the cache

Where you run Token
A machine where you signed in putnami cloud token --for cache. A short-lived bearer for the workspace with only cache.read. The CLI prints the bearer and does not store it. Needs your own putnami cloud login: a CLI signed in through the Putnami connector gets a 401.
An agent session or CI job with no signed-in user A workspace machine token in PUTNAMI_CLOUD_TOKEN. The token needs cache.read: without it, every run is refused.
A cloud session whose CLI signed in through the Putnami connector A cache.read token in PUTNAMI_CACHE_TOKEN. It wins over PUTNAMI_CLOUD_TOKEN.

See Agent and CI environments.

Manage the cache

Want to Do this
Check the config, its identity, and how many tasks the last CI run took from the cache putnami cloud cache status
Disable the cache and keep the file putnami cloud cache disable
Remove the cache config putnami cloud cache disable --remove
Configure the cache during setup putnami cloud setup --cache (the default)
Skip the cache during setup putnami cloud setup --no-cache
Set the cache mode putnami cloud setup --cache-mode minimal|toplevel|full
Mint a cache bearer for a script putnami cloud token --for cache

Registries

The platform runs four package registries, one per ecosystem. Your tools publish to and pull from them with short-lived tokens for you and one registry.

Registry Host Holds
put put.putnami.dev Putnami-native packages: config, migrations, archives, site content
npm npm.putnami.dev npm packages
go go.putnami.dev Go modules
oci oci.putnami.dev OCI images

putnami cloud login records the registry endpoints and the token recipe of each registry (putnami cloud token --for <kind>). Nothing is stored as a key: each token is minted on demand and expires soon. putnami cloud registries status reads on demand for such a registry. A line that reads key active means a key stored by an older version.

Channels

A channel such as canary, stable or pr-<n> names one publication. Each registry answers it in its own vocabulary:

Registry Ask for a channel with Answer
npm The dist-tag in the packument, GET /<pkg> The version tagged canary
go GET /<module>/@v/<channel>.info {"Version": "…", "Time": "…"}
put download?channel=<channel> The archive on that channel
oci The image tag The manifest on that tag

The four answers name one publication. A publish stores an immutable release set and moves the channel to it. The registries project that head onto their own tags, so @putnami/cli@canary and go.putnami.dev/http@canary resolve to the same release.

For Go, this is the ordinary proxy protocol: go get go.putnami.dev/http@canary works with no extra flag. GET /<module>/@latest?channel=<channel> returns the same answer.

A channel a package is not part of is absent: the dist-tag is missing from the packument and the Go proxy answers 404. A tool never installs a version from an older publication by accident. Reading a channel needs exactly the grant that reading the version it names needs.

A workspace that consumes another workspace's channels

Name the owner in putnami.workspace.json, so putnami upgrade --channel canary resolves the owner's release set:

{
  "options": {
    "@putnami/cloud": {
      "distribution": { "ownerWorkspace": "<owner workspace id>" }
    }
  }
}

Without it, the linked workspace is the owner. That is right for the publishing workspace and wrong for a consumer. The consumer's users also need a read grant on the owner's release-set package and on each member they install. A lease the owner never granted is denied.

Private access

From a checkout linked to the owner workspace, activate each protocol namespace and grant another workspace read access to release history:

putnami cloud packages namespaces activate \
  --protocol npm --namespace @owner \
  --idempotency-key activate-owner-npm

putnami cloud packages grants create \
  --grantee-workspace-id <workspace-uuid> --channel latest \
  --idempotency-key latest-reader
Fact Detail
What a grant gives Read access to artifacts named through the selected channel while the grant is active. Omit --channel to cover all channels. A grant gives read access only. Internal artifacts stay with their owner workspace.
Effect A grant on a channel that no other active grant of the owner covers takes effect at the next authority refresh, within about a minute. A revocation also removes access to historical pins that depended on the grant.
Who Only a workspace admin creates or revokes a grant. The linked checkout fixes the owner.
Read back putnami cloud packages namespaces list, grants list, grants revoke <grant-id>.
Check putnami cloud packages status checks that the workspace binds each namespace your checkout needs.
Retired flags Package, action, principal-kind and migration-purpose flags belong to a retired contract. The CLI refuses them.

A namespace has one owner workspace. Another workspace publishes into it through package shares: the owner shares one exact package, as reader or publisher, with POST /v1/workspaces/<owner>/distribution/package-shares. GET /v1/workspaces/<workspace>/distribution/package-shares/received lists the shares your workspace holds, revoked ones included. A share drops out of the list when its owner moves the namespace to a new binding. The share names the package and the permission, not the owner workspace. Such a workspace cannot bind the owner's namespace. putnami cloud packages status and the oci-binding row of putnami cloud env doctor pass with no OCI binding when the workspace holds at least one active OCI publisher share.

Tokens

Want to Do this
Check the registries on this machine putnami cloud registries status
Get a registry bearer putnami cloud token --for npm|go|oci|put
Get one by host putnami cloud registry-token --host <host>
Write the bearer for one native tool call Add --materialize. The bearer is not printed.
Remove registry credentials from this machine putnami cloud registries logout or putnami cloud logout

A token is issued for you and one registry. There is no owner workspace, package or action to pass, and passing one is an error. The registry decides what the token reaches: for each namespace you touch, it finds the owner workspace and asks whether you are a member with read or publish there. Access follows membership and changes the moment membership changes. A publish that also writes a channel tag needs no second credential.

Tokens are cached locally until shortly before they expire. --materialize writes the credential files native tools read: $HOME/.npmrc for npm and $HOME/.netrc for go. It never writes under PUTNAMI_HOME.

Install through the credential provider

If putnami --help lists --providers, a build can ask @putnami/cloud for its registry read credential:

putnami build --providers install

PUTNAMI_PROVIDERS=install turns it on for every command in that shell. The provider mints one short-lived bearer for you, for the hosts of the four registries. It needs putnami cloud login and a checkout linked with putnami cloud setup. Without them, it answers that it holds no credential, and the CLI keeps the credentials your tools already have. The provider never answers a publish credential: publishing uses putnami cloud token. putnami cloud logout removes the cached bearer.

Publish

putnami publish publishes most artifacts. The direct publishers publish one input again:

Publish Command
Config schema and values putnami cloud config publish
Migration bundle putnami cloud db migrations publish
Pre-built archives putnami cloud packages publish

OCI tag verbs

The OCI registry copies and retags images server-side. No blob moves. A multi-arch image index is copied whole.

Want to Do this
Copy an image between repositories putnami cloud packages copy <src>:<tag> <dst>:<tag>
Add tags to an existing digest putnami cloud packages retag <ref> <tag…>
Move a tag back to its previous image putnami cloud packages revert <repo>:<tag>

A ref is ns/name, ns/name:tag or ns/name@sha256:…. A copy destination is <repo>[:tag], never a digest. revert takes a tag, never a digest, because a digest is immutable. Each verb accepts --source-ref, an opaque provenance string the registry records on the move. See Roll back to move a channel.

Next