ANDROIDTUI is the Android compatibility distribution of OpenTUI. It enables native terminal user interfaces on Android through Termux, with an ARM64 native library built against Android's Bionic libc.
This repository is intentionally a small compatibility layer. It does not duplicate OpenTUI's source tree. A pinned upstream release is cloned into .work/opentui, the focused Android patches are applied, and additive Android files are copied from overlay/.
Use ANDROIDTUI to build fast terminal applications for Android with OpenTUI's imperative API, React reconciler, SolidJS reconciler, Yoga layout, terminal input handling, and Tree-sitter syntax highlighting.
Install the core package with Bun:
bun add @androidtui/coreFor React applications:
bun add @androidtui/core @androidtui/react reactFor SolidJS applications:
bun add @androidtui/core @androidtui/solid solid-jsThe Android ARM64 native package, @androidtui/core-android-arm64, is installed automatically as an optional dependency of @androidtui/core.
import { createCliRenderer, TextRenderable } from "@androidtui/core"
const renderer = await createCliRenderer()
const text = new TextRenderable(renderer, {
id: "hello",
content: "Hello from Android and Termux",
})
renderer.root.add(text)ANDROIDTUI supports Bun on Termux. The Node.js path requires a Node release that provides node:ffi and must be started with --experimental-ffi. See OpenTUI on Termux for runtime details and troubleshooting.
| Package | Purpose |
|---|---|
@androidtui/core |
OpenTUI core with Android native package resolution |
@androidtui/core-android-arm64 |
Native ARM64 Android library for Termux |
@androidtui/react |
React renderer for Android terminal applications |
@androidtui/solid |
SolidJS renderer for Android terminal applications |
@androidtui/keymap |
Commands, keybindings, and key sequence handling |
Source packages retain their upstream @opentui/* workspace names. Release tooling publishes Android-compatible distributions under the @androidtui/* npm scope.
| Environment | Status |
|---|---|
| Android ARM64 with Termux | Supported |
| Bun on Termux | Supported |
Node.js with node:ffi |
Supported with --experimental-ffi |
| Android ARMv7 | Not currently published |
| Android x86_64 | Not currently published |
The native library is built inside a real ARM64 Termux userspace using termux/termux-docker:aarch64. The workflow runs on an ARM64 GitHub runner, applies the pinned patches inside Termux, and uploads libopentui.so, its checksum, and build metadata. This is a native Bionic build, not a glibc cross-compile.
- OpenTUI on Android and Termux: architecture, runtime selection, package layout, and troubleshooting
- Native Android build: build
libopentui.sodirectly in Termux - Patch kit maintenance: port Android support to a new upstream OpenTUI release
- Upstream OpenTUI documentation: APIs, components, and core concepts
| Path | Purpose |
|---|---|
androidtui.json |
Pins the exact upstream OpenTUI tag and commit |
patches/ |
Ordered patches that modify existing upstream files |
overlay/ |
Android-specific files that do not exist upstream |
scripts/prepare.mjs |
Creates a disposable patched OpenTUI checkout |
scripts/verify.mjs |
Verifies the pin, patches, overlay, and package versions |
ci/ |
Runs the native build inside the Termux container |
.work/opentui/ |
Generated upstream source tree; never committed |
Create a clean Android-enabled OpenTUI source tree:
npm run prepare:upstream
npm run verifyBuild the native library locally from the generated checkout on Termux:
cd .work/opentui
bash packages/core/scripts/build-native-termux.shThe same build runs in GitHub Actions on every push to main and uploads the Android ARM64 native library as a workflow artifact. The Android job installs bd-loser/bun-termux; upstream Oven Bun is not used for the Termux build.
Versions follow upstream exactly. Update androidtui.json only when adopting a new upstream release, refresh patches against that pinned commit, and then create the matching release tag:
git tag androidtui-v0.5.1
git push origin androidtui-v0.5.1The androidtui-v* tag triggers the unified release workflow for all @androidtui packages.
ANDROIDTUI is maintained as an Android-focused patch set on top of anomalyco/opentui. OpenTUI's architecture, APIs, and most source code are developed by the upstream OpenTUI contributors.
Released under the MIT License.