anomalyco / anomalyco/opencode
[FEATURE]: Add android to v2 npm package supported OS for Termux compatibility
@nexxeln is already working on this.
Since Sep 6, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
OpenCode v2 beta (@opencode-ai/cli@beta) works on Termux/Android aarch64 using the existing musl loader, but npm rejects the install because android is not in the package supported OS list.
[!NOTE]
This issue does not exist in v1 — v1 requires a proxy/libresolvefix workaround because of Bun io_uring. v2 replaces Bun with Node.js, eliminating that problem entirely.
Test results
- Device: Pixel 10 (Android 17, Termux 0.119, aarch64)
- Package:
@opencode-ai/cli-linux-arm64-musl@0.0.0-beta-19192
| Command | Result |
|---|---|
opencode2 --version |
opencode2 v0.0.0-beta-19192 ✅ |
opencode2 --help |
Works ✅ |
Binary dependencies (click to expand)
The v2 musl binary only depends on:
libstdc++.so.6libc.musl-aarch64.so.1
No Bun, no JSC, no WebKit — significantly simpler than v1.
Current behavior
npm error code EBADPLATFORM
npm error notsup Unsupported platform for @opencode-ai/cli: wanted {"os":"darwin,linux,win32"} (current: {"os":"android"})
[!TIP]
Workaround:npm install -g @opencode-ai/cli@beta --force curl -fsSL https://raw.githubusercontent.com/DEAD1nsane/opencode-termux-musl/master/scripts/fix-opencode2-wrapper.sh | shThe
--forceflag bypasses the OS check. The fix script is required because the npm postinstall generates a broken wrapper that execs itself instead ofopencode2.exe, causing infinite recursion.
Full install output (click to expand)
$ npm install -g @opencode-ai/cli@beta
npm error code EBADPLATFORM
npm error notsup Unsupported platform for @opencode-ai/cli@0.0.0-beta-19192: wanted {"os":"darwin,linux,win32","cpu":"arm64,x64"} (current: {"os":"android","cpu":"arm64"})
npm error notsup Valid os: darwin,linux,win32
npm error notsup Actual os: android
Request
Add android to the supported OS list in the v2 npm package.
[!WARNING]
Without this change, Termux users must use--forceto install, which bypasses all platform safety checks. The generated wrapper also has a recursive self-call bug that requires a separate fix script. Both are not discoverable and give a poor first impression.
Why this should be straightforward (click to expand)
- The v2 binary is already compiled as
linux-arm64-musl— it runs on Android without modification - The
postinstall.mjsalready handles platform detection viaos.platform()which returns"android"on Termux - Adding
"android"to theosfield inpackage.jsonis a one-line change - No code changes needed — the binary works as-is
Wrapper bug details (click to expand)
The npm postinstall generates a shell wrapper at $PREFIX/bin/opencode2 that contains:
exec "$PREFIX/lib/node_modules/@opencode-ai/cli/bin/opencode2" "$@"
This execs the wrapper script itself (infinite recursion), not the actual binary (opencode2.exe). Additionally, the wrapper:
- Unnecessarily starts the Python HTTP proxy (v2 is Node.js-based, doesn't need it)
- Sets
HTTP_PROXY/HTTPS_PROXYwhich v2 doesn't need
The fix script (fix-opencode2-wrapper.sh) patches the ELF interpreter (binary expects /lib/ld-musl-aarch64.so.1 but Termux installs at $PREFIX/lib/) and creates a correct wrapper.
If this issue is resolved (adding android to supported OS), the postinstall.mjs should also be updated to generate a correct wrapper on Android.
Related
- #11689 — v1 feature request for Android binary (closed)
- #12515 — v1 postinstall fails with missing
opencode-android-arm64(closed) - guysoft/opencode-termux — community v1 cross-compile project
- DEAD1nsane/opencode-termux-musl — musl loader approach for v1 + v2 wrapper fix
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.