opencode-termux
v1.18.14-0
Published
OpenCode AI assistant compiled for Android Termux (aarch64) with auto-update support
Downloads
8,642
Maintainers
Readme
opencode-termux packages OpenCode's official ARM64 musl build with the runtime required by Termux.
Install
On Termux aarch64:
npm install -g opencode-termux
opencodeThe first run prepares everything needed by the runtime automatically. It installs missing Termux packages, downloads the matching release, verifies it, and starts OpenCode.
First-run experience
Installation is intentionally quiet. Instead of command logs, it only shows short status messages such as:
◇ Setting up Termux dependencies…
✓ Termux dependencies are ready
◇ Preparing OpenCode for Termux…
✓ OpenCode 1.18.4-8 is readyDetailed command output is kept hidden unless an error occurs.
Screenshots
Automatic dependency setup
Before installing or starting OpenCode, the wrapper checks for the runtime prerequisites. When needed, it installs them through Termux's pkg command:
curlfor release downloadstarfor archive extractionpatchelffor the Termux-compatible ELF interpretercoreutilsfor the update timeout commandca-certificatesfor HTTPS certificatesresolv-conffor the DNS configuration used by the packaged musl runtime
Node.js and npm are the only prerequisites because npm is used to install this package:
pkg install nodejsHow it works
| Feature | Behavior |
| --- | --- |
| Verified downloads | The installer checks the release SHA-256 against release-checksums.json bundled in npm. |
| Complete runtime | The OpenCode binary, musl loader, libgcc, and libstdc++ are stored in ~/.opencode/. The packaged musl resolver uses Termux's DNS configuration, so API connections work natively on Android. |
| Safe updates | A newer npm package is installed first. The working runtime is kept if npm or the network fails. |
| Version matching | ~/.opencode/.opencode-termux-version ensures the runtime always matches the installed npm package. |
| OpenCode updates | OpenCode's internal updater is disabled so it cannot replace the Termux-compatible binary. |
opencode
│
├─ Check and install missing Termux dependencies
├─ Check the installed runtime and its version marker
│ └─ If needed: download → verify SHA-256 → test → activate
├─ Check npm for a newer package (up to 10 seconds)
│ └─ If newer: install package → restart wrapper → install matching runtime
└─ Run ~/.opencode/opencodeAutomated releases
The Build and publish Termux package workflow runs every six hours and can also be started manually.
- It detects the latest official OpenCode release through GitHub's API.
- It downloads
opencode-linux-arm64-musl.tar.gzand verifies GitHub's SHA-256 digest. - It packages the binary with ARM64 musl,
libgcc, andlibstdc++runtime libraries. The musl runtime is built from pinned source with Termux's resolver path so it can use Android DNS without Proot. - It creates the release archive and records its SHA-256 in
release-checksums.json. - It publishes the npm package, creates the GitHub Release, and commits the generated checksum metadata.
Publish jobs are serialized. If npm already has a version but its GitHub Release is missing, the workflow stops instead of generating an archive with a mismatched checksum.
Update or repair
Running opencode normally checks for updates automatically.
# Check the latest published version
npm view opencode-termux version
# Update immediately
npm install -g opencode-termux@latest
opencode
# Reinstall the managed runtime without deleting the current files first
rm -f ~/.opencode/.opencode-termux-version
opencodeUninstall
npm uninstall -g opencode-termux
rm -rf ~/.opencodeThe second command removes only the runtime managed by this package. OpenCode configuration, if any, is normally kept in ~/.config/opencode.
Project layout
bin/opencode Update and launch wrapper
install.js Quiet verified installer and dependency setup
release-checksums.json SHA-256 for the release matching the npm package
scripts/build-android-release.sh Reproducible ARM64/Termux package builder
.github/workflows/auto-update.yml Automated detection and publishing workflow