Ship resources

For publishers: declare the extra files each release ships, such as completions, man pages, skills, SBOMs, and desktop files, so consumers can install the ones that match the version a user runs. To install a tool, see Bootstrap a tool; to install resources from your own installer, see Build an installer or mirror.

Declare only the resources the release provides. Consumers choose which resource kinds they support.

Write a resource entry

Declare each resource entry as one of these:

A flag value or action line has this form:

KIND[/QUALIFIERS][@SCOPE]=SOURCE:VALUE
KindFlag formNotes
completioncompletion/SHELL[/BIN], or completion/SHELL,SHELL[/BIN] with execSee Write an exec command.
manman[/BIN]The file's suffix gives the man section, as in mytool.1.
cli-speccli-spec/FORMAT[/BIN]The documented format is usage.
skillskill/NAMEA directory that holds SKILL.md; from an asset, an archive of that directory.
sbomsbom/FORMATcyclonedx or spdx.
desktopdesktopA freedesktop desktop entry.
iconiconAn icon file; see Ship desktop files and icons.
appappA macOS application (.app) inside a dmg or zip. archive source only.
A kind of your own, such as fontKIND or KIND/NAMEConsumers ignore kinds they do not know.

completion/zsh=archive:share/zsh/site-functions/_mytool declares a zsh completion script inside the archive. In release.toml the same entry is a [[resource]] table, with a field for each qualifier (shell or shells, bin, format, name) and one for the source:

[[resource]]
kind = "completion"
shell = "zsh"
archive = "share/zsh/site-functions/_mytool"

Resource kinds defines each kind for consumers, [[resource]] tables lists every field, and Release recipes shows complete configurations.

Choose a source

Each resource has exactly one source, which says where the content is and what pins it:

archive and repo paths are relative, with no empty or .. segments.

An asset value is a local file in the signing job. packslip create digests it and records only its file name, such as mytool.cdx.json. Then:

  1. Set its download URL with --url mytool.cdx.json=URL (the file name, without dist/), the entry's url in release.toml, or --url-base (url_base) for URL_BASE/FILENAME. The GitHub action sets --url-base to the release's download URL.
  2. Upload the file to that URL yourself. The GitHub action uploads only the release bundle.

A file matched both as an artifact, for example by dist/*, and as an asset is recorded once, as the asset, not as an installable artifact.

Ship completions and CLI specifications

These entries ship completions the tool generates and a usage spec from the archive:

completion/bash,zsh,fish=exec:mytool completion {shell}
cli-spec/usage/mytool=archive:share/usage/mytool.kdl

Declare either or both. For completions, consumers use a static script first, then a spec, then exec; Fallback and verification gives the full order.

A consumer that generates completions from a spec needs usage's completion engine each time the shell completes, so it installs usage beside the tool. The engine is built into mise; see Keep completions aligned with the active version. If users may install the tool without mise or usage, also ship static completion scripts.

Name the executable

Every cli-spec names the executable it describes. The flag may leave the name out (cli-spec/usage=...) only when exactly one executable is given with --bin (the action's bin input) or the top-level bin of release.toml. A release.toml cli-spec table always sets bin.

A completion or man entry must name its executable when the release has more than one, or packslip create refuses it:

completion/zsh/mytool=archive:share/zsh/site-functions/_mytool
man/mytool=archive:share/man/man1/mytool.1

Write an exec command

An exec command's first word after any NAME=value words must be one of the release's bin names, not another program such as sh.

The CLI splits an exec value on whitespace, without interpreting shell quoting, pipes, or redirections. Leading NAME=value words become environment variables, as at a shell prompt. This entry runs mytool with COMPLETE set to each shell:

completion/bash,zsh,fish/mytool=exec:COMPLETE={shell} mytool

In release.toml, exec is an array, so an argument may contain spaces. The equivalent table:

[[resource]]
kind = "completion"
bin = "mytool"
shells = ["bash", "zsh", "fish"]
exec = ["mytool"]
env = { COMPLETE = "{shell}" }

An exec completion must list its shells and put {shell} in its command or env, so packslip create refuses completion/zsh=exec:....

Consumers generate exec completions on demand and cache them. Other exec resources run during installation only if the user allows vendor code to run then; see Running an exec entry.

Ship man pages and SBOMs

These entries ship a man page from the archive and a CycloneDX SBOM as a separate release file:

man=archive:share/man/man1/mytool.1
sbom/cyclonedx=asset:dist/mytool.cdx.json

Use sbom/spdx for SPDX. An SBOM cannot come from exec, so a digest or commit always covers it.

For one SBOM per platform or per artifact, scope each entry, as in sbom/cyclonedx@linux/x86_64=...; see Scope resources to the right artifact.

Ship an agent skill

skill/mytool=repo:skills/mytool points at a directory in the source repository. At source.commit, that directory must contain SKILL.md and every file it links by relative path.

To ship the skill as a separate archive, use skill/mytool=asset:dist/mytool-skill.tar.gz. Put SKILL.md at the archive's root, or in one top-level directory that is the only entry at the root.

Prefer either form over exec, so installing the skill does not run the tool.

Ship desktop files and icons

On macOS, an app entry points to the application (.app) inside the artifact. On Linux, a desktop entry pairs with the application's icons.

The hicolor icon theme keeps each size in its own directory under the same file name. In a hicolor/SIZE/CONTEXT/FILE path, consumers count SIZE (such as 48x48, 48x48@2, or scalable) in the icon's identity. List one icon entry per size; a consumer that installs icons installs them all:

desktop@linux=archive:share/applications/mytool.desktop
icon@linux=archive:share/icons/hicolor/48x48/apps/mytool.png
icon@linux=archive:share/icons/hicolor/256x256/apps/mytool.png
icon@linux=archive:share/icons/hicolor/scalable/apps/mytool.svg
app@darwin=archive:MyTool.app

Icons outside a hicolor size directory, such as share/pixmaps/mytool.png, are told apart by file name alone, so a consumer installs only one of several that share a name.

The recipe Desktop application for Linux and macOS shows a complete desktop release, and Desktop integration gives the full rules.

Scope resources to the right artifact

An entry without a scope applies to every artifact, so do not declare an unscoped archive path that exists in only some artifacts. When archive layouts differ by platform, add a scope to the kind with @:

man@linux=archive:share/man/man1/mytool.1
completion/zsh@darwin/aarch64=archive:share/zsh/site-functions/_mytool

The scope is os, os/arch, or os/arch/libc. Unlike an artifact's PATH:OS/ARCH suffix, the os alone is enough: man@linux applies to every Linux build. An @ before the = always starts the scope, so an @ inside an exec argument or a path is left alone. In release.toml, set os, arch, or libc on the entry.

Spell scope values as the vocabularies do, such as darwin and aarch64, not macos or arm64. packslip create accepts a scope that matches no artifact, but consumers never use that entry.

An archive entry never applies to a bare executable (format raw, gz, xz, zst, or bz2), whatever its scope. To give a bare executable the same resource, add an asset or repo entry.

When archives for one platform have different layouts, or a resource belongs to one variant, scope the entry to one exact artifact. Only release.toml can, with the artifact field of a [[resource]] table:

[[resource]]
kind = "man"
artifact = "mytool-1.2.3-linux-x64.tar.gz"
archive = "mytool-1.2.3/share/man/man1/mytool.1"

The entry then belongs only to that file. The named artifact must be in the release and match any platform scope on the entry.

Offer fallback sources

Entries compete only when they share a resource identity. Different executables, shells, skill names, CLI-spec and SBOM formats, and hicolor icon sizes are different resources. So are man, desktop, icon, and other entries whose source files have different names.

For a second place to get a resource, declare another entry with the same identity. Consumers try entries of one source in statement order and stop at the first usable one. Entries of different sources follow the order in Fallback and verification. These entries try the older .agents/skills/mytool only if skills/mytool is unavailable:

skill/mytool=repo:skills/mytool
skill/mytool=repo:.agents/skills/mytool

Entries from release.toml come before those from --resource flags or the action's resources input, so declare all alternatives in one place to control their order.

Give alternatives the same scope. A more specific entry removes every less specific one for the same resource before any source is tried. An unscoped entry therefore never backs up a scoped one whose path is wrong.

If no entry for a resource is usable, consumers report it and install the executables without it. A digest or commit mismatch fails the installation and never falls through to another entry. Selecting resources and consumer rule 8 give the full rules.

Check entries before you publish

packslip create checks that each entry is well formed, digests every asset, and confirms that exec commands and BIN qualifiers name release executables. It also finds each executable (--bin, or bin in release.toml) in the archives it can read. Neither packslip create nor packslip verify checks archive or repo paths or runs exec commands.

Warning: A mistyped path is signed as written, and consumers then install without that resource. Before you publish:

  1. List each archive, and confirm every archive path in every artifact it applies to. Copy paths from the listing; include dist/ only if the archive itself contains that directory.

    tar tf dist/mytool-1.2.3-linux-x64.tar.gz
    unzip -l dist/mytool-1.2.3-windows-x64.zip
    
  2. Confirm each repo path at the release commit; this exits with status 0 when the file exists:

    git cat-file -e <full-commit-sha>:skills/mytool/SKILL.md
    
  3. Before you upload the bundle, inspect the resources it records. It is in the --out directory (the action's default is packslip/). In the GitHub action, set upload: false, inspect the bundle, then upload it yourself; see Keep the action away from release write access.

    packslip show packslip/packslip.sigstore.json
    

Troubleshoot resource errors

packslip create prints these errors, shown here with example names.

ErrorFix
--resource "cli-spec/usage=archive:share/usage/mytool.kdl": say which executable, as cli-spec/usage/BINName the executable: cli-spec/usage/mytool=....
cli-spec "cli-spec/usage" needs format and binSet format and bin on the table.
resource "man" does not say which executable it is for, and the release has several: mytool, mytool-helperAdd /BIN (man/mytool=...), or bin = "mytool" in release.toml.
resource "completion/zsh" runs "sh", which is not a bin name of any artifactRun a release executable directly; exec uses no shell.
completion "completion/zsh" lists shells, so its source must be exec with a {shell} placeholderGive a static completion one shell. Give an exec completion shells and a {shell} placeholder; for one shell, write shells = ["zsh"] in release.toml.
sbom "sbom/cyclonedx" needs a format (cyclonedx or spdx) and a static source, not execUse an archive, asset, or repo source.
resource "skill/mytool" comes from the repository, which needs source.commitPass --source-repo and --commit, or set repo and commit in [source].
resource "man" names artifact "mytool-1.2.3-linux-x64.tar.gz", which is absent or outside its platform scopeUse the artifact's exact file name, within the entry's os, arch, and libc.
resource "man": archive path must be relative with no empty or .. segmentsWrite the path from the archive or repository root, with no leading or trailing /, no //, and no ...
app "app" must come from an archiveUse the .app path inside the dmg or zip as an archive source.