feat(installation): enable curl-based self-upgrade#35
Merged
Alezander9 merged 2 commits intomainfrom May 3, 2026
Merged
Conversation
Re-enables `bcode upgrade` and the TUI auto-upgrade-on-launch flow for curl-installed users. The hosted `https://bcode.sh/install` script is re-run with VERSION=<target>, which writes the new binary to ~/.bcode/bin/bcode in place — same flow as the original install. Changes from the previous BCODE_UPGRADE_DISABLED stub: - `method()`: only returns "curl" (~/.bcode/bin or ~/.local/bin) or "unknown". The package-manager detection logic for npm/brew/scoop/choco is removed, since BrowserCode doesn't publish to those registries yet and running those checks would either be no-ops or (worse) match an installed `opencode-ai` and try to upgrade the wrong binary. - `latest()`: GitHub releases lookup repointed to `browser-use/browsercode`. For non-curl methods returns the current version so the TUI auto-upgrade check stays silent for devs running from source. - `upgrade()`: curl branch only. Other methods return a clear error pointing at https://bcode.sh/install. Net effect for users: `bcode upgrade` works, and the TUI notifies on new releases (gated by config.autoupdate, same as upstream). When we ship to npm/brew/etc., we'll re-introduce per-method branches from upstream `anomalyco/opencode`.
Both UpgradeFailedError raise-sites now show: curl -fsSL https://bcode.sh/install | bash For the non-curl method path: replaces the prose hint with the runnable command. For the curl path that exited non-zero: keeps the install script's own stderr (useful diagnostic) and appends the one-liner as a fallback hint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Re-enables
bcode upgradeand the TUI auto-upgrade-on-launch flow for curl-installed users. The hostedhttps://bcode.sh/installscript is re-run withVERSION=<target>, which writes the new binary to~/.bcode/bin/bcodein place — same flow as the user's originalcurl ... | bashinstall.Replaces the
BCODE_UPGRADE_DISABLED = truestub from PR #12 (the stub was a foot-gun guard while we didn't have our own release infrastructure; we now publish all 12 platform assets every release, so the curl path works end-to-end).Why
Users currently update by running
bcode uninstall --forcefollowed by re-curling the install script. With this change they just runbcode upgrade(or get an in-place upgrade on TUI start, gated byconfig.autoupdate).Scope
Curl-only for now since that's our only distribution channel. The detection function returns
"curl"for~/.bcode/bin/~/.local/bininstalls and"unknown"for everything else. When we ship to npm/brew/scoop/choco we'll re-introduce per-method branches from upstreamanomalyco/opencode.Key changes in
packages/opencode/src/installation/index.ts:method(): returns"curl"or"unknown". Removed the npm/yarn/pnpm/bun/brew/scoop/choco detection — running those today would either no-op or match an installedopencode-aiand try to upgrade the wrong binary.latest(): GitHub releases lookup repointedanomalyco/opencode→browser-use/browsercode. For non-curl methods returns the current version so the TUI auto-upgrade check stays silent for devs running from source.upgrade(): curl branch only. Other methods return a clear error pointing athttps://bcode.sh/install.Test plan
bun typecheckpasses (filtered turbo run + per-package).bcode upgradeagainst an older v0.0.x release on a curl-installed binary on Mac + Linux.Notes for reviewer
packages/opencode/src/). Diff is mostly deletion (-185 / +24).bcode-sh/installalready acceptsVERSIONas an env var (existing ininstall.sh), no changes needed there.