appitool self-update
Checks GitHub Releases (appibara-ltd/appitool) for a newer semantic version and upgrades the currently running appitool binary in place after verifying its SHA256 checksum against checksums.txt and its GitHub build provenance attestation (with sigstore-swift, cross-checked with the GitHub CLI gh when it is installed).
How It Works
- Queries
https://api.github.com/repos/appibara-ltd/appitool/releases/latest. - Compares the remote tag (
SemanticVersion) against the running binary's version. - Selects the matching archive for the current OS & CPU architecture:
appitool-darwin-arm64.tar.gz(oruniversal)appitool-linux-x86_64.tar.gz/appitool-linux-arm64.tar.gz
- Downloads the archive and
checksums.txtand verifies the SHA256 digest. - Build provenance: fetches the archive's Sigstore attestation bundles from the public attestations API (
/repos/appibara-ltd/appitool/attestations/sha256:<digest>; nogh auth loginrequired). This proves the archive was built by the release workflow, not just uploaded to the release.- sigstore-swift (always): at least one bundle must verify against Sigstore's trusted root, fetched over TUF (public-good from
tuf-repo-cdn.sigstore.dev, or GitHub's instance fromtuf-repo.github.comwith the TUF root embedded in appitool, the same oneghships). TUF metadata is cached in~/.sigstore/rootfor one day. The bundle must be an SLSA v1 provenance statement for the archive's SHA256 digest, signed byhttps://github.com/appibara-ltd/appitool/.github/workflows/release.yml@…(issuerhttps://token.actions.githubusercontent.com, source repositoryhttps://github.com/appibara-ltd/appitool). A missing or invalid attestation, or an unreachable TUF repository, aborts the update. ghcross-check (when installed): ifghis found onPATH(or in/opt/homebrew/bin,/usr/local/bin,/usr/bin,/bin), also runsgh attestation verify --bundle … --repo appibara-ltd/appitool --signer-workflow appibara-ltd/appitool/.github/workflows/release.yml. Ifghrejects what sigstore-swift accepted, the update is aborted as a disagreement. Withoutghthe cross-check is skipped with a notice.
- sigstore-swift (always): at least one bundle must verify against Sigstore's trusted root, fetched over TUF (public-good from
- Extracts
appitooland atomically swaps the executable (with rollback on failure), then creates or updates theaptlsymlink next to it (skipping with a warning if a non-symlink file or a symlink to another tool already exists there). Runningself-updatewithout--checkalso ensures theaptlsymlink when already up to date and the install directory is writable.
To run the build provenance check on an archive you downloaded yourself, use appitool attestation verify.
TIP
If you hit GitHub API rate limits (e.g., in CI or shared networks), export GITHUB_TOKEN (or GH_TOKEN) or configure GITHUB_TOKEN in .env.
Synopsis
bash
appitool self-update [options]Flags
| Flag | Default | Description |
|---|---|---|
--check | false | Check whether an update is available without downloading or installing. |
--force | false | Force download and re-installation even if already on the latest version. |
--skip-attestation | false | Skip the GitHub build provenance check (sigstore-swift and the gh cross-check); the SHA256 checksum is still verified. |
Examples
bash
# Check if a newer release exists
appitool self-update --check
# Upgrade to the latest release
appitool self-update
# Force reinstall (use sudo if installed into a root-owned /usr/local/bin)
sudo appitool self-update --force
# Update without the build provenance check
appitool self-update --skip-attestation