Self Update - mensfeld/code-on-incus GitHub Wiki
Self-Update
COI can update itself to the latest release directly from GitHub.
Usage
# Update to the latest release
coi update
# Check for updates without installing
coi update --check
# Skip confirmation prompt
coi update --force
How It Works
- Queries the GitHub releases API for the latest release
- Compares the current version against the latest semantic version
- Downloads the platform-appropriate binary (e.g.,
coi-linux-amd64) - Verifies the SHA256 checksum against the published
checksums.txt - Atomically replaces the current binary (temp file + rename)
Features
- Checksum verification — Downloaded binary is verified against the SHA256 checksum from the release's
checksums.txtbefore replacing the current binary - Symlink-aware — If
coiis a symlink (e.g.,claude-on-incus→coi), the symlink is resolved before replacing so existing symlinks continue working - Sudo auto-escalation — When the binary directory is not writable by the current user (e.g.,
/usr/local/bin), COI automatically re-executes withsudo - Dev build safety — Development builds (no version tag) print a warning and require
--forceto update
Examples
# Normal update flow
$ coi update
Current version: v0.7.0
Latest version: v0.8.0
Update available. Install? [Y/n] y
Downloading coi-linux-amd64...
Verifying checksum...
Updated to v0.8.0
# Check only
$ coi update --check
Current version: v0.7.0
Latest version: v0.8.0
Update available.
# Already up to date
$ coi update --check
Current version: v0.8.0
Latest version: v0.8.0
Already up to date.
Notes
- The update downloads from the GitHub releases page
- Only stable releases are considered (pre-releases are skipped)
- The update does not modify your configuration files or container images — run
coi build --forceafter updating if the release includes image changes