Skip to content

feat(cli): port the upgrade command to v2 - #46183

Open
opencode-agent[bot] wants to merge 1 commit into
v2from
v2-upgrade
Open

feat(cli): port the upgrade command to v2#46183
opencode-agent[bot] wants to merge 1 commit into
v2from
v2-upgrade

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Summary

Add the missing V2 upgrade [target] command, backed by the existing CLI updater rather than the legacy installation stack.

  • Resolve the latest version from the current build's release channel, or install an explicit version with an optional leading v.
  • Detect the installation method automatically and support --method / -m overrides for curl, npm, pnpm, bun, and yarn.
  • Skip the already installed version, reject invalid targets, and report lookup/install failures with a nonzero exit code.
  • Preserve the V2 installer URL, package-manager build/trust flags, and temporary-cache cleanup. Correct Node-distribution detection and installation to use the published opencode-node package rather than its opencode2-node executable name.

The command does not start or restart the background service. Explicit upgrades do not depend on the automatic-update policy. Unknown installation methods require an explicit override; V1-only package-manager integrations are not advertised.

Usage

opencode2 upgrade
opencode2 upgrade <version>
opencode2 upgrade <version> --method bun

Validation

  • CLI package: bun test test/upgrade.test.ts test/updater-install.test.ts src/services/updater.test.ts test/debug-paths.test.ts test/cors.test.ts — 47 passed.
  • CLI package: bun typecheck — passed.
  • Prettier and git diff --check — passed.
  • Scoped Oxlint — zero errors; five consistent-return warnings.
  • Installer tests inject process results and use isolated temporary directories; no real installations or network downloads were performed.

Requested by: @rekram1-node (Aiden via Slack)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant