Skip to content

fix(cli): support mise-managed upgrades and uninstall - #48905

Open
gcavanunez wants to merge 1 commit into
anomalyco:v2from
gcavanunez:mise-updater
Open

gcavanunez wants to merge 1 commit into
anomalyco:v2from
gcavanunez:mise-updater

Conversation

@gcavanunez

@gcavanunez gcavanunez commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #36572
Fixes #36572

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

When OpenCode is installed with mise, it can find an update but cannot install it through mise. This adds mise support to the V2 CLI updater.

The updater finds the running installation and asks mise which config file selected it. It then uses mise to update that file, keeping its other tool options.

  • A normal update keeps latest as latest. A version setting such as 2.0 keeps the same format, for example 2.3.
  • If you give the upgrade command an exact version, mise saves that exact version.
  • The updater checks that mise selected the requested version in the same config file before reporting success.
  • If it cannot identify the installation or config, it stops. Unsupported version settings and changes to a different npm package also stop with an error. It does not try global npm instead.

Uninstall removes only the running version. It tells you that the mise config entry remains and can cause mise to install OpenCode again.

This adapts the work in #36573 to V2. That earlier PR was closed without merging.

How did you verify your code works?

Four real-mise tests for config updates passed. These use simulated installations, so they do not test release downloads. bun run check also passed.

Screenshots / recordings

N/A.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

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

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