You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
updater: windows update dialog runs bash and fails when bash is not installed #50886
On Windows, the "Update available" dialog attempts to run the Unix install script via bash, so the in-app update always fails with 'bash' is not recognized as an internal or external command on machines without bash in PATH (no Git Bash / WSL).
Environment
opencode version: v2.0.15 (bug observed on v2.0.14 before manually updating)
OS: Windows_NT 10.0.19045 (win32 x64)
Terminal: Unavailable: terminal app not identifiable (TERM=xterm-256color, TERM_PROGRAM unset)
Shell: C:\Windows\system32\cmd.exe
Install/channel: standalone binary in %USERPROFILE%\.opencode\bin (install.sh-style install), latest channel; an @opencode/cli npm global copy also present
Active plugins: none found (no opencode.json(c) in home/config/project, no plugin directories)
Reproduction
Use a Windows machine with no bash in PATH (no Git Bash, no WSL).
Install opencode as a standalone binary in %USERPROFILE%\.opencode\bin.
Launch opencode on a version older than the latest release.
When the "Update available" dialog appears, let it run / accept the update.
Expected Behavior
The updater should use a Windows-native update path (e.g. npm, or a PowerShell/binary download), or detect that bash is unavailable and show a clear manual-update instruction instead of a raw cmd error.
Actual Behavior
The dialog displays the cmd error instead of updating:
'bash' is not recognized as an internal or external command,
operable program or batch file.
The update never happens; this repeats every time a new release is available.
Additional Context
The standalone binary lives in %USERPROFILE%\.opencode\bin, which precedes the npm global directory in the user PATH, so the binary install is the one invoked by opencode.
Workaround used: download the platform package directly from npm (https://registry.npmjs.org/@opencode/cli-windows-x64/-/cli-windows-x64-<version>.tgz), extract package/bin/opencode.exe, rename the old binary, and copy the new one into %USERPROFILE%\.opencode\bin. This worked.
A possible fix direction: detect the install method/OS before spawning the updater, and on Windows without bash fall back to npm or the PowerShell download path.
Reproducible consistently whenever an update is available.
I'd like to take this on. Could you assign it to me if no one is already working on it?
I checked v2: in packages/cli/src/services/updater.ts, method() classifies %USERPROFILE%\.opencode\bin\opencode.exe as curl, and upgrade() then downloads the installer and invokes bash without checking availability.
For a focused first fix, I'd guard the Windows standalone path and return an actionable UpgradeError with manual-update instructions when bash is missing. I wouldn't silently switch to npm: with the reported PATH ordering, that could update a different installation while leaving the active binary unchanged.
I'd add regression tests for missing bash, a standalone install alongside npm, and the existing bash/package-manager paths, then open a small PR against v2. If you'd prefer a native standalone updater rather than the manual fallback allowed by the expected behavior, I'm happy to align on that scope first.
Thanks for the report! Since 2.0.23, Windows standalone updates locate Git Bash explicitly and, when it is missing, explain how to install Git for Windows or set OPENCODE_GIT_BASH_PATH rather than failing with the raw cmd error. Update with opencode upgrade or npm i -g @opencode/cli@latest (desktop: update the app). Please comment or reopen if this still happens on that version.
Activity
yang0228 commentedon Sep 23, 2026
I'd like to take this on. Could you assign it to me if no one is already working on it?
I checked
v2: inpackages/cli/src/services/updater.ts,method()classifies%USERPROFILE%\.opencode\bin\opencode.exeascurl, andupgrade()then downloads the installer and invokesbashwithout checking availability.For a focused first fix, I'd guard the Windows standalone path and return an actionable
UpgradeErrorwith manual-update instructions when bash is missing. I wouldn't silently switch to npm: with the reported PATH ordering, that could update a different installation while leaving the active binary unchanged.I'd add regression tests for missing bash, a standalone install alongside npm, and the existing bash/package-manager paths, then open a small PR against
v2. If you'd prefer a native standalone updater rather than the manual fallback allowed by the expected behavior, I'm happy to align on that scope first.neriousy commentedon Oct 20, 2026
Thanks for the report! Since 2.0.23, Windows standalone updates locate Git Bash explicitly and, when it is missing, explain how to install Git for Windows or set
OPENCODE_GIT_BASH_PATHrather than failing with the raw cmd error. Update withopencode upgradeornpm i -g @opencode/cli@latest(desktop: update the app). Please comment or reopen if this still happens on that version.