clients generate --target cli --cli-repo <owner>/<repo> writes a Go module ready to release from its own
repository. Besides the commands, it holds a goreleaser config, a GitHub Actions release workflow, and install.sh and
install.ps1. It ships no README: you write one for your users, and this page is what it should say.
Without --cli-repo there is no release to install from, so the module has no install scripts, no
installgen.config.mts, and its goreleaser config releases to the git remote's repository.
<bin> --help at every level, <bin> commands (every command), <bin> schema <command> (a command's inputs and
output as JSON Schema) and <bin> skill (the embedded SKILL.md, for agents). Your README points at these rather
than copying them, so it never goes stale.
Your README needs four parts:
- What it is: a sentence on your API and what the CLI is for.
- Install: the one-liners below, and the package managers you publish to.
- Configure: the base URL and the credentials, by flag, environment variable or config file.
- Verify: for users who check what they install, the release section below.
curl -fsSL https://github.com/<owner>/<repo>/releases/latest/download/install.sh | shOn Windows:
irm https://github.com/<owner>/<repo>/releases/latest/download/install.ps1 | iexEach release uploads both scripts beside its archives. With --cli-install-url <https dir> the scripts name that
directory instead (your own site, for example), you serve them from there, and the release uploads only its
version.txt.
Pushing a v* tag runs the release workflow:
- goreleaser builds the binaries for Linux, macOS and Windows on amd64 and arm64, as
<bin>_<os>_<arch>archives. - It writes
checksums.txtandversion.txt(the tag, which the installers read for the latest release). - cosign signs
checksums.txtkeyless (checksums.txt.sigstore.json). - It pushes each channel below that the options turned on.
- GitHub attests the build's provenance.
- installgen checks the release against the install scripts.
installgen.config.mts, written beside the scripts from the same layout, drivesnpx --yes --package @workerstack/clients@<version> installgen check --default-version "$GITHUB_REF_NAME"(the clients release that generated the module), which fails the run unless every platform's archive is published under the tag and listed inchecksums.txt. Then, unless the release is a prerelease, the run checks thatreleases/latest/download/version.txtreads the tag, which is what the one-liners install.
A tag with a semver prerelease part (v1.2.0-rc.1) is published as a GitHub prerelease. It never becomes the
latest release, so the one-liners keep installing the last full release, and the Homebrew, Scoop, winget and AUR
channels skip it. Users who want it name it: <PREFIX>_VERSION=v1.2.0-rc.1.
Each channel is one or two options, and needs the package metadata --cli-description, --cli-homepage and
--cli-license (AUR and the Linux packages also --cli-maintainer "Name <email>"). Generation refuses a channel
without what it needs, naming the option. Set each secret in the CLI's repository before the first tag: goreleaser
pushes the channels after the GitHub release is created, so a missing secret fails a release that is already half
published.
| Channel | Options | Secret | What it publishes |
|---|---|---|---|
| Homebrew | --cli-homebrew-tap <owner>/<tap> |
HOMEBREW_TAP_TOKEN, a token that can push to the tap |
a cask for macOS and Linux |
| Scoop | --cli-scoop-bucket <owner>/<bucket> |
SCOOP_BUCKET_TOKEN, a token that can push to the bucket |
a manifest |
| winget | --cli-winget-fork <owner>/winget-pkgs, --cli-winget-publisher <name> |
WINGET_TOKEN, a token that can push to the fork and open pull requests |
a pull request to microsoft/winget-pkgs |
| AUR | --cli-aur |
AUR_SSH_KEY, the private key of the AUR account |
the <bin>-bin package |
| Linux packages | --cli-packages deb,rpm,apk |
none | <bin>_linux_<arch>.<ext> beside the archives |
The binaries are not notarized by Apple, so the cask clears macOS's quarantine flag after install, the fallback GoReleaser documents. Apple may close it; notarizing is the alternative.
installgen writes both scripts. Each reads the latest tag from version.txt, downloads this platform's archive and
checksums.txt, and checks the archive's sha256 against checksums.txt before anything installs.
- With
cosignon PATH, it first checkschecksums.txtagainst its bundle, as signed by your repository's release workflow on that exact tag. <PREFIX>_INSTALL_VERIFY=requirerefuses to install without that check.<PREFIX>_VERSIONinstalls a release other than the latest,<PREFIX>_INSTALL_DIRinstalls somewhere other than~/.local/bin, and<PREFIX>_NO_MODIFY_PATH=1leaves the shell profile or the userPathalone.
The flow assumes a public repository: an anonymous one-liner cannot fetch a private repository's release assets, and attestations need a public repository or a paid plan.
The commands, as the installers run them. The checksums, for release v1.2.3:
cosign verify-blob --bundle checksums.txt.sigstore.json --certificate-identity https://github.com/<owner>/<repo>/.github/workflows/release.yml@refs/tags/v1.2.3 --certificate-oidc-issuer https://token.actions.githubusercontent.com checksums.txtAn archive's build provenance:
gh attestation verify <archive> --repo <owner>/<repo>