Docs
View as markdown

relate upgrade

The relate upgrade command and its update alias, which replace the running binary with the latest signed release, with checks, sources and exit codes.

cli

relate upgrade replaces the running relate binary with the latest release, after checking the release's checksum list against the signing key built into the binary. relate update is the same command. --check reports the installed and latest versions and changes nothing. Self-upgrade runs on macOS and Linux, on amd64 and arm64; it never opens a store A relate database: a directory, a single .rl file, or :memory:, opened with --database. Read more in the glossary. The release URLs on this page are the launch-day locations: before launch, nothing is published at them.

Synopsis

relate upgrade [--yes] [--check]
relate update  [--yes] [--check]
RunReadsChanges
relate upgrade --checkThe release listNothing
relate upgradeThe release list, then the newer release's filesThe binary at its current path, then the installed skill copies

Options

FlagArgumentDefaultScopeSinceDescription
--yes—offrelate upgrade—Install the skill bundle after the upgrade when none is installed yet, without a prompt.
--check—offrelate upgrade—Read-only report of the current and latest versions.

A — under Since: the data does not record the release that added the flag.

Any other argument, such as --json, is a usage error (exit code 2).

What it checks

relate upgrade runs these steps in order and stops at the first that fails. A failure before the last step leaves the running binary as it was.

StepCheckOn failure
1The platform is macOS or Linux on amd64 or arm64Exits 1; on Windows the message points to a manual download, because a running .exe cannot replace itself
2releases.json is read, and its latest.tag has the form v<major>.<minor>.<patch>Exits 1 naming the URL and the reinstall command
3The latest version is compared with the binary's own as three numbersNot newer: prints that relate is up to date and exits 0
4The release lists the platform binary (relate-<os>-<arch>), SHA256SUMS and SHA256SUMS.sigExits 1 naming the missing file
5SHA256SUMS.sig verifies over the exact bytes of SHA256SUMS, as an SSH signature in the relate-release namespace, against the public key built into the binaryExits 1
6The first line of SHA256SUMS, # relate-release-version: <tag>, names the release from step 2Exits 1; a list without that line is accepted only for a release at or below v0.14.0, and with a warning
7The platform binary is downloaded, and its SHA-256 equals its line in SHA256SUMSExits 1: checksum verification failed for <asset> (expected <hash>, got <hash>); not upgrading
8The new binary replaces the running one at its pathExits 1 naming the reinstall command
9The skill copies are refreshedNever fails the upgrade

--check stops after step 3. The key is the one install.sh pins; the security reference gives it and the manual checks that match these steps. Steps 4 to 9 are described from the binary's source, not from a recorded run, because no release newer than the verified version exists to upgrade to.

Where it downloads from

FileLocationVariable that overrides it
The release listhttps://relatedb.ai/releases.jsonRELATE_RELEASES_JSON_URL
SHA256SUMS, SHA256SUMS.sig and the binaryhttps://github.com/relatedb/relate/releases/download/<tag>/<file>RELATE_RELEASE_DOWNLOAD_URL (the part before /<tag>)
The same three files, when the first location answers 404 and GITHUB_TOKEN is setThe GitHub API's release-asset route, https://api.github.comRELATE_GITHUB_API_URL

GITHUB_TOKEN, when set, is sent as a bearer token on the requests for the three files and never on the request for releases.json, and is never printed. The release list request has no retry, no cache, and no fallback location.

VariableEffectDefaultUsed by
GITHUB_TOKENOptional bearer token for release-asset downloads; required while the repository is internal.—relate upgrade, relate extension install
RELATE_RELEASES_JSON_URLOverride the release-metadata URL (dev and test).https://relatedb.ai/releases.jsonrelate upgrade
RELATE_RELEASE_DOWNLOAD_URLOverride the base of the direct release-download route (dev and test).https://github.com/relatedb/relate/releases/downloadrelate upgrade, relate extension install
RELATE_GITHUB_API_URLOverride the base of the GitHub API asset route (dev and test).https://api.github.comrelate upgrade, relate extension install

Skill refresh

After the binary is replaced, relate upgrade runs relate skill install from the new binary for every detected agent, so the installed skill The SKILL.md cheat sheet and reference files a coding agent reads before it uses relate; relate skill install writes them. Read more in the glossary matches the new version:

Detected agentsWhat happens
At least one holds a relate copyInstalls into every detected agent without a prompt
None holds a copy, stdin is a terminalAsks Install the relate skill? [Y/n] first
None holds a copy, --yesInstalls without asking
None holds a copy, not a terminal, no --yesPrints run: relate skill install and installs nothing
A directory relate does not manageLeft untouched, with a note naming it
No agent detectedNothing

The relate skill reference defines the states.

Output

Every successful outcome, --check included, prints its status lines and nothing after them; releases up to 0.1.1 also printed a two-line notice of the project's rename.

OutcomeStatus lines on stdout
--check, currentcurrent version: <version>, latest release: <version>, relate is up to date
--check, newer releasecurrent version: <version>, latest release: <version>, upgrade available: run `relate upgrade` to install <version>
No --check, currentrelate <version> is up to date (latest release: <version>)
No --check, upgradedupgrading relate <old> -> <new> (<asset>), then upgraded relate <old> -> <new> at <path>

Every failure starts with Error: upgrade: on stderr and exits 1; a failed replace (step 8) adds a second line that names the reinstall command.

Errors and exit codes

Exit codeWhen
0Up to date, --check completed, or the upgrade completed
1Any failure in the steps of What it checks, including no network
2A usage error: Error: unexpected argument to upgrade: <argument>, then the usage line and Run 'relate upgrade --help' for more information.

When the release list cannot be read, the message names its URL, the reason, and the reinstall command:

Error: upgrade: could not read the release list from <url>: GET failed: <reason>; reinstall manually instead: curl -sSfL https://relatedb.ai/install.sh | GITHUB_TOKEN=$(gh auth token) bash

Examples

The --check runs on this page were recorded with RELATE_RELEASES_JSON_URL pointing at a copy of releases.json served from the local machine, so they needed no network. With the latest release equal to the installed version:

relate upgrade --check
current version: 0.1.2
latest release:  0.1.2
relate is up to date

With the copy edited to list a higher version, v0.99.0, the report names it and nothing is downloaded:

current version: 0.1.2
latest release:  0.99.0
upgrade available: run `relate upgrade` to install 0.99.0

A run that cannot reach the release list exits 1. This one had RELATE_RELEASES_JSON_URL=http://127.0.0.1:8874/releases.json with nothing listening; the text after io: comes from the operating system, and this recording is from macOS:

Error: upgrade: could not read the release list from http://127.0.0.1:8874/releases.json: GET failed: io: Connection refused (os error 61); reinstall manually instead: curl -sSfL https://relatedb.ai/install.sh | GITHUB_TOKEN=$(gh auth token) bash

A flag the command does not take is a usage error:

relate upgrade --json
echo "exit=$?"
Error: unexpected argument to upgrade: --json
Usage: relate upgrade [--yes] [--check]
Run 'relate upgrade --help' for more information.
exit=2

See also