Skip to Content
Xeonr Developer Docs

The CLI

Install updater-cli, and every command and flag it has for publishing releases, module releases and distributions.

updater-cli publishes to the Updater: releases with their artifacts, module releases, and distributions. It is built for CI. For a first pipeline, start with Publish from CI.

Install

curl -fsSL https://updater.xeonr.io/77/install.sh | sh

On Windows, in PowerShell:

irm https://updater.xeonr.io/77/install.ps1 | iex

updater-cli is published through its own Updater app, so these need no credential. Builds exist for Linux, macOS and Windows on amd64 and arm64, and the script verifies the published checksum before installing. In CI, pin a version so a new release cannot change a pipeline under you:

curl -fsSL https://updater.xeonr.io/77/install.sh | UPDATER_CLI_VERSION=1.2.6 sh

UPDATER_CLI_INSTALL_DIR chooses where it lands.

The npm package @xeonr/updater-cli is no longer published and stops at 1.2.5. Install with the script instead, and replace an npm install -g @xeonr/updater-cli step with it. Older versions on npm still install, but get no fixes.

updater-cli --version prints the version you have, and updater-cli upgrade updates it in place.

Connecting

Every command except upgrade needs three settings. Each is a global flag, or the environment variable beside it; the flag wins. Global flags may come before or after the command's name.

FlagVariableValue
--api-urlUPDATER_API_URLhttps://updater.xeonr.io
--tokenUPDATER_TOKENA team API key, xk_…, or a person's Xeonr Auth access token for the Updater
--bucket-idUPDATER_BUCKET_IDThe app's bucket id

Prefer the variables in CI, so the key stays out of the command line and the job log.

Commands

updater-cli configThe app's name, branches and targets
updater-cli publishCreate a release, upload its artifacts and publish it
updater-cli publish-moduleThe same for a module release
updater-cli distribution listThe app's installers and store links
updater-cli distribution publishUpload an installer, creating its entry if needed
updater-cli distribution linkAdd a link to a store listing
updater-cli upgradeReplace this binary with a newer release

distribution can be shortened to dist.

config

Prints the app's name, then each branch with its id and whether its versions are semver or freeform, then each target with its id, branch and whether it is public or private. Names and ids from here are what the other commands' --branch and --targets take.

publish

updater-cli publish --version 1.4.0 --branch stable [flags]

Scans a directory, creates the release as a draft, uploads and confirms each artifact, then publishes it.

FlagDefault
--versionThe release's version, such as 1.4.0. Required.
--branchA branch name or id. Required.
--targetsevery target on the branchComma-separated target names or ids
--dir./distWhere the artifacts are
--kindelectronelectron for electron-builder output, binary for plain executables
--appthe app's name, slugified--kind binary only: the <app> in the artifacts' filenames
--notesRelease notes, as Markdown
--notes-fileRead the notes from a file. Wins over --notes.
--auto-notesoffWrite the notes from the commits since the previous release
--draftoffStop before publishing, and leave the release as a draft
--modulesComma-separated ids of modules this release requires
--commitgit rev-parse HEADThe commit the release was built from
--repo-urlthe origin remoteThe repository's browse URL. SSH and .git remotes are turned into an https:// URL.

Artifacts. With --kind electron, the CLI files each file by its extension: .dmg and mac .zip under darwin, .exe under win32, .nupkg and RELEASES under win32-squirrel, and .AppImage, .deb, .rpm and .snap under linux. It uploads .blockmap files beside their artifact and ignores electron-builder's .yml files.

With --kind binary, it picks up <app>-<goos>-<goarch> binaries and <app>_<version>_<goos>_<goarch>.tar.gz (or .zip) archives, as described in Distribute a CLI. It skips files named for another app, ignores .sha256 and checksums.txt files, and stops if an archive is for a different version. The SHA-256 of each binary is printed as it uploads.

A release holds one kind. A directory that mixes the two is refused.

Running it again. A publish of a version the branch already has does not start over:

  • If that version is a draft, such as one a failed run left, the CLI resumes it. Files already uploaded with the same contents are skipped, and the rest are uploaded before it publishes. A file of the same name with different contents stops the run.
  • If it is already published from the same commit, the CLI says so and exits successfully, so a re-run job is harmless.
  • If the existing release was built from a different commit, or was published and then rescinded, the run stops. Publish a new version.

