Skip to Content
Xeonr Developer Docs

Distribute a CLI

Ship a command-line tool through the Updater, with an install one-liner, pinned versions, private channels and a manifest for self-update.

A CLI on the Updater ships one executable per platform. Users install it with one line, and installed copies check a JSON manifest to update themselves.

curl -fsSL https://updater.xeonr.io/<bucket>/install.sh | sh

On Windows, in PowerShell:

irm https://updater.xeonr.io/<bucket>/install.ps1 | iex

The app's Overview in the console shows both lines with its bucket id filled in, plus a copy button.

What a release holds

Platforms are named <goos>-<goarch>, as Go spells them: linux-amd64, darwin-arm64, windows-amd64. Each platform of a release carries two files.

FileNameUsed by
The binary<app>-<goos>-<goarch>, with .exe on WindowsSelf-updaters that replace the executable in place
An archive of it<app>_<version>_<goos>_<goarch>.tar.gz, or .zip on WindowsThe install scripts

The archive holds the executable at its root, named <app> (or <app>.exe). <app> is the app's name in lower case, with anything but letters and digits turned into hyphens, so an app called "Updater CLI" ships updater-cli. The Updater records each file's SHA-256 when it is uploaded.

A release holds binaries or Electron artifacts, never both. The console reads an app's kind off its latest release and groups a binary release's files by platform.

Releases are usually published from CI with updater-cli publish --kind binary, which reads the platform and version off these filenames. See Publish from CI for a pipeline that builds and publishes them.

Installing

The install scripts are generated per app. Each one:

  1. picks the platform from uname (or PROCESSOR_ARCHITECTURE on Windows);
  2. asks the target for its newest release on that platform, as a checksum line that names the archive;
  3. downloads exactly that archive and checks its SHA-256;
  4. puts the executable in /usr/local/bin when that is writable or sudo is available, else in ~/.local/bin. On Windows it uses %LOCALAPPDATA%\<app> and adds that to the user's PATH, with no Administrator prompt.

By default a script installs from the app's public stable target, or its first public target when there is no stable.

Environment variables change what it does. Their prefix is the app's name in upper case, with hyphens turned into underscores, so updater-cli reads UPDATER_CLI_VERSION.

VariableEffect
<APP>_VERSIONInstall this version instead of the newest. A leading v is ignored.
<APP>_INSTALL_DIRInstall into this directory.
<APP>_TARGETInstall from this target instead of the default.
<APP>_TOKENAn updater token, for a private target.

Set them on the side of the pipe that runs the script:

curl -fsSL https://updater.xeonr.io/<bucket>/install.sh | BURROW_VERSION=0.9.1 sh
$env:BURROW_VERSION = '0.9.1'; irm https://updater.xeonr.io/<bucket>/install.ps1 | iex

Pinning a version

With <APP>_VERSION set, the script downloads the archive by name:

https://updater.xeonr.io/<bucket>/update/<target>/<goos>-<goarch>/<app>_<version>_<goos>_<goarch>.tar.gz

The version must still be published on that target. A rescinded release, or one that was never on the target, does not download. When the release carries a <archive>.sha256 file the script checks against it; otherwise it says it is skipping verification.

Private targets

A private target answers only requests that carry an updater token whose targets claim names it. The scripts send <APP>_TOKEN as a bearer header, so the token stays out of URLs and logs:

curl -fsSL https://updater.xeonr.io/<bucket>/install.sh \
  | BURROW_TARGET=internal BURROW_TOKEN="$UPDATER_TOKEN" sh

The script itself is public, and never names a private target. An app with no public target gets a script that stops and asks for <APP>_TARGET and <APP>_TOKEN.

Anything else that reads a private target can send the token as Authorization: Bearer <token>, or as ?token=<token> where a header cannot be set.

The manifest, for a custom updater

Each target serves a manifest per platform:

GET https://updater.xeonr.io/<bucket>/update/<target>/<goos>-<goarch>/manifest.json
{
  "app": "burrow",
  "version": "0.9.2",
  "platform": "linux/amd64",
  "sha256": "9f2c…",
  "size": 14260224,
  "url": "https://updater.xeonr.io/<bucket>/update/stable/linux-amd64/burrow-linux-amd64",
  "notes": "## 0.9.2\n\n### Fixed\n- …",
  "pub_date": "2026-10-15T23:49:00Z",
  "archive": {
    "url": "https://updater.xeonr.io/<bucket>/update/stable/linux-amd64/burrow_0.9.2_linux_amd64.tar.gz",
    "sha256": "41d0…",
    "size": 6186598
  }
}

The top-level url, sha256 and size describe the raw binary. platform uses a slash, as Go's GOOS/GOARCH does. Apart from notes, pub_date and archive, the shape is the one the shared CI's binary release channel publishes, so a consumer of that channel can point at the Updater unchanged.

To update in place, compare version with your own, download url, check its SHA-256 against sha256, and replace the running executable. The console lists each target's manifest URL on the app's Overview.

A Go CLI does not need to write this itself. The Go SDK does it, and adds an upgrade command, a once-a-day update banner and rollback for daemons.

Three more routes need no release id, for scripts and links:

RouteAnswer
…/<goos>-<goarch>/latestA redirect to the newest archive
…/<goos>-<goarch>/latest.sha256<sha256> <archive filename>, in sha256sum format
…/<goos>-<goarch>/latest.binA redirect to the newest raw binary

Prefer latest.sha256 and then the named archive over latest, as the install scripts do. A release published between two requests then cannot leave you verifying one file against another's checksum.

On this page