Skip to content

Windows + opencode v1.0 having a shebang #3736

Closed as duplicate
Closed as duplicate

Description

@zenyr

Description

I could not run opencode natively on a fresh windows 11 machine using bun i -g opencode-ai since opencode executable had a shebang prefix towards /bin/sh

OpenCode version

1.0.0+

Steps to reproduce

  • Windows 11
  • Bun
  • Use bun global installation for opencode-ai

Screenshot and/or share link

image

Operating System

Windows 11

Terminal

Windows CMD & Powershell

Activity

  1. added
    bugSomething isn't working
    on Nov 2, 2025
  2. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 2, 2025
  3. github-actions commented on Nov 2, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    • make bun install work on Windows #3363: make bun install work on Windows - This issue specifically mentions the same error about "/bin/sh" interpreter not found when using bun install -g opencode-ai on Windows
    • Windows Support #631: Windows Support - General Windows support tracking issue that covers various Windows-related problems including shebang issues
    • running opencode fails in alpine / musl based distros #649: running opencode fails in alpine / musl based distros - While focused on Alpine/musl, this issue also deals with shebang and executable problems in non-standard environments

    Feel free to ignore if none of these address your specific case.

  4. zenyr commented on Nov 2, 2025

    @zenyr
    ContributorAuthor

    Seems like a direct duplicate of

    Workaround (very experimental)

    • Use at your risk.
    # bun as example
    bun i -g opencode-ai
    
    # Symlink "oc" as opencode directly
    mklink "C:\Users\username\.bun\bin\oc.exe" "C:\Users\username\.bun\install\global\node_modules\opencode-windows-x64\bin\opencode.exe"
    
    # "Runs." (Kind of.)
    oc auth login
    oc run "Hello world"
    
  5. rekram1-node commented on Nov 2, 2025

    @rekram1-node
    Contributor

    We are gonna fix this, going to close as duplicate of 3363

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions