Skip to content

feat(installation): enable curl-based self-upgrade#35

Merged
Alezander9 merged 2 commits intomainfrom
feat/enable-curl-upgrade
May 3, 2026
Merged

feat(installation): enable curl-based self-upgrade#35
Alezander9 merged 2 commits intomainfrom
feat/enable-curl-upgrade

Conversation

@Alezander9
Copy link
Copy Markdown
Member

What

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 user's original curl ... | bash install.

Replaces the BCODE_UPGRADE_DISABLED = true stub 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 --force followed by re-curling the install script. With this change they just run bcode upgrade (or get an in-place upgrade on TUI start, gated by config.autoupdate).

Scope

Curl-only for now since that's our only distribution channel. The detection function returns "curl" for ~/.bcode/bin / ~/.local/bin installs and "unknown" for everything else. When we ship to npm/brew/scoop/choco we'll re-introduce per-method branches from upstream anomalyco/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 installed opencode-ai and try to upgrade the wrong binary.
  • latest(): GitHub releases lookup repointed anomalyco/opencodebrowser-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.

Test plan

  • bun typecheck passes (filtered turbo run + per-package).
  • Will verify end-to-end after merge by running bcode upgrade against an older v0.0.x release on a curl-installed binary on Mac + Linux.

Notes for reviewer

  • This is a Yellow-zone change (packages/opencode/src/). Diff is mostly deletion (-185 / +24).
  • Logic for non-curl methods is removed rather than commented out, per repo style.
  • bcode-sh/install already accepts VERSION as an env var (existing in install.sh), no changes needed there.

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`.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

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.
@Alezander9 Alezander9 merged commit 3eb6aa4 into main May 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant