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

  1. Queries the GitHub releases API for the latest release
  2. Compares the current version against the latest semantic version
  3. Downloads the platform-appropriate binary (e.g., coi-linux-amd64)
  4. Verifies the SHA256 checksum against the published checksums.txt
  5. Atomically replaces the current binary (temp file + rename)

Features

  • Checksum verification — Downloaded binary is verified against the SHA256 checksum from the release's checksums.txt before replacing the current binary
  • Symlink-aware — If coi is a symlink (e.g., claude-on-incuscoi), 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 with sudo
  • Dev build safety — Development builds (no version tag) print a warning and require --force to 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 --force after updating if the release includes image changes