One-tap installer for AI coding CLIs on rooted Android Termux.
| Channel | Status |
|---|---|
| GitHub Releases (direct sideload) | β live |
Obtainium β add https://github.com/Crypt0Shmipt0/root-aicli as a source |
β live |
| IzzyOnDroid third-party F-Droid repo | π‘ submission pending |
| F-Droid main | π‘ submission pending (!41552) |
Root.AICLI is a small Android app that installs and repairs the major AI coding command-line clients inside Termux on rooted devices, with no manual shell wrangling. It auto-detects your environment, picks the right install path for each CLI, and applies the SELinux MLS gymnastics needed to keep Termux from breaking on the next reboot.
Supported CLIs:
| CLI | Vendor | Install path | Auth |
|---|---|---|---|
| Claude Code | Anthropic | Alpine (current) or bare Termux pinned to 2.1.112 | OAuth or ANTHROPIC_API_KEY |
| Antigravity (agy) | Wallentx Termux fork (Bionic bridge + TCMalloc fix) | Google OAuth | |
| Codex CLI | OpenAI | Native musl arm64 binary on bare Termux | OAuth or OPENAI_API_KEY |
| Grok Build CLI | xAI | Native arm64 on bare Termux, Alpine fallback | OAuth or XAI_API_KEY |
Every AI vendor ships a curl-pipe-to-bash installer that assumes a "normal" Linux. Termux on Android is not normal:
- The libc is Bionic, not glibc, so glibc-only binaries refuse to exec.
- Files written under
sucome back without the Termux app's SELinux MLS categories, and the next Termux session getsexec: Operation not permitted. - Magisk's
suruns in an isolated mount namespace by default, so installer scripts can't see Termux's filesystem unless invoked withsu -mm. - Each CLI vendor solves "Android arm64" differently: some ship musl, some ship glibc, some hand it to community forks.
Root.AICLI handles all of this. You tap a button, it figures out which path applies to your device, and runs the right install.
- Rooted Android 8+ (Magisk, KernelSU, or APatch).
- Termux installed from F-Droid (
com.termuxpackage, F-Droid build). The Play Store build is signature-incompatible with Termux companion apps. - Optional but recommended: Termux:Boot, Termux:Widget, Termux:API from the same source.
- Optional:
proot-distro install alpinefor the latest Claude Code (versions 2.1.113+ require glibc/musl).
- Install Termux from F-Droid: https://f-droid.org/packages/com.termux/
- Download
RootAICLI.apkfrom the releases page and install it. - Open Root.AICLI. On first tap, your root manager prompts for su access. Grant and remember.
- Tap Status to see what's installed.
- Tap any CLI button to install it. Wait for
[exit 0]. - Tap Permanent Fix once to install the boot-time persistence hook. This re-applies Termux SELinux contexts on every boot so auto-updates don't break Termux exec.
- Open Termux and run the CLI (e.g.
claude,codex,agy,grok). Authenticate per the prompts shown in the app.
The APK is a thin Java shell. Every button taps fires su -mm -c <bash + module>
which runs one of the install scripts under modules/ with the global mount
namespace (so the APK's su can see Termux's private storage at
/data/data/com.termux/files/). Termux's own bash is invoked with
LD_LIBRARY_PATH=$PREFIX/lib so it can load its libc.
Files:
root-aicli/
βββ android-app/ The APK (Java + native View, no Gradle, no Compose)
βββ modules/ One install script per CLI plus detect + persistence
βββ lib/common.sh Shared helpers: UID detection, MLS computation, etc.
βββ root-aicli The Termux CLI front-end (also callable from the APK)
βββ docs/ Architecture + troubleshooting
βββ fastlane/ F-Droid metadata
βββ .github/workflows/ Reproducible APK CI
Each CLI has its own first-run auth. Root.AICLI never touches credentials.
| CLI | Headless option | Interactive |
|---|---|---|
| Claude Code | export ANTHROPIC_API_KEY=... or claude setup-token |
claude (browser OAuth) |
| Antigravity (agy) | (none; Google OAuth only) | agy login |
| Codex | export OPENAI_API_KEY=... |
codex (browser OAuth) |
| Grok Build | export XAI_API_KEY=... |
grok (browser OAuth) |
If you're on a handheld with no easy browser, use the headless env-var path.
You need a Mac or Linux with bash, python3+Pillow, and the Android SDK
command-line tools. From the project root:
brew install openjdk@17
mkdir -p ~/Library/Android/sdk/cmdline-tools
cd ~/Library/Android/sdk/cmdline-tools
curl -sSL -o cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-mac-11076708_latest.zip
unzip -q cmdline-tools.zip && mv cmdline-tools latest && rm cmdline-tools.zip
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$PATH
yes | sdkmanager --licenses
sdkmanager "platforms;android-34" "build-tools;34.0.0" "platform-tools"Then:
cd android-app
./build.sh # produces build/RootAICLI.apk
./install-apk.sh # ADB install on the first connected deviceCI does the same thing reproducibly. See .github/workflows/build.yml.
| Doc | Read this when |
|---|---|
| Quickstart | You just want it working in 5 minutes |
| Installation | You need detailed install steps for any path (APK, F-Droid, source) |
| CLI Reference | You need per-CLI auth + first-run guidance |
| FAQ | You have a question; check here before opening an issue |
| Troubleshooting | Something is not working |
| Known Issues | Confirmed quirks we have not fixed yet |
| Compatibility | Which Android versions / root managers / devices are tested |
| Architecture | You want to understand how it works under the hood |
| Contributing | You want to add a CLI or fix a bug |
| Changelog | What changed between versions |
| Security | Threat model and vulnerability disclosure |
| Code of Conduct | Community standards |
MIT. See LICENSE.
Root.AICLI does not redistribute the AI CLI binaries themselves. It only orchestrates the official upstream installers. Each CLI is governed by its own vendor's terms.
- The mount-master + MLS-context debugging story that made this app possible was originally worked out for the Ayn Odin 3 in a project called Tomer Tweaks. Root.AICLI is the open-source generalization.
- The wallentx fork of Antigravity is what makes agy work on Termux at all. Without their TCMalloc 39-bit-VA patch, agy refuses to start under proot. https://github.com/wallentx/antigravity-cli-termux
See CONTRIBUTING.md. PRs welcome for new CLIs (Aider, Continue, llm, etc.), bug fixes, and translations.