!WARNINGArchived Project - This repository was archived by the owner on Dec 17, 2025. It is now read-only.
The AUR package reliability issues that originally motivated this tool have been resolved. OpenCode can now be reliably updated through standard package managers. This documentation is preserved for historical reference and for users who may still have the tool installed.
OpenCode Updater is a mission-critical infrastructure tool designed to automate the lifecycle management of the opencode binary. It replaces fragile manual update processes and unreliable package managers (like AUR) with a deterministic, security-first compiled binary approach.
!IMPORTANT This tool performs privileged system operations (modifying
/usr/bin/). It is built with strict path validation and checksum integrity checks to ensure safe execution in production environments.
sudo access (required for writing to /usr/bin/)git, cargo (for building from source)The recommended installation method ensures you are running the exact code audited for your environment.
# 1. Clone the repository
git clone https://github.com/NocturnLabs/opencode-updater.git
cd opencode-updater
# 2. Build Release Binary
cargo build --release
# 3. Install to System Path (Optional)
sudo cp target/release/opencode-updater /usr/local/bin/
To update opencode to the latest stable release found on GitHub:
sudo opencode-updater
This default mode performs a Safety-First Update Cycle:
/usr/bin/opencode is backed up to ~/.local/share/opencode-updater/versions/./usr/bin/opencode.For users needing specific builds (e.g., debugging variants or beta releases), use the interactive CLI:
sudo opencode-updater --bin
Unlike simple curl | bash scripts, OpenCode Updater maintains a local registry of installed versions. This allows for instant rollbacks and audit trails.
Data Layout (~/.local/share/opencode-updater/):
versions/<version>/: Isolated directory for each installed version.
opencode: The binary file.metadata.json: Immutable record of the installation source, time, and checksum.current: Symlink pointing to the actively installed version.cache/: Local cache of GitHub API responses to prevent rate-limiting.The tool implements a Polyglot Extractor that handles distribution variances automatically:
.zip assets (standard release format)..tar.gz if the zip is unavailable.../../bin/sh) before any file is written.Security is enforced by default. The updater looks for a corresponding {asset}.sha256 file in the release assets.
Arguments are passed strictly via CLI flags to ensure stateless operation in CI/CD pipelines. State is persisted only for version history.
| Flag | Value Type | Default | Description |
|---|---|---|---|
--rollback | VERSION | None | Instantly reverts /usr/bin/opencode to a previously installed version. |
--bin | Boolean | false | Enables ncurses-style interactive menu for selecting specific release assets. |
--force | Boolean | false | Bypasses "Already on latest version" checks. Useful for repairing corrupted installs. |
--keep-versions | Integer | 2 | Number of previous versions to retain in local storage before auto-pruning. |
--changelog | VERSION | latest | Fetches and renders the Markdown release notes for the specified version. |
--compare | [V1, V2] | None | Renders a diff of changes between two versions. |
metadata.json)Each installed version includes a strict JSON manifest:
{
"version": "1.0.73",
"tag_name": "v1.0.73",
"release_date": "2025-11-18T12:00:00Z",
"download_url": "https://github.com/...",
"checksum": "a1b2c3d4...",
"installed_at": "2025-12-13T10:00:00Z",
"install_path": "/usr/bin/opencode",
"release_notes": "Fixes critical bug in..."
}
mv to /usr/bin) invokes sudo. The tool accepts this privilege escalation requirement as a security feature—preventing unprivileged user processes from modifying system binaries.extract_archive function validates every file entry against std::path::Component::ParentDir to strictly confine extraction to the temporary workspace.tar archives, extended attributes are intentionally dropped to prevent privilege escalation vulnerabilities on misconfigured filesystems.View the complete state of your OpenCode environment.
opencode-updater --list-versions
Output:
📦 opencode Versions
✅ Current: 1.0.73 (installed: 2025-12-13 14:30)
📁 Installed Versions:
→ 1.0.73 (2025-12-13)
1.0.72 (2025-11-20)
1.0.70 (2025-11-10)
🌐 Available Updates:
📦 v1.0.74 (2025-12-14)
📦 v1.0.73 (2025-11-18)
Emergency reversion to a stable state.
sudo opencode-updater --rollback 1.0.72
Output:
Successfully rolled back to version 1.0.72
Read what's new before updating.
opencode-updater --changelog latest
Output:
📦 Release: v1.0.74 (v1.0.74)
📅 Published: 2025-12-14T09:00:00Z
## What's Changed
* Fixes memory leak in websocket handler
* Adds new 'forge' sub-command
* Performance improvements for large codebases
OpenCode Console
A high-performance, web-based observability and management interface for the OpenCode AI coding agent.
Scaffold
Scaffold is the premier project bootstrapping tool for the Yum ecosystem. It provides a robust, template-based generation engine that eliminates boilerplate and ensures consistency across all your projects. Whether you're building a simple CLI tool, a complex web application, or an autonomous agent plugin, Scaffold gets you from zero to code in seconds.