Windows + opencode v1.0 having a shebang #2472

Closed
opened 2026-02-16 17:35:48 -05:00 by yindo · 3 comments
Owner

Originally created by @zenyr on GitHub (Nov 2, 2025).

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

Originally created by @zenyr on GitHub (Nov 2, 2025). ### 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 <img width="1405" height="637" alt="image" src="https://github.com/user-attachments/assets/fb0bf051-5573-44e6-b746-2a54a627e136" /> ### Operating System Windows 11 ### Terminal Windows CMD & Powershell
yindo added the opentuibug labels 2026-02-16 17:35:48 -05:00
yindo closed this issue 2026-02-16 17:35:48 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 2, 2025):

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

  • #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
  • #631: Windows Support - General Windows support tracking issue that covers various Windows-related problems including shebang issues
  • #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.

@github-actions[bot] commented on GitHub (Nov 2, 2025): This issue might be a duplicate of existing issues. Please check: - #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 - #631: Windows Support - General Windows support tracking issue that covers various Windows-related problems including shebang issues - #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.
Author
Owner

@zenyr commented on GitHub (Nov 2, 2025):

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"
@zenyr commented on GitHub (Nov 2, 2025): Seems like a direct duplicate of - #3363 # 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" ```
Author
Owner

@rekram1-node commented on GitHub (Nov 2, 2025):

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

@rekram1-node commented on GitHub (Nov 2, 2025): We are gonna fix this, going to close as duplicate of 3363
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2472