Skip to content

About

Native opencode for Android / Termux (Bionic aarch64). Stable, beta and dev channels, built and published automatically.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

23 stars

Watchers

0 watching

Forks

Repository files navigation

opencode for Termux — native Android build (Bionic aarch64)

opencode, the open-source AI coding agent, running natively on your Android phone through Termux. No proot, no chroot, no VM, no root, no glibc. One self-contained binary, a signed apt repository, three channels.

opentui-js opentui-so

Screenshots

Native TUI, rendered on-device — no proot, no VNC, no WebView:

opencode welcome page in Termux on Android opencode model picker in Termux, including free models

Free models are in the picker too — you can start coding without paying for anything.

Install

Choose a channel; everything else is automatic:

You want Run inside Termux
stable (recommended) curl -fsSL https://raw.githubusercontent.com/bd-loser/opencode-bionic/main/repo-setup.sh | bash
beta curl -fsSL https://raw.githubusercontent.com/bd-loser/opencode-bionic/main/repo-setup.sh | OPENCODE_CHANNEL=beta bash
dev curl -fsSL https://raw.githubusercontent.com/bd-loser/opencode-bionic/main/repo-setup.sh | OPENCODE_CHANNEL=dev bash

The script adds this signed apt repository and installs opencode — from then on pkg upgrade opencode keeps you on your channel's newest build. Rather not pipe anything to bash? The script only automates these two commands:

curl -fsSL https://bd-loser.github.io/opencode-bionic/opencode-bionic.gpg \
  -o $PREFIX/etc/apt/trusted.gpg.d/opencode-bionic.gpg
echo "deb [arch=aarch64] https://bd-loser.github.io/opencode-bionic stable main" \
  > $PREFIX/etc/apt/sources.list.d/opencode-bionic.list
pkg update && pkg install opencode

Swap stable for beta or dev in the deb line to switch lines — one suite at a time, the package is opencode in all of them.

Prefer a single .deb, or an exact version?

curl -fsSL https://raw.githubusercontent.com/bd-loser/opencode-bionic/main/install.sh | bash

install.sh SHA256-verifies and dpkg-installs the latest stable. It can also install any version ever shipped — the apt repo carries only each channel's newest build:

# exact versions are full strings: dev/beta carry a commit suffix, bare
# "2.0.30" does not exist — use e.g. 2.0.30-dev.fc2fc596
curl -fsSL https://raw.githubusercontent.com/bd-loser/opencode-bionic/main/install.sh | OPENCODE_VERSION=v1.18.35 bash
curl -fsSL https://raw.githubusercontent.com/bd-loser/opencode-bionic/main/install.sh | OPENCODE_CHANNEL=beta OPENCODE_VERSION=v2.0.30-beta.f834dd8e bash

Channels

Channel Builds from Tag pattern Install env
stable (default) upstream release tags vX.Y.Z —
beta upstream beta branch vX.Y.Z-beta.<sha8> OPENCODE_CHANNEL=beta
dev upstream dev branch vX.Y.Z-dev.<sha8> OPENCODE_CHANNEL=dev

Rolling lines ship one build per upstream version — the first commit that carries a new version is built; later commits of the same version are skipped. All of it is automated: an hourly watcher detects upstream moves and mirrors them, at most about an hour behind. Browse: all releases · beta & dev · tags · live package index.

How it compares

Hope2333/opencode-termux and guysoft/opencode-termux also ship native-Bionic OpenCode and both have bigger communities than this repo. What is different here:

opencode-bionic Hope2333/opencode-termux guysoft/opencode-termux
libc native Bionic native Bionic native Bionic
release lines stable + beta + dev, built automatically from upstream v1 + v2 v1 + v2 side-by-side
dev freshness tracks upstream commits hourly — —
terminal sessions (PTY) works, bun-pty rebuilt for Bionic — —
what you install one self-contained .deb one of five package families package + wrapper + libs
exact pinning by version or upstream commit, curl or apt — —

Blank cells: not verified, read their README.

What is opencode?

An open-source, terminal-based AI coding agent — MIT-licensed and model-agnostic (Anthropic, OpenAI, OpenRouter, local models via any OpenAI-compatible endpoint). Developed at anomalyco/opencode with prebuilt binaries for macOS, Linux, and Windows — but none for Android. This repo provides the Android line.

Why a separate build is needed

opencode's TUI runs on opentui, a native Zig library. Upstream ships only glibc binaries; Android's Bionic linker rejects them. This project assembles the three pieces that make opencode run on Bionic:

  • a Bun runtime patched for Bionic (SELinux-safe JIT, syscall traps, shebang remap, FFI paths),
  • opentui rebuilt for android-arm64, published as @androidtui/* npm packages (16 KiB-page-aligned Bionic .so),
  • this repo — patch delta, version pins, release pipeline: one command installs a single self-contained binary.

Docs

Current pins

This channel's exact build inputs, regenerated automatically on every release. Other channels live on their own branch (beta / dev), all sourced from versions.json.

Component Version
opencode (upstream) 1.19.3
@opentui/{core,keymap,solid} (JS, via @androidtui) 0.5.17
@androidtui/core-android-arm64 (native .so) 0.5.17
bun-termux runtime 1.4.3-patched (bd-loser/bun-termux)
bun-pty (Bionic pty .so, embedded) 0.4.8 (release asset)

FAQ

Root? 32-bit? Minimum Android?

No root, no proot, no chroot. Only aarch64 (arm64-v8a) is built, covering essentially every Android device from the last ~7 years. Minimum: Android 10 — the patched Bun runtime needs API 29.

Why not just npm install -g opencode in Termux?

Broken: opencode pulls in @opentui/core, whose glibc .so Bionic refuses. This build substitutes the Bionic-native @androidtui/* packages and compiles everything into one self-contained binary.

Which LLM providers work?

All of upstream's: Anthropic, OpenAI, and any OpenAI-compatible endpoint (OpenRouter, Groq, Ollama, …). Configuration is identical to upstream — see opencode.ai/docs.

How fast do updates land?

Automatically, within about an hour: upstream stable, beta, and dev activity each trigger a matching build here (one release per upstream version). See Channels.

Related repos

Repo Role
bd-loser/bun-termux Bun runtime patched for Bionic
bd-loser/opentui opentui android-arm64 rebuild, publishes @androidtui/* (fork of anomalyco/opentui)

Upstream credit: anomalyco/opencode and anomalyco/opentui.

License

MIT — same as upstream opencode. See LICENSE.

About

Native opencode for Android / Termux (Bionic aarch64). Stable, beta and dev channels, built and published automatically.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

23 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages