Skip to content

Conversation

@itsrainingmani
Copy link
Contributor

@itsrainingmani itsrainingmani commented Jan 14, 2026

What does this PR do?

Adds support for opencode upgrade to work with Chocolatey and Scoop installations. This works by adding choco and scoop commands to the relevant methods in the Installation namespace -

  • Installation.method: add choco list and scoop list commands
  • Installation.upgrade: add choco upgrade --version=<target> and scoop install opencode@<target> commands
  • Installation.latest: fetch the latest version number of the choco and scoop opencode packages from public manifest URLs

How did you verify your code works?

Chocolatey

PS C:\Users\Mani\repos\opencode\dev--win-auto-update> opencode -v
1.1.17
PS C:\Users\Mani\repos\opencode\dev--win-auto-update> bun dev upgrade
$ bun run --cwd packages/opencode --conditions=browser src/index.ts upgrade

                                   ▄
  █▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█
  █░░█ █░░█ █▀▀▀ █░░█ █░░░ █░░█ █░░█ █▀▀▀
  ▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀  ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀


┌  Upgrade
│
●  Using method: choco
│
●  From v1.1.171.1.18
│
◇  Upgrade complete
│
└  Done

PS C:\Users\Mani\repos\opencode\dev--win-auto-update> opencode -v
1.1.18

Scoop

PS C:\Users\Mani\repos\opencode\dev--win-auto-update> opencode -v
1.1.17
PS C:\Users\Mani\repos\opencode\dev--win-auto-update> bun dev upgrade
$ bun run --cwd packages/opencode --conditions=browser src/index.ts upgrade

                                   ▄
  █▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█
  █░░█ █░░█ █▀▀▀ █░░█ █░░░ █░░█ █░░█ █▀▀▀
  ▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀  ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀


┌  Upgrade
│
●  Using method: scoop
│
●  From v1.1.171.1.18
│
◇  Upgrade complete
│
└  Done

PS C:\Users\Mani\repos\opencode\dev--win-auto-update> opencode -v
1.1.18

Notify Update

latest() pulls in the right version for our chocolatey based install (1.1.18 at the time of this PR whereas latest release is on 1.1.19

image

Not an Elevated Command Shell

Chocolatey has an annoying issue where it doesn't allow installation or upgrading a package if you're not in an elevated command shell. This "error" also passes to stdout and not stderr so we pass a custom error message to the UpgradeFailedError so we can capture it in the upgrade.ts and communicate this to the user.

image

Output of upgrade w/ a non-elevated command shell (this has been tested on cmd and non-elevated powershell.

PS C:\Users\Mani\repos\opencode\dev--win-auto-update> bun dev upgrade
$ bun run --cwd packages/opencode --conditions=browser src/index.ts upgrade

                                   ▄
  █▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█
  █░░█ █░░█ █▀▀▀ █░░█ █░░░ █░░█ █░░█ █▀▀▀
  ▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀  ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀


┌  Upgrade
│
●  Using method: choco
│
●  From v1.1.171.1.18
│
■  Upgrade failed
│
■  Please run the terminal as Administrator and try again
│
└  Done

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@rekram1-node rekram1-node merged commit ad17e8d into anomalyco:dev Jan 14, 2026
5 checks passed
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.

2 participants