Browse Source

fix(cli): use node shebang so npx/npm install works without bun

The CLI is built with `bun build --target node --format esm` and contains no
Bun-specific runtime APIs (`Bun.*` and `bun:` modules live only in the plugin
TUI and tests, not in the CLI bundle). The only thing forcing a Bun runtime was
the `#!/usr/bin/env bun` shebang on the entrypoint, which made `npx`/`npm exec`
fail with "env: 'bun': No such file or directory" on machines without Bun.

Switching the entrypoint shebang to node lets `npx oh-my-opencode-slim install`
run on a stock Node install while remaining fully compatible with Bun. bun's
bundler preserves the entrypoint shebang, so the published dist picks this up on
the next build. Also document the npx path in the README.
Jiajun0413 3 weeks ago
parent
commit
91d5e2a374
2 changed files with 8 additions and 1 deletions
  1. 7 0
      README.md
  2. 1 1
      src/cli/index.ts

+ 7 - 0
README.md

@@ -101,6 +101,13 @@ Install and configure oh-my-opencode-slim: https://raw.githubusercontent.com/alv
 bunx oh-my-opencode-slim@latest install
 ```
 
+The published CLI is a Node-compatible bundle, so `npx` works too if you don't
+have Bun installed:
+
+```bash
+npx oh-my-opencode-slim@latest install
+```
+
 ### Run from Master
 
 Use this if you want the latest code, easier bug fixes, or a local setup for

+ 1 - 1
src/cli/index.ts

@@ -1,4 +1,4 @@
-#!/usr/bin/env bun
+#!/usr/bin/env node
 import { doctor, parseDoctorArgs } from './doctor';
 import { install } from './install';
 import { getGeneratedPresetNames, isGeneratedPresetName } from './providers';