Skip to content

OpenCode AI V2 Support Termux #50203

Closed as not planned
Closed as not planned

Description

@nemoobc

OpenCode V2 now runs natively on Termux (Android) — no root, no proot

First of all, a huge thank you to the entire anomalyco / OpenCode team for building such an incredible tool. OpenCode has completely changed how I work on my Android device, and I truly appreciate the hard work that goes into this project. 🙏

I wanted to share a small community project that makes OpenCode V2 run natively on Termux (Android), without root and without proot:

🔗 Repository

https://github.com/nemoobc/opencode-termux

✨ What it does

  • Bundles the official OpenCode V2 binary (musl build) for Termux/Android (arm64 & x64)
  • Patches the ELF (PT_INTERP + RPATH) so the binary runs directly — including the background server re-exec, which is required by V2
  • Works without root, without proot, and without a chroot
  • Auto-stops the background server when the TUI exits (battery/RAM friendly)
  • Tab to switch between Build and Plan agents, just like V1

📦 Installation

npm install -g @nemoobc/opencode-termux
opencode-termux

That's it — the postinstall script downloads the official binary, patches it, and you're ready to go.

🧪 Tested

  • OpenCode V2.0.6 on Termux (aarch64), TUI + background server working

Again, thank you for OpenCode — this project is just a thin wrapper around your amazing work. All credit for the core CLI, agent system, and architecture belongs to the OpenCode team. ❤️

If this is useful, it would be amazing to see official Termux support in the future!

Activity

  1. Hope2333 commented on Sep 22, 2026

    @Hope2333

    Another approach: Native Bionic Build (source-compiled)

    Thanks @nemoobc for sharing your Termux wrapper! Heres an alternative approach that might interest the community:

    What we did

    We built opencode v2.0.x from source using the Android Bun toolchain, producing a pure bionic ELF — zero glibc dependency, no proot, no PT_INTERP patching.

    Key differences from the musl wrapper approach

    musl wrapper (nemoobc) B-line (source compile)
    Build method Patch existing musl binary Compile from source with Android Bun
    Dependencies musl loader (included) Pure bionic (Termux native)
    TUI support ✅ Works ✅ Works (after fixing opentui bionic build)
    Background server ✅ Auto-managed ✅ Works natively
    Versions Latest only 13 versions (2.0.0–2.0.12)
    Package format Wrapper script Native deb + pacman

    Repository

    https://github.com/Hope2333/opencode-termux (branch: native-android)

    Quick install

    # deb
    dpkg -i opencode_2.0.12_aarch64.deb
    
    # pacman
    pacman -U opencode-2.0.12-1-aarch64.pkg.tar.xz

    Technical details

    • Built with make batch-v2 VERS="2.0.[0-12]" PKG=native
    • Uses Bun 1.4.2 android build as compilation base
    • opentui bionic .so built from source (zig 0.16, zero glibc symbols)
    • openat2 shim for Termux seccomp compatibility during build
    • All 13 versions available on Push260922 release

    Both approaches have their merits — the musl wrapper is simpler for quick setup, while the B-line gives you a fully native build with version flexibility.

  2. Hope2333 commented on Sep 22, 2026

    @Hope2333

    Update: Release now includes 13 versions (2.0.0–2.0.12), all as Termux-native packages — not Debian/Ubuntu containers. Install directly with dpkg -i or pacman -U in Termux. No proot, no chroot, no glibc wrapper layer.

    https://github.com/Hope2333/opencode-termux/releases/tag/Push260922

  3. neriousy commented on Oct 20, 2026

    @neriousy
    Member

    Thanks for sharing your Termux setup. I'm closing this community project announcement here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions