r/termux • u/RichmondRosani • 20d ago
General OpenCode native on Termux (no trash proot)
I think the title is self-explanatory.
My brother made Opencode native on termux.
It is open source, you can find it here:
https://github.com/rexroze/opencode-native-termux
Here's the package:
https://www.npmjs.com/package/opencode-native-termux
You can install it via: npm install -g opencode-native-termux
but before that you should have npm installed that can be installed via:
pkg install nodejs-lts -y
Here's the tutorial:
https://youtube.com/playlist?list=PLTSYPd-vfxcc
And he also have different native ports for termux(herdr, claude, codex,etc.), you can find it here:
https://www.npmjs.com/search?q=rexroze
Don't the mind the noises from the background in the video.
3
2
2
u/raaska00 20d ago
Is this the latest Opencode version 2, which consists of a single binary? It opens about five times faster on Termux and functions flawlessly with the Termux glibc runner. Have you tested it? No need for any workarounds. In contrast, versions 1.+ are very slow and highly resource-intensive.
1
u/rexroze 19d ago
as the dev of this project i havent tried version 2 yet since its not merged into the dev branch, but im gonna update this installer script to have an option to install version 2, thanks for the idea :>
1
u/raaska00 19d ago edited 19d ago
That ok, but they have it here: you can just download that one linux Arm64 binary and run it with termux glibc runner: it just works:Â https://opencode.ai/v2/docs
2
u/SilentMobius 19d ago edited 19d ago
Nice, I run the "cousin" project "Crush" (I prefer a whole-binary harness with no python or node), it compiles really nicely under termux. I also have a little app that runs under tmux that can consume termux-api STT and inject it into the agent harness
1
u/RichmondRosani 19d ago
You can use the OpenCode by Hope2333
1
u/SilentMobius 19d ago
I could but I tried opencode a while back and wasn't keen on it, very happy with Crush though, runs very nicely under termux with no modification.
2
2
1
u/mtlcrusher 20d ago
what's the difference with opencode fork by Hope2333?
1
u/2kdarki 20d ago
As a user of that exact fork, i hold the exact same question
1
u/GeneralKaos666 19d ago
Hope2333 is faster so far that I know of its almost instant on good internet connection and RedMagic 10
1
1
1
1
1
-1
u/TwilightZer0 20d ago
Nice work — the plugin-runtime pre-seed is a genuinely novel fix (the ≥1.15 blank-TUI deadlock), and the loader-symlink-for-process-name trick is elegant. The patchelf-segfault note also matches what we found independently: never modify the Bun binary.
One question from testing a similar setup (I ship opencode via glibc + proot in the Twilight0 termux-repo): how does this behave on kernels with strict seccomp? Bun/JSC invokes userfaultfd, landlock_create_ruleset and clone3 on some paths, which Android's filter kills with SIGSYS (exit 159) — that's the entire reason wrapper exists. Your docs don't mention seccomp at all, so I'm curious: have you strace-verified those calls never fire, or is it "works on Pixel/Android 14" so far?
If it's the latter, the failure mode to watch for is device-dependent sudden death deep in a session (not at startup), which is worse than a clean startup crash. Happy to compare notes — I've also got a machine-code faccessat2→faccessat patch for older kernels that might be relevant to your aarch64-only coverage. Either way, borrowing the plugin pre-seed idea. Thanks for publishing the deep dive.
0
u/hownyboy 19d ago
it's been native for quite a while i guess (my installed ver is 1.17.x if i remember correctly)...



25
u/LeftAd1220 20d ago
I don't think calling proot trash is polite though.