Skip to content

update

spanical update replaces the running binary with the latest GitHub release. It checks the current version against releases/latest, downloads the asset for your platform, verifies it against the release's SHA256SUMS file, confirms the new binary runs, then swaps it in place. Nothing else in the install (config, cache under .spanical/) is touched.

bash
spanical update

Options

None. The command takes no flags.

Updates apply only to compiled binaries from a release install. A source checkout (cloned repo, bun link) refuses the command; pull and rebuild instead.

Behavior

  1. Prints the running version, then fetches the latest release tag from api.github.com
  2. Stops with Already up to date. when versions match, or Current version is newer than the latest release. No update needed. when the local build is ahead
  3. Downloads the platform asset to <binary>.update-tmp next to the installed binary
  4. Verifies the download's SHA256 hash against the release's SHA256SUMS file, then marks it executable
  5. Runs the downloaded binary once as a smoke check before anything is replaced
  6. Renames it over the current binary and prints the old and new versions

Downloads come only from GitHub release hosts on https; any other host fails validation. Setting GITHUB_TOKEN raises the API rate limit from 60 to 5000 requests per hour but is not required. If the install directory is not writable, the error suggests sudo spanical update.

A failed checksum, missing sums entry, or a new binary that will not run aborts the update with the existing binary untouched.

Examples

Already current on a binary install:

shell
$ spanical update
Current version: v0.1.0
Latest version:  v0.1.0

Already up to date.

Running from source refuses up front:

shell
$ spanical update
Update applies only to compiled binaries; running from source. Install a release binary or rebuild with `bun run build`.

A successful update ends like this (values match the release flow; the asset name varies by platform):

shell
$ spanical update
Current version: v0.1.0
Latest version:  v0.2.0

Downloading spanical-darwin-arm64...
Verified SHA256 checksum.

Updated! v0.1.0 → v0.2.0
Binary: /Users/you/.local/bin/spanical