The commit is compared only when both sides have one (see --commit).

Auto notes. --auto-notes applies only when no other notes were given. It finds the newest published release on the same branch that shares a target with this one and was built from a different commit, or failing that the newest git tag on another commit. It then groups the commit subjects in between by their conventional-commit prefix:

## Features
- a new export format

## Bug Fixes
- the progress bar no longer stalls at 99%

feat!: and BREAKING CHANGE go under Breaking Changes, feat under Features, fix under Bug Fixes, perf under Performance, and anything without a prefix under Other. chore, ci, docs, style, refactor, test and build commits are left out. The job needs the git history for this, so in GitLab set GIT_DEPTH: 0.

publish-module

updater-cli publish-module --module <module-id> --version 2.1.0 --branch stable --file 'dist/*.zip'
Flag
--moduleThe module's name or id. Required.
--versionThe module release's version. Required.
--branchA branch name or id. Required.
--targetsComma-separated target names or ids. Default: every target on the branch.
--fileThe module's ZIP. A glob such as 'dist/*.zip' uploads every match. Required.
--platformdarwin, win32, linux or universal. Default: read from each filename, else universal.
--min-base-versionThe oldest app version this module release works with
--notesRelease notes
--draftLeave it as a draft

Quote a glob so the shell passes it through. Without --platform, a filename containing darwin or mac is darwin, one containing win is win32, and one containing linux is linux.

distribution

Distributions are ways to get the app that are not part of a release: an installer that sets things up before installing, or a link to an app store listing. They change less often than the app, so they are published on their own.

updater-cli distribution list
# The first time: creates the entry, then uploads the file.
updater-cli distribution publish --label "Windows installer" --platform win32 --version 1.0.0 --file dist/setup.exe

# After that: replaces the file and keeps the entry and its download URL.
updater-cli distribution publish --id <distribution-id> --version 1.0.1 --file dist/setup.exe
distribution publish flag
--fileThe file to upload. Required.
--idThe entry to upload into. Without it, a new entry is created.
--labelIts label, such as Windows installer. Required when creating.
--platformdarwin, win32, linux, ios, tvos, android, androidtv or other. Required when creating.
--versionThe version shown beside the label
--targetsComma-separated target names. Default: every target. Used when creating.
--privateLeave it off the public download page. Used when creating.
updater-cli distribution link --label "App Store" --platform ios --url https://apps.apple.com/app/id000000000

distribution link takes --label, --platform and --url, all required, plus --targets and --private as above. Nothing is hosted; the download page links to the listing.

upgrade

updater-cli upgrade

Replaces the running binary with the newest release of updater-cli from its Updater app, after checking the download against the published checksum. An install from npm is better upgraded with npm.

Flag
--app-urlThe app to upgrade from. Default https://updater.xeonr.io/77, or UPDATER_SELF_APP_URL.
--targetThe target to follow. Default stable, or UPDATER_SELF_TARGET.
--prereleaseFollow the prerelease target instead
--checkOnly report whether a newer version exists
--forceReinstall even when already up to date

Errors

MessageMeaning
--token or UPDATER_TOKEN is requiredA connection setting is missing. The same message names --api-url and --bucket-id.
app <id> not foundThe key's team does not own that app, or the bucket id is wrong
this API key is not bound to app <id>The key is bound to other apps
permission_denied: permission deniedThe key was used on a method only a signed-in person may call. See Authentication.
branch "<name>" not found, target "<name>" not foundCheck the names with updater-cli config
no targets found for branch …The branch has no targets to publish to. Add one in the console.
no binary artifacts found in distNothing in --dir matched. For --kind binary, check --app against the filenames.
… is an archive of version …, not …A stale build is in --dir
a draft of v<v> from commit <a> exists and this build is <b>A draft of this version came from another build. Delete the draft in the console, or publish a new version.
the draft of v<v> already holds a different <file>The draft being resumed has a file of that name with other contents
v<v> is already published from commit <a>, and this build is <b>Publish a new version
v<v> was published and then rescindedPublish a new version
module "<name>" not foundCheck the module's name or id in the console

On this page