Skip to content

Install script doesn't work on windows 11 #63352

Closed as duplicate
Closed as duplicate

Description

@jorgeEF

Description

Install command: curl -fsSL https://opencode.ai/v2/install | bash doesn't work on windows 11.

It ask for WSL which I don't want at all. Is there any other way to install OpenCode CLI on windows without using npm?

Plugins

none

OpenCode version

None, it doesn't install.

Steps to reproduce

Try to install OpenCode on windows 11 with command curl -fsSL https://opencode.ai/v2/install | bash

Screenshot

2026-11-11_14-54-09_WindowsTerminal

Operating System

Windows 11 26H2

Terminal

Powershell 7

Activity

  1. opencodejr commented on Nov 11, 2026

    @opencodejr
    Contributor

    Thanks for the report, @jorgeEF. I think this is a duplicate of #51755. Its remaining open part is a way to install (and upgrade) OpenCode v2 from native PowerShell without WSL or Git Bash, for example a PowerShell installer.

    The curl ... | bash installer is a bash script. In PowerShell, bash usually points to the WSL launcher (C:\Windows\system32\bash.exe), which is why it asks you to install WSL. These options don't need WSL or npm:

    • Standalone binary: download the zip for your machine (x64, ARM64, or x64 baseline for older CPUs). Extract opencode.exe to a folder of your choice, e.g. %USERPROFILE%\.opencode\bin, and add that folder to your PATH.
    • Git Bash: if you have Git for Windows, run the same curl -fsSL https://opencode.ai/v2/install | bash command from Git Bash instead of PowerShell. The installer supports Windows when it runs there.
    • Desktop app: there is also a Windows installer for OpenCode Desktop (x64, ARM64).

    Possible duplicates and related issues, ordered from most to least likely:

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. jorgeEF commented on Nov 11, 2026

    @jorgeEF
    Author
    * **Standalone binary:** download the zip for your machine ([x64](https://opencode.ai/update/api/latest/cli/opencode/opencode-windows-x64.zip), [ARM64](https://opencode.ai/update/api/latest/cli/opencode/opencode-windows-arm64.zip), or [x64 baseline](https://opencode.ai/update/api/latest/cli/opencode/opencode-windows-x64-baseline.zip) for older CPUs). Extract `opencode.exe` to a folder of your choice, e.g. `%USERPROFILE%\.opencode\bin`, and add that folder to your `PATH`.
    

    Manually downloading the binary and setting the environment variable works but the command opencode update doesn't work wich turn this "install" method useless because every update has to be made manually.

  3. opencodejr commented on Nov 11, 2026

    @opencodejr
    Contributor

    Thanks for trying it and reporting back, @jorgeEF. You're right: with only the zip, updating from native PowerShell isn't supported today. That gap is what #51755 tracks, which is why I think this is a duplicate of it.

    Here is how opencode upgrade (update is an alias) works on Windows right now:

    • It only treats a binary as the installer-managed copy when it is at %USERPROFILE%\.opencode\bin\opencode.exe. Anywhere else it stops with "Could not detect the installation method. Pass --method to choose how to upgrade OpenCode."
    • For that copy, it downloads the same bash installer and runs it with Git Bash (from Git for Windows, not WSL). It finds Git Bash through git on your PATH, or you can point it there with the OPENCODE_GIT_BASH_PATH environment variable. If there is no Git Bash, it stops with "Git Bash is required to update OpenCode".

    If you're OK with having Git for Windows installed (it doesn't need WSL), you can keep using the zip build and still upgrade in place:

    1. Put opencode.exe in %USERPROFILE%\.opencode\bin\ and keep that folder on your PATH.
    2. Run opencode upgrade from PowerShell. If it still can't detect the method, run opencode upgrade --method curl.

    Updating without Git Bash (for example a native PowerShell installer or a working WinGet package) isn't available yet:

    Unless you think your case is different from #51755, this issue will still be closed as a duplicate. If the upgrade fails even with Git Bash installed and the binary in %USERPROFILE%\.opencode\bin, please reply with the exact error message.

  4. opencodejr commented on Nov 12, 2026

    @opencodejr
    Contributor

    I'm closing this as a duplicate of #51755, which tracks installing and upgrading OpenCode v2 from native PowerShell without WSL or Git Bash. That's the gap you hit: the zip build runs fine, but opencode upgrade can't update it without Git Bash. Please follow #51755 and add your 👍 there. #56297 tracks the WinGet package, which isn't published yet.

    I waited a day in case your problem turned out to be different, for example if the upgrade still failed with Git Bash installed and the binary in %USERPROFILE%\.opencode\bin. If that happens, or if you think this isn't covered by #51755, reply here with the exact error and this issue will be reopened.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions