Skip to Content
Next — You're reading the unreleased preview docs. APIs and pages may change before the next release.Switch to the current docs →
DevelopPublishing Packages

Publishing packages

Give the package a name and an exact version in the root golem.yaml:

package: name: my-package version: 1.0.0

Use a SemVer version without build metadata. The name and version are part of the digest-covered package config. Repack any archive made before the package config included this identity.

Build your application before you pack it. The package commands use the built WebAssembly components and the declarations for the selected manifest environment and preset. They do not deploy the application or log in to a server.

golem build golem package pack --output my-package.tar golem publish --dry-run

golem package pack writes an OCI image layout in a tar archive and prints its SHA-256 manifest digest. The default filename is golem-package.tar. golem publish --dry-run validates the same package and prints the same digest without writing an archive or contacting a server.

Neither command includes the publisher’s HTTP API or MCP deployments in the package. Both report the omitted exports by kind and domain name across the manifest’s environments. In JSON and YAML output, omittedExports contains entries with kind (http-api or mcp) and name (the resolved domain).

Initial files must resolve inside the application root. Download any initial file with an HTTP or HTTPS source and declare it as a local file before packing. A typed File default is a path relative to the manifest that supplies it and must resolve inside the application root. Packing embeds its contents. Ordinary string defaults stay literal, even if they look like paths. To package a directory, point to a dedicated input directory, not the application root. Keep build outputs and the package archive outside that directory. File defaults are supported for component and agent config, not tool or middleware provisions.

Everything in a package is visible to anyone with read access. This includes the WebAssembly, initial files, File contents, extracted metadata, config defaults, environment values, plugin parameters, and initial cards. Environment templates are stored as written, including variable names; packing does not substitute their values. Anyone you give the tar file to can also read its contents. Do not put credentials in any of these inputs. Package defaults cannot name a secret or use a $config reference, even inside a record or list.

Install a package

From the application that will use the package, install from a local archive, an HTTP(S) URL that serves the archive, or an OCI registry:

golem install ./my-package.tar golem install https://downloads.example.com/my-package.tar golem install oci://ghcr.io/example/my-package:1.0.0

Install verifies the package without running its components. It records the source, exact version, and SHA-256 manifest digest in packages: in the root golem.yaml and in golem.lock. Commit both files. For a local source, put the archive inside the application to record a portable path, and make the archive available on other machines that need to build it.

An OCI source must contain the Golem package manifest and blobs, not a container image or a tar file wrapped in an OCI layer. To upload the layout with ORAS, run oras cp --from-oci-layout my-package.tar@sha256:<manifest-digest> ghcr.io/example/my-package:1.0.0 with the digest printed by golem package pack. For a private registry, sign in with docker login <registry> before installing or building. Golem looks up the registry in $DOCKER_CONFIG/config.json (default ~/.docker/config.json), including configured credential helpers. Use a username and password or access token; Docker identity tokens are not supported. OCI uses HTTPS except for loopback registries, which use anonymous HTTP. Archive URLs are fetched anonymously and must use HTTPS except on loopback. Do not include credentials, a query string, or a fragment in the archive URL.

Build uses a verified archive from the per-user cache or fetches the source on a cache miss. For OCI it requests the locked manifest digest, never the tag, so the registry must retain that digest even after the tag moves. For a URL it rejects a package whose manifest digest differs from the lock. If a source is unreachable with a cold cache, build fails and reports the source and the credential key it would use, if any. A download must finish within five minutes; large packages may need a faster connection. Build unpacks under golem-temp and uses the publisher’s metadata instead of running the installed components. Build and deploy do not change golem.lock. If a pin is missing or differs, run golem install with the intended source to repair it or accept a new digest.

An installed agent keeps its published type name. To configure an installed agent, declare it under its published name with package: <name>:

agents: SupportCall: package: my-package

After deployment, use golem agent create and golem agent invoke as for a local agent. A tool called by the agent sees the agent in the installer’s environment, not a publisher principal. If two installed packages export the same agent type, remove one from the application before deploying.

If your package calls other agent types, list their published names in package.calls in the publisher manifest (for example, calls: [SupportCall]). Packing records the list in the archive. Build can succeed without these types, but deploy rejects the application if any listed type is missing from the deployment. A local component or another installed package can supply the type.

Deploying an installed package does not expose any of the publisher’s HTTP routes or MCP endpoints by default. To expose an installed agent, declare the HTTP API or MCP deployment in your own golem.yaml and deploy the application.

Publishing to a registry is not available through golem publish.