π€ Droid AI Toolkit (Termux)
A high-performance, automated toolkit for running AI tools β OpenClaw, Gemini CLI, n8n, Ollama, Hermes, Nanobot, Pi, and Paperclip β natively on non-rooted Android devices. This toolkit bypasses kernel restrictions (renameat2), patches hardcoded system paths, and optimizes execution for mobile environments.
π± Compatibility
- OS: Android 9.0 and above.
- Architecture: Tested on
armv8l(32-bit),aarch64(64-bit), andx86_64CPUs. - Optimization: Automatically detects system RAM and recommends appropriate memory limits (512MB to 2048MB) for Node.js and n8n workloads.
- Package Managers: Supports both npm (Standard) and pnpm (High Efficiency) for Node.js-based tools.
- Process Management: Supports PM2 (Recommended) and termux-services (Native).
β οΈ Architecture Warning: Tools that depend on Rust-compiled Python extensions (Hermes, Nanobot) are not supported on
armv8l/armv7ldevices because upstreammaturinrejects the architecture and pre-built wheels require glibc (not Android's bionic libc).
π Before You Start
- Close other apps to free up RAM. The installer auto-detects available memory, but Android's Low Memory Killer may terminate Termux if other apps are running.
- Connect to Wi-Fi. Large downloads include Paperclip (~2GB), n8n, and Ollama models. Mobile data plans may be consumed quickly.
- Ensure free storage: Paperclip needs ~2GB free; other tools need ~200β500MB each.
- Install Termux from F-Droid (not Play Store). The Play Store version is obsolete and lacks required packages.
- Dependencies auto-installed:
jq,whiptail,curl,git,nodejs, andpostgresqlare installed automatically by the script if missing.
π Quick Start
1. Environment Setup
Install Termux from F-Droid. Do not use the Play Store version as it is obsolete.
2. Run the Toolkit
Execute the following command to start the interactive toolkit:
curl -sSL https://raw.githubusercontent.com/niyazmft/droid-ai-toolkit/main/install.sh | bash
π What happens next: The script launches a whiptail menu. Pick one tool at a time β downloads happen in the terminal. It is safe to re-run the script at any time. Keep Termux open and avoid switching apps during installation, as Android's Low Memory Killer may silently terminate the process. Individual tool installs typically take 2β15 minutes depending on your device and network.
π‘ Smart Repair (v1.5.0+): If a tool is already installed, the toolkit offers a [R] Repair mode. Use this to fix Android-specific patches in seconds without re-downloading the entire package.
3. Choose Your Tools
The toolkit uses a nested whiptail TUI menu:
| Menu | Tools Available |
|---|---|
| π€ AGENTS | OpenClaw, Hermes, Nanobot, Ollama, Pi Coding Agent |
| βοΈ WORKFLOWS | n8n, Paperclip |
| π UTILITIES | Gemini CLI |
| π§ SERVICES | PM2 Process Management, Native Background Services, GCP Bridge |
| π UNINSTALL | Modular uninstall for any installed tool |
4. Onboard OpenClaw (If Installed)
Initialize your account and API providers:
openclaw onboard
Select QuickStart and choose an external provider (OpenRouter, OpenAI, etc.).
5. Background Service (Optimized)
To keep tools running even after you close Termux:
- Run the toolkit and choose SERVICES β PM2 Process Management.
- Select the service you want to start (OpenClaw, n8n, Ollama, Paperclip, etc.).
- View logs with:
pm2 logs
β¨ Key Features
- π Smart Repair: Detects existing installations and provides a 2-second "Repair Only" path to re-apply patches without redundant downloads.
- π©Ή Zero-Config Patching: Automatically fixes the
koffinative bridge andrenameat2kernel crashes for OpenClaw. - π Path Awareness: Aggressively redirects
/bin/npm,/bin/node, and/tmpto Termux-compatible directories using$PREFIX. - π PM2 Integration: Native support for starting, stopping, and monitoring OpenClaw, n8n, Ollama, Paperclip, Pi, and Gemini CLI via PM2 with optimized memory flags.
- π¦ pnpm Support: Integrated support for pnpm to speed up installations and save storage space.
- π§ Memory Guard: Automatically clears memory (PM2 kill) and increases Node.js heap limits (1.5GB+) to prevent crashes on low-RAM devices during updates.
- π‘ Surgical Cleanup: The uninstaller offers Soft/Deep options and a Wipe Stack (Reset) function that preserves your system packages while cleaning the apps.
- π§© Gemini CLI Support: Dedicated installer with NDK environment optimizations and
fs.promises.renameβcopyFile+unlinkpatch to prevent AndroidENOENT. - π¦ Ollama Support: One-click install via Termux native package (
pkg install ollama). - β‘ Hermes Support: One-click install via official curl installer (aarch64/x86_64 only).
- π€ Nanobot Support: pip install with
--no-build-isolationfor pre-seeded dependencies (aarch64/x86_64 only). - π₯§ Pi Coding Agent (Recommended): npm/pnpm global install with Termux-specific
AGENTS.mdcontext. - π Paperclip (EXPERIMENTAL): Delegates to
paperclip_manual_install.shwhich handles clone, patches, pnpm install, prebuilt tarball download, PostgreSQL bootstrap, and PM2 ecosystem file generation.
π€ AI Agents
OpenClaw β AI Gateway
Multi-channel AI gateway with Telegram, Slack, and Discord support. Automatically patched for Android:
- Koffi patch:
renameat2βrenameto avoid kernel crashes. - Path redirection:
/tmp/openclaw,/usr/bin/npm,/bin/nodeβ Termux paths. - Plugin pruning: Disables 118 stock plugins on install to reduce memory footprint.
| Install method | npm/pnpm global |
| Architecture | β All architectures supported |
| Memory | Varies by plugin load; ~512MB minimum |
| Critical warning | Never run openclaw update β use toolkit's [R] Repair or [U] Update |
openclaw onboard # Configure API keys
openclaw doctor --fix # Repair schema issues
β οΈ NEVER run
openclaw updateβ it overwrites Android patches. Use the toolkit's [R] Repair or [U] Update instead.
Hermes β Nous Research Agent
AI agent by Nous Research, installed via the official curl installer.
| Install method | Upstream curl installer + manual pip fallback |
| Architecture | β Not supported on armv8l/armv7l (maturin/jiter incompatibility) |
| Memory | ~512MB RAM minimum |
| Build deps | python, clang, rust, make, pkg-config, libffi, openssl, binutils |
hermes # Start the agent
On
armv8l/armv7l, the toolkit will display a graceful error message and skip installation.
Nanobot β Python AI Agent
General-purpose Python AI agent with Anthropic Claude integration.
| Install method | pip3 install nanobot-ai |
| Architecture | β Not supported on armv8l/armv7l (maturin/jiter incompatibility) |
| Memory | ~512MB RAM minimum |
| Build deps | python, pip, setuptools, wheel |
nanobot --help # View available commands
nanobot # Start the interactive agent
On
armv8l/armv7l, the toolkit will display a graceful error message and skip installation.
Ollama β Local LLM Runner
Run large language models locally. Installed via Termux's native package manager.
| Install method | pkg install ollama (Termux native) |
| Architecture | β All architectures supported |
| Memory | ~1GB+ RAM recommended for 7B models |
ollama serve # Start the server
ollama pull llama3 # Download a model
ollama run llama3 # Run a model
Use SERVICES β PM2 to keep Ollama running in the background. Downloaded models are stored in ~/.ollama and preserved during uninstall.
Pi Coding Agent (Recommended)
The high-performance coding agent by Mario Zechner, optimized for the Termux environment.
| Install method | npm/pnpm global (@mariozechner/pi-coding-agent) |
| Architecture | β All architectures supported |
| Memory | ~512MB RAM minimum |
pi --help # View available commands
pi # Start the interactive agent
The toolkit automatically creates ~/.pi/agent/AGENTS.md with Termux-specific paths ($HOME, $PREFIX, termux-open-url) so the agent never hallucinates standard Linux paths.
β οΈ Warning: If you already have a command named
pion your system, the installer will remove it to avoid conflicts.
βοΈ Workflows & Automation
n8n β Workflow Automation Server
Professional-grade workflow automation with an optional GCP bridge for secure public access.
| Install method | npm/pnpm global (n8n@latest) |
| Architecture | β All architectures supported |
| Memory | Auto-capped to min(2048, max(512, RAM * 0.75)) |
| Extras | Watchdog cron, autossh GCP tunnel, tmux session manager |
n8n start # Start manually
~/n8n_server/scripts/n8n-monitor.sh # Watchdog restart
Access locally at http://localhost:5678.
β οΈ Warning: The installer forcibly kills running OpenClaw, n8n, and PM2 processes during setup to free memory. If you have active workflows or conversations, save your work before installing or updating n8n.
π License note: n8n is under the Sustainable Use License. See
ATTRIBUTIONS.mdfor redistribution terms.
Paperclip β AI Orchestration Server (EXPERIMENTAL)
Open-source orchestration server for managing teams of AI agents.
| Install method | Delegates to paperclip_manual_install.sh |
| Architecture | β All architectures supported (with caveats) |
| Memory | ~2GB free RAM recommended; LMK-resilient install |
| Database | External PostgreSQL (pkg install postgresql) |
| Build | Prebuilt dist/ tarball (primary) or local tsc build (fallback, ~65 min) |
The standalone installer handles:
- Cloning, patching (removes
embedded-postgres, dropsuiworkspace). - pnpm install with LMK-kill detection and retry.
- Symlink repair for
tsc,tsx,esbuild. - Download of prebuilt
dist/andui-disttarballs from GitHub releases. - PostgreSQL bootstrap with stale-process cleanup.
- Secret generation and PM2 ecosystem file creation.
cd ~/paperclip
export PAPERCLIP_HOME=~/paperclip
export DATABASE_URL=postgres://paperclip:paperclip@localhost:5432/paperclip
pnpm paperclipai onboard # One-time setup
pnpm paperclipai configure # Enable LAN access
pm2 start ecosystem.config.cjs # Start server
β οΈ Reinstalling Paperclip wipes
config.jsonand secrets. The installer deletes~/paperclipand reclones, which removesinstances/default/config.jsonandconfig/paperclip.env. Your database (workflows, users, history) survives in PostgreSQL, but you must re-runpnpm paperclipai onboardafter reinstall to regenerate config and secrets. Back up~/paperclip/instances/default/before reinstalling if you want to preserve settings. Requirements: ~2GB free RAM, 2GB+ storage, pnpm 9.15+, PostgreSQL running. UI is pre-built and downloaded as a tarball β never built on-device (Vite/esbuild requires ~4β6 GB transient RSS).
π Utilities
Gemini CLI β Google's Command-Line AI Assistant
| Install method | npm/pnpm global (@google/gemini-cli@latest) |
| Architecture | β All architectures supported |
| Memory | ~512MB RAM minimum |
| Build deps | python, make, clang, pkg-config (auto-installed if missing) |
| Patch | fs.promises.rename β copyFile+unlink to prevent Android ENOENT |
gemini --help # View available commands
gemini # Start interactive session
π‘ Smart Repair/Update: Re-running the toolkit for Gemini CLI offers [R] Repair (re-apply patches) or [U] Update (latest version).
π GCP Bridge Walkthrough (Optional)
To expose your n8n instance securely to the internet (https://yourdomain.com), follow this walkthrough:
Step 1: Prepare the GCP VM
- Create Instance: In GCP Console, create an
e2-microVM (Debian/Ubuntu). - Static IP: Reserve a static external IP for this VM.
- Firewall: Allow TCP 80 (HTTP), 443 (HTTPS), and 22 (SSH).
Step 2: Set up DNS
- Point your domain (e.g.,
n8n.example.com) to the GCP VM's static IP.
Step 3: Configure Nginx (on GCP VM)
- Install Nginx and Certbot:
sudo apt install nginx certbot python3-certbot-nginx - Create a site config that proxies to
localhost:5678. - Secure it with SSL:
sudo certbot --nginx -d yourdomain.com
Step 4: Establish the Tunnel
- Run the toolkit on your Android device and choose SERVICES β Configure GCP Bridge.
- Follow the prompts to enter your VM IP and Domain.
- Copy the generated SSH Public Key and paste it into the GCP VM's
~/.ssh/authorized_keysfile. - The monitor script will now automatically maintain a secure
autosshtunnel to the VM.
π Uninstallation & Reset
Run the toolkit and select UNINSTALL to access the modular uninstallation menu. Each option provides a detailed summary of the impact before you confirm:
- Remove OpenClaw: Choice of Soft Uninstall (keeps memories/skills) or Deep Uninstall (full wipe). Automatically cleans up PM2 and background services.
- Remove Gemini CLI: Full removal of application binaries and configurations.
- Remove n8n: Surgically kills the GCP tunnel (port 5678) and removes the watchdog cron.
- Remove Ollama: Removes the package. Downloaded models in
~/.ollamaare preserved. - Remove Hermes: Runs the official uninstaller if available, otherwise removes directories manually.
- Remove Nanobot: pip uninstall + directory cleanup.
- Remove Pi: Full removal of global package and configuration.
- Remove Paperclip: Stops the PM2 service and preserves the source code and PostgreSQL database.
- Wipe Software Stack (Reset): Batch "Deep Uninstall" of all applications. Safe Reset: Cleans all toolkit-specific data but preserves system packages (Node.js, Git, Python, etc.) so your other Termux apps don't break.
π Management Commands
| Action | Command |
|---|---|
| Check Health | sv status openclaw |
| View Live Logs | tail -f ~/.openclaw/logs/current |
| Stop Service | sv down openclaw |
| Restart Gateway | sv restart openclaw |
| Force Kill (Stray) | pkill -9 -f openclaw |
| Fix Environment | openclaw doctor |
| Find Access Token | grep "token" ~/.openclaw/openclaw.json |
| Ollama: Start Server | ollama serve |
| Ollama: Pull Model | ollama pull llama3 |
| Ollama: Run Model | ollama run llama3 |
| Hermes: Start | hermes |
| Nanobot: Start | nanobot |
| Pi: Start | pi |
| Paperclip: Start | pm2 start ~/paperclip/ecosystem.config.cjs |
| n8n: Start | n8n start |
| Gemini CLI: Start | gemini |
| PM2: View Logs | pm2 logs |
| PM2: View Status | pm2 status |
| PM2: Restart All | pm2 restart all |
| PM2: Stop All | pm2 stop all |
| Native Service: Start n8n | sv up n8n |
| Native Service: Stop n8n | sv down n8n |
π Maintenance
π‘ Safe Updates & Smart Repair
β οΈ WARNING: Never use the built-in openclaw update command. It will overwrite the Android patches and break the application.
To update or repair safely, re-run install.sh, choose the tool's Install/Repair option, then pick the appropriate mode:
| Mode | What it does | Time | Use when... |
|---|---|---|---|
| [R] Repair | Re-applies Android patches, fixes symlinks, restores configs | ~2 seconds | The app broke after a Termux update or system change |
| [U] Update | Downloads the latest upstream version + re-applies patches | 1β10 minutes | You want new features or bug fixes |
π‘ Latest Version: This toolkit always installs the latest available version of each tool to ensure maximum feature compatibility and security.
π Battery Optimization
To prevent Android from killing the background process, run:
termux-wake-lock
π Troubleshooting
If an install fails or hangs
- Re-run the script:
curl -sSL https://raw.githubusercontent.com/niyazmft/droid-ai-toolkit/main/install.sh | bashβ it is safe to run again. - Select the same tool from the menu and choose [R] Repair.
- Check the log at
~/droid_ai_toolkit.logfor the exact failure reason. - Free up resources: Close other apps, ensure Wi-Fi is stable, and verify you have enough free storage.
Common Issues
- Telegram Plugin Not Available: This toolkit attempts to pre-fix this. If it persists, finish onboarding and run:
openclaw channels add --channel telegram. - Homebrew Recommendations: Ignore them. Homebrew is not supported on Android. Use
pkg install <package>for any missing dependencies. - Node.js Errors: Run the toolkit's Install/Repair option to reset environment locks and paths.
- Ollama Not Found After Install: Restart Termux or run
source ~/.bashrcto refresh your PATH. - Hermes/Nanobot Fail on armv8l: Expected β these tools require Rust compilation via maturin, which does not support the
armv8larchitecture. Use anaarch64orx86_64device instead. - Paperclip LMK Kill During Install: Expected on 3β4GB RAM devices. The installer detects the kill, verifies packages are present, and continues. If it fails entirely, ensure you have at least 2GB free RAM before starting.
π Code Quality
This project implements a "Zero-Waste" and "Self-Healing" quality gate to maintain high standards for all contributions.
Tools Used
- ESLint v10: Modern JavaScript and JSON linting via Flat Config.
- Stylelint: Standardized CSS quality checks.
- Markdownlint: Documentation consistency enforcement.
- Husky & lint-staged: Automated pre-commit hooks to auto-fix code.
- Self-Healing: Custom Python scripts to safely refactor unused code.
Usage
Run the full quality audit locally:
pnpm run lint:all
π License
Distributed under the MIT License. See LICENSE for more information.