[PR #2558] fix(windows): force npm cmd shim generation and update install docs #10350

Closed
opened 2026-02-16 18:14:59 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/2558

State: closed
Merged: Yes


Prior art - #2419
Related issue - #631

NPM Cmd Shim

This PR implements a more robust solution for installing opencode on Windows via npm -

  • preinstall now modifies the package.json to use bin/opencode.cmd as it's sole entrypoint (while also removing the bin/opencode unix shell script.
  • postinstall forces npm to rebuild .cmd shims on Windows during the lifecycle event. This happens via the npm rebuild --bin-links command. This should ensure that the cmd shims are being generated.

The lifecycle hooks are now more dependent on npm specific behavior and will need more effort to figure out a solution for bun

Docs Update

  • Added Chocolatey, WinGet, Scoop installation instructions for Windows
  • Updated log files location
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/2558 **State:** closed **Merged:** Yes --- Prior art - #2419 Related issue - #631 ### NPM Cmd Shim This PR implements a more robust solution for installing opencode on Windows via npm - - `preinstall` now modifies the `package.json` to use `bin/opencode.cmd` as it's sole entrypoint (while also removing the `bin/opencode` unix shell script. - `postinstall` forces npm to rebuild `.cmd` shims on Windows during the lifecycle event. This happens via the `npm rebuild --bin-links` command. This should ensure that the cmd shims are being generated. The lifecycle hooks are now more dependent on npm specific behavior and will need more effort to figure out a solution for `bun` ### Docs Update - Added Chocolatey, WinGet, Scoop installation instructions for Windows - Updated log files location
yindo added the pull-request label 2026-02-16 18:14:59 -05:00
yindo closed this issue 2026-02-16 18:14:59 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10350