Skip to content
Projects

niyazmft/droid-ai-toolkit

View on GitHub

About

High-performance toolkit for running AI tools (OpenClaw, Pi Agent, n8n, Ollama, Hermes) natively on Android via Termux.

AI

How these counts are measured

Measured star growth

in 24h
0
in 7 days
Collecting history
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

🤖 Droid AI Toolkit (Termux)

Droid AI Toolkit Cover

License: MIT Version Platform

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.


📑 Table of Contents


📱 Compatibility

  • OS: Android 9.0 and above.
  • Architecture: Tested on armv8l (32-bit) and aarch64 (64-bit) mobile CPUs.
  • 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/armv7l devices because upstream maturin rejects the architecture and pre-built wheels require glibc (not Android's bionic libc). Ollama is 64-bit only as well — Termux publishes no armv8l package for it. The app reflects all of this: those rows say why instead of offering an install that would fail.


📱 Android App (APK)

Manage the toolkit from a normal app instead of the terminal menu. The app is a client: it drives the same install.sh your terminal runs, over a headless --api mode, and Termux remains the thing that actually installs and supervises anything. Nothing here roots your phone.

🚧 Beta, sideloaded only. The APK is built and signed with the debug key, so Android will ask you to allow installs from your browser/file manager, and a later build signed with a different key cannot be installed over it (uninstall first). It is also only useful together with Termux — the app will not, and cannot, replace it.

What it gives you

Install, update, repair, remove Every tool in the catalogue, from a card instead of a menu — the same action files the TUI reads
What is running Home lists each service with its memory and restart count, and one tap restarts everything
Live progress The step the engine is on ("Step 3 of 7 · Install OpenClaw"), not a spinner
Survives a reboot Set up the boot script and pm2 save, then test the restore from the app
Evidence, not just a verdict A failed step shows its own last lines, and the full stream is one tap away
Device facts Model, Android/API, architecture, RAM and swap with a memory chart over the last 24 h

Requirements

Requirement Why it is needed
Android 9.0+ (API 28) Minimum the app is built for
Termux from F-Droid The Play Store build is obsolete; the app cannot work with it
allow-external-apps=true in ~/.termux/termux.properties Without it, Android refuses to let the app send commands to Termux. This is the one setting the app cannot change for you:
The toolkit itself The app's Setup downloads and updates it into ~/droid-ai-toolkit; you do not need to run the curl one-liner first

Copy-paste for that one line, then restart Termux:

echo "allow-external-apps=true" >> ~/.termux/termux.properties
termux-reload-settings

Optional, and only if you want the feature it enables:

  • Files/media permission — live step progress (the engine writes it to shared storage).
  • Notification permission (Android 13+) — the background watcher's one notification, which is how the app tells you a tool stopped.
  • Termux:Boot — restores your services after a reboot.

Install

  1. Download droid-ai-0.1.0.apk from Releases.
  2. Open it and allow your browser or file manager to install unknown apps when Android asks.
  3. Launch Droid AI and tap Set up — it provisions the toolkit into Termux and reports what it is missing if something is.
  4. If the app says it cannot reach Termux, set allow-external-apps (above) and tap Check again.

⚠️ Do not use the app's Update button to cross an OpenClaw version your device cannot run. Some builds are pinned per device because newer ones cannot migrate their own state on Android (for example a device happily running 2026.9.8 should stay there). If a tool currently works, an update is a choice, not a fix.


📋 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.
  • Dependencies auto-installed: jq, whiptail and gum are installed by the script if missing. curl, git and nodejs are expected to be present already (they are in a normal Termux install); PostgreSQL is installed only when you pick Paperclip.

🚀 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 an interactive TUI menu (gum if available, otherwise whiptail). 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.

💡 Already installed? The toolkit offers [R] Repair (re-applies the Android patches, in seconds) and [U] Update (latest upstream, patches re-applied). Neither overwrites the patches the way openclaw update does — the difference is in Maintenance → Safe Updates below.

3. Choose Your Tools

The toolkit uses a nested TUI menu. If gum (charm.sh) is installed, you get a premium, color-rich interface with visual separators; otherwise it gracefully falls back to whiptail:

Menu Tools Available
🤖 AGENTS OpenClaw, Hermes, Nanobot
⚙️ WORKFLOWS n8n, Paperclip
🛠 UTILITIES Gemini CLI, Pi Coding Agent, Ollama, GCP Bridge
🔧 SERVICES PM2 Process Management, Native Background Services (sv)
🗑 UNINSTALL Modular uninstall for any installed tool, or WIPE ALL

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:

  1. Run the toolkit and choose SERVICES → PM2 Process Management.
  2. Select the service you want to start (OpenClaw, n8n, Ollama, Paperclip, etc.).
  3. View logs with: pm2 logs

Surviving a reboot: see Keeping services alive after a reboot below — it needs the Termux:Boot app as well as the script the toolkit writes.

Keeping services alive after a reboot

PM2 on Termux has no systemd to hook into, so the command you would normally use — pm2 startup — cannot work on Android. The toolkit does something simpler instead: opening SERVICES → PM2 writes a small script to ~/.termux/boot/start-pm2.sh, and Android runs it when the device boots.

What it does
  • Runs pm2 resurrect at boot, which restarts every service you previously saved with pm2 save.
  • Restarts sshd first, if you have it installed, so you can still reach the device after a reboot.
  • Restores each app's saved settings too, including its memory limit and environment variables.
What it does not do
  • It does not start Termux by itself — the separate Termux:Boot app does that.
  • It does not start OpenClaw (or anything else) by name. It restores exactly what pm2 save recorded, so a service that was not running when you saved will not come back.
What you need for it to work
Requirement Why it matters
Termux:Boot app from F-Droid, opened at least once Without it, nothing in ~/.termux/boot/ is ever executed
Termux and Termux:Boot exempt from battery optimization Android will otherwise block the boot script
Huawei/EMUI only: both allowed in Battery → App launch EMUI adds a second, stricter startup gate
pm2 save run while your services were up This saved list is what gets restored

Check that it worked: run pm2 save, then reboot, then pm2 list. For the OpenClaw gateway specifically, netstat -tln | grep 18789 should show it listening. [B] Autostart on Boot in the PM2 menu reprints the script and these notes whenever you need them.

A boot script only helps after a real reboot. If Android kills the Termux app while the phone is still on — common on low-RAM devices — nothing in ~/.termux/boot/ runs at all, and SSH dies with it. That is why Termux and Termux:Boot must be exempt from battery optimization. If a service is down, run uptime before assuming a reboot happened: a phone that has been up for days was killed in place, and reboot advice will not explain it.

Customising: start-pm2.sh is managed by the toolkit and is rewritten when its template changes, so do not put your own commands there. Termux:Boot runs every executable script in ~/.termux/boot/, so add a start-user.sh beside it instead — that file is never touched, and it runs after start-pm2.sh.


🤖 AI Agents

OpenClaw — AI Gateway

Multi-channel AI gateway with Telegram, Slack, and Discord support. Everything Android-specific — the kernel patch, the path redirection, the 2026.9.x state migrations, the plugin pruning — is applied for you; the patch suite lists each one.

Install method npm/pnpm global
Architecture ✅ All architectures supported
Memory Varies by plugin load; ~512MB minimum
Critical warning Never run openclaw update — it overwrites the patches. Use [R] Repair / [U] Update
openclaw onboard          # Configure API keys (run AFTER install)
openclaw gateway status   # Check gateway health

⚠️ Never run openclaw doctor --fix — Android has no service manager for it to take ownership through, so it fails (or hangs) even with the gateway stopped. The migrations it would perform are done by [R] Repair; see why the doctor flow is not needed.

💡 Version Selection: The toolkit now supports installing a specific OpenClaw version (e.g. 2026.6.30) instead of always pulling @latest. Use [V] Install Specific Version from the OpenClaw menu.

💡 Zulip Plugin: A dedicated sub-menu [Z] Zulip Plugin is available under AGENTS → OpenClaw for installing, updating, or uninstalling the Zulip integration (clawhub:@niyazmft/openclaw-zulip). You can also pin to a specific plugin version (e.g. 2026.7.0).


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 — why
Memory ~512MB RAM minimum
Build deps python, clang, rust, make, pkg-config, libffi, openssl, binutils
hermes                # Start the agent

What the toolkit handles for you — the mechanism lives in AGENTS.md; this is what you get:

  • Wheel cache — compiled wheels (cryptography, Pillow, pydantic-core, jiter, …) are kept in ~/.hermes/wheel-cache, so a reinstall on the same device skips compilation: ~90 minutes becomes under two.
  • Updates are proven, not announced — [U] Update and [F] Fix end with hermes --version. A checkout left with merge-conflict markers by an older toolkit is repaired instead of being declared healthy.
  • It survives pkg upgrade — the venv's interpreter is pinned to the versioned binary that a Termux upgrade never rewrites; an already-drifted venv is repaired in place (one symlink, not a reinstall).
  • os.link exists, and the venv stays pip-managed — a venv sitecustomize.py restores os.link on Python builds that ship without it, and stops Hermes' own package sync from replacing the venv this toolkit maintains.
  • Memory providers stay installed — honcho, which upstream moved out of core and whose own installer cannot resolve on Android, is cloned in directly.
  • No stray Python on PATH — a half-built PM store that would put a bundled Python 3.14 ahead of yours is removed.

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 — why
Memory ~512MB RAM minimum
Build deps python, pip, setuptools, wheel
nanobot --help        # View available commands
nanobot               # Start the interactive agent

🩹 OpenClaw 2026.9.x on Android

OpenClaw 2026.9.x introduced several changes that break Android/Termux installs (module hooks, /tmp hardcoding, hardlink-based state migrations, a new Telegram pairing policy). The toolkit handles all of them automatically — this section documents what is patched, what happens during upgrades, and the few steps that need your input.

Android Patch Suite

All patches are applied by apply_patches() on every [I] Install, [R] Repair, and [U] Update — idempotent, with automatic .bak backups:

Patch Fixes
Koffi renameat2 → rename Kernel crash on Android when the native bridge calls renameat2
/tmp → $TMPDIR Android has no /tmp; OpenClaw 2026.9.1 hardcoded it for runtime state
module.registerHooks disabled Node 24 module-hooks API deadlocks on Android (gateway hangs at startup)
SQLite archive hardlink → copy fallback Android blocks fs.link() (EACCES); 2026.9.x session migration archives transcripts via hardlinks with nlink === 2 assertions
Process identity accepts android platform 2026.9.x guards /proc/<pid>/stat parsing with platform === "linux" — on Termux it is "android", breaking the cron durable fence (cron: timer tick failed every 2s) and file-lock staleness detection. Covers the 9.2 and 9.3 chunk layouts (.js and .mjs)
Telegram dmPolicy pinned to allowlist 2026.9.x defaults to pairing, which silently revokes slash-command authorization
Path redirection /bin/npm, /bin/node, /tmp/openclaw → Termux $PREFIX-based paths
Plugin pruning Switches off plugins that have no explicit state of their own, keeping telegram, ollama and memory-core on; a plugin you enabled yourself keeps that choice. Re-enable others with openclaw plugins enable <id> (see checklist)
Workspace bootstrap hardlink → copy Onboarding dies with EACCES: permission denied, link ...AGENTS.md on Android; the bootstrap publication falls back to copy+unlink

Automatic Legacy-State Migration

OpenClaw 2026.9.x blocks gateway startup until legacy state is migrated. Upstream normally runs openclaw doctor --fix for this — which cannot run on Android (it requires a systemd/launchd service owner). The toolkit runs the migrations directly during [R] Repair / [U] Update whenever legacy files are detected:

Stage Migrates Target
1 Legacy workspace setup state (openclaw-workspace-state.json) workspace_setup_state table in ~/.openclaw/state/openclaw.sqlite
2 Legacy session store (sessions.json, transcripts) Agent SQLite via openclaw doctor --session-sqlite import
3 Legacy exec-approvals config (exec-approvals.json) exec_approvals_config table in the state DB
  • The gateway is paused via PM2 during migration and restarted after.
  • Nothing is deleted — legacy files and any .doctor-importing claims are archived under ~/.openclaw/backup-legacy-state-*.
  • First boot after the migration takes longer than usual (session SQLite import + cron catch-up); this is normal.

Why the Doctor Repair Flow Is Not Needed on Android

openclaw doctor --fix fails on Android by design: its first step takes maintenance ownership of the gateway — stopping and restarting it through a system service manager (systemd/launchd). Android has neither; the gateway runs under PM2 as an externally managed process, so ownership can never be verified, even when the gateway is already stopped. The result is Doctor could not enter maintenance ... Gateway service ownership or shutdown could not be verified, and a hang if the gateway is still running.

That does not leave a gap: every state-changing repair the doctor performs is either automatic here (the three migrations above, plus schema migrations at gateway startup and config normalisation at load) or has a dedicated subcommand that runs before the maintenance step — openclaw doctor --session-sqlite dry-run|import|compact and openclaw doctor --state-sqlite both work on Android. Prefer the subcommand over the full --fix.

Power-user exception — running the full doctor flow on Android: with the gateway stopped and the external-supervisor env vars set, doctor --fix completes successfully (verified on 2026.9.1 — it even performed a real HEARTBEAT.md → cron-scratch migration):

pm2 stop openclaw
yes "" | OPENCLAW_SERVICE_REPAIR_POLICY=external OPENCLAW_SUPERVISOR_MODE=external openclaw doctor --fix
pm2 start openclaw

Doctor will not stop or restart the gateway on Android — you own those steps. Minor known degradation: the TOOLS.md migration backup uses hardlinks (EACCES on Android) and is skipped with a warning; the repair completes regardless.

Post-Install Checklist (User Work)

After openclaw onboard, complete these steps — the toolkit cannot know your identity:

  1. Configure the model provider and bot token — openclaw onboard (QuickStart + an external provider), as in Quick Start step 4.

  2. Authorize your Telegram account for commands: slash commands (/status, /help, /commands, /goal) require your numeric Telegram sender ID in commands.ownerAllowFrom (get it from @userinfobot), and dmPolicy must be allowlist. One snippet covers both:

    cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak
    jq '.channels.telegram.dmPolicy = "allowlist" |
        .commands.ownerAllowFrom = (["YOUR_TELEGRAM_NUMERIC_ID"])' \
        ~/.openclaw/openclaw.json > ~/.openclaw/openclaw.json.tmp && \
        mv ~/.openclaw/openclaw.json.tmp ~/.openclaw/openclaw.json
    pm2 restart openclaw    # or SERVICES -> PM2
    

    Channel-prefixed entries for other channels (e.g. zulip:user@host) do not authorize Telegram commands.

  3. Re-enable the plugins you use: the installer prunes all stock plugins on [I] Install / [U] Update to reduce memory footprint (see the patch suite) and keeps only telegram, ollama, and memory-core enabled. Any plugin you enabled manually (e.g. openclaw-honcho, brave, zulip) is disabled again by the next full install/update. Re-enable from the CLI:

    openclaw plugins list                 # see what is available and disabled
    openclaw plugins enable <plugin-id>   # e.g. openclaw plugins enable openclaw-honcho
    openclaw plugins doctor               # verify no load issues
    pm2 restart openclaw                  # or SERVICES -> PM2
    

    Pruning is intentional — every enabled plugin costs RAM on low-memory devices, so re-enable only what you actually use.

  4. Test from the real channel: send /status in Telegram. Do not test via openclaw gateway call chat.send — it authenticates as the webchat sender (a sha256:... identity) and always shows the empty-reply fallback.

Hard Warnings

  • ❌ Never run openclaw update — it overwrites the Android patches. Use the toolkit's [R] Repair / [U] Update.
  • ❌ Never run openclaw doctor --fix while the gateway is running — it fails at gateway service-ownership verification and may hang. If the in-chat agent offers to run it, decline; the migrations it proposes were already applied by the toolkit. Power users can run the full flow safely with the gateway stopped + env vars — see the doctor recipe.
  • ❌ Do not hand-edit the migration gates — skipping migrations leaves half-migrated state (old sessions invisible, gateway retry loops). Run the toolkit repair instead.

Diagnostic pointers: gateway file log at $TMPDIR/openclaw-*/openclaw-<date>.log, PM2 console at ~/.pm2/logs/openclaw-out.log / openclaw-error.log, startup-failure bundles at ~/.openclaw/logs/stability/.


⚙ 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 nginx TLS proxy (8443), watchdog cron, autossh GCP tunnel, tmux session manager
n8n start             # n8n itself listens on 127.0.0.1:5678 only
~/n8n_server/scripts/n8n-monitor.sh   # Watchdog restart

Open https://<phone-ip>:8443 from any device on the same Wi-Fi. That is the only door into n8n, which itself listens on 127.0.0.1:5678 (PM2: n8n + n8n-proxy).

What happens automatically

  1. Finds the phone's Wi-Fi address.
  2. Creates a local CA and a certificate for that address.
  3. Starts n8n privately on 127.0.0.1:5678 and nginx on 0.0.0.0:8443.
  4. If no owner account exists, prints a one-time setup password and protects the setup page with it.
  5. Removes that password once the owner account exists — so nobody else on the Wi-Fi can claim it.

What you do

  1. Open https://<phone-ip>:8443 and accept the self-signed certificate once. That warning is expected for a private LAN IP; install ~/n8n_server/certs/ca.crt on the client to silence it. The connection is encrypted either way.
  2. Enter the setup password (first run only), create the owner account, and log in with it after.
From How Notes
Same Wi-Fi https://<phone-ip>:8443 Default. Works from the phone, laptop, or tablet.
Public internet UTILITIES → GCP Bridge The tunnel still targets loopback 5678; put TLS and authentication on the VM side — see the walkthrough.

N8N_SECURE_COOKIE=true, N8N_PROTOCOL=https, N8N_HOST and both public URL variables are generated for you. Do not set N8N_SECURE_COOKIE=false — that was the plain-HTTP workaround.

Editing n8n.env takes effect only on a fresh start. PM2 captures the environment when it creates the process, so use SERVICES → PM2 → n8n (it deletes and re-creates both services), or pm2 delete n8n n8n-proxy and start from the menu. Confirm with pm2 env <id> | grep -E 'N8N_|NODE_OPTIONS'.

⚠️ Warning: The installer kills running OpenClaw, n8n and PM2 processes during setup to free memory. If you have active workflows or conversations, save your work first.

📄 License note: n8n is under the Sustainable Use License. See ATTRIBUTIONS.md for 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
Requirements 2GB+ free storage · pnpm 9.15+ · PostgreSQL running
Database External PostgreSQL (pkg install postgresql)
Build Prebuilt dist/ tarball (primary) or local tsc build (fallback, ~65 min)

The installer clones and patches the repo, installs with LMK-kill detection and retries, repairs the .bin symlinks pnpm loses, downloads the prebuilt dist/ and ui-dist tarballs, bootstraps PostgreSQL, generates secrets and writes the PM2 ecosystem file. Nothing is built on-device.

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.json and secrets. The installer deletes ~/paperclip and reclones, which removes instances/default/config.json and config/paperclip.env. Your database (workflows, users, history) survives in PostgreSQL, but you must re-run pnpm paperclipai onboard after reinstall to regenerate config and secrets. Back up ~/paperclip/instances/default/ before reinstalling if you want to preserve settings. UI is pre-built and downloaded as a tarball — never built on-device (Vite/esbuild requires ~4–6 GB transient RSS).


🛠 Developer 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

Pi Coding Agent (Recommended)

The high-performance coding agent optimized for the Termux environment.

Install method npm/pnpm global (@earendil-works/pi-coding-agent@latest)
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. Legacy @mariozechner/pi-coding-agent installations are automatically detected and migrated.

⚠️ Warning: If you already have a command named pi on your system, the installer will remove it to avoid conflicts.


Ollama — Local LLM Runner

Run large language models locally. Installed via Termux's native package manager.

Install method pkg install ollama (Termux native)
Architecture ❌ 64-bit only — Termux has no armv8l package (why)
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. Models live in ~/.ollama (uninstall keeps them).


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

  1. Create Instance: In GCP Console, create an e2-micro VM (Debian/Ubuntu).
  2. Static IP: Reserve a static external IP for this VM.
  3. Firewall: Allow TCP 80 (HTTP), 443 (HTTPS), and 22 (SSH).

Step 2: Set up DNS

  1. Point your domain (e.g., n8n.example.com) to the GCP VM's static IP.

Step 3: Configure Nginx (on GCP VM)

  1. Install Nginx and Certbot: sudo apt install nginx certbot python3-certbot-nginx
  2. Create a site config that proxies to localhost:5678.
  3. Secure it with SSL: sudo certbot --nginx -d yourdomain.com

Step 4: Establish the Tunnel

  1. Run the toolkit on your Android device and choose SERVICES → Configure GCP Bridge.
  2. Follow the prompts to enter your VM IP and Domain.
  3. Copy the generated SSH Public Key and paste it into the GCP VM's ~/.ssh/authorized_keys file.
  4. The monitor script will now automatically maintain a secure autossh tunnel to the VM.

🔧 What the Toolkit Fixes For You

Android is a hostile host for these tools. Every line below is a workaround already in the installer — the detail lives in the section it links to, so this is the map, not the manual.

  • 💥 Kernel and path traps — koffi's renameat2 crash, /tmp, /bin/npm and /bin/node redirected into Termux's own tree, and hardlink tricks replaced by copies where Android refuses them (OpenClaw on Android).
  • 🧠 OpenClaw runs, and keeps running — install-time state migrations (no doctor --fix on Android), a pinned dmPolicy so slash commands survive the pairing-policy change, stale gateway locks cleared, and PM2 handed the shim instead of a directory.
  • 🛟 An update cannot wreck a working install — the previous version is snapshotted and restored if the download is killed, and "installed" is proven by --version, not by a shim that outlives a deleted package.
  • 🐍 Hermes survives pkg upgrade — the venv is pinned to a versioned interpreter, an abandoned PM store is purged from PATH, honcho is reinstalled without the missing runtime, and every update ends by proving hermes --version (Hermes).
  • 🗄 n8n actually starts, and serves TLS — the sqlite3 build that --ignore-scripts skipped is compiled afterwards, and nginx terminates TLS on the LAN with a one-time setup password (n8n).
  • 📦 pnpm's two global layouts are reconciled — an install can no longer be broken by whichever pnpm command ran last.
  • 🔁 A reboot brings things back — the boot script restarts sshd and pm2 resurrects the saved list, and the app can set it up and test it (Keeping services alive).
  • ⚡ Menus are instant, memory is capped — cached config lookups, and a Node heap limit sized to the device instead of the default.
  • 🧹 Uninstall means gone — soft and deep options, a stack reset that keeps system packages, and legacy folders removed only once no tool still needs them.

📊 Quick Commands

Tool Command
OpenClaw openclaw · openclaw gateway status · sv restart openclaw
Ollama ollama serve · ollama pull llama3 · ollama run llama3
Hermes hermes
Nanobot nanobot
Pi pi
Paperclip pm2 start ~/paperclip/ecosystem.config.cjs
n8n SERVICES → PM2 → n8n · https://<phone-ip>:8443
Gemini CLI gemini
PM2 pm2 status · pm2 logs · pm2 restart all · pm2 stop all
Native Services sv up n8n · sv down n8n · sv status openclaw
Wake Lock termux-wake-lock (prevents Android from killing background processes)

🔄 Maintenance

🛡 Safe Updates & Smart Repair

Re-run install.sh, choose the tool, then pick the mode. (openclaw update is never the answer — it overwrites the patches; see Hard Warnings.)

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

💡 Version pinning: the toolkit installs the latest release by default; where offered (OpenClaw), [V] Install Specific Version pins an exact one. On a device where a tool already works, pinning is usually the safer choice — see the app's warning.

🔋 Battery Optimization

To prevent Android from killing the background process:

termux-wake-lock

🛠 Troubleshooting

If an install fails or hangs

  1. Re-run the script: curl -sSL https://raw.githubusercontent.com/niyazmft/droid-ai-toolkit/main/install.sh | bash — it is safe to run again.
  2. Select the same tool from the menu and choose [R] Repair.
  3. Check the log at ~/droid_ai_toolkit.log for the exact failure reason.
  4. 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 ~/.bashrc to refresh your PATH.
  • Hermes, Nanobot or Ollama won't install on a 32-bit phone: expected, not a bug — see Compatibility.
  • Paperclip killed during install: expected on 3–4 GB devices; the installer detects it and continues. Free RAM first if it fails outright.
  • OpenClaw stuck in a startup retry loop: 2026.9.x blocks startup on unmigrated legacy state, and doctor --fix cannot run on Android. OpenClaw → [R] Repair migrates all three stages automatically (detail).
  • OpenClaw logs timer tick failed / cannot acquire a durable fence: the process-identity patch is missing — [R] Repair (why).
  • OpenClaw slash commands answer "No reply was generated" while normal messages work: slash commands are authorization-gated. Run the one snippet in the post-install checklist — /goal saying "You are not authorized" is the same cause.

🗑 Uninstallation & Reset

Run the toolkit and select UNINSTALL to access the modular uninstallation menu. The order mirrors the on-device 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 n8n: Stops n8n + n8n-proxy, kills the GCP tunnel, and removes the watchdog cron.
  • Remove Gemini CLI: Full removal of application binaries and configurations.
  • Remove Hermes: Runs the official uninstaller if available, otherwise removes directories manually.
  • Remove Ollama: Removes the package. Downloaded models in ~/.ollama are preserved.
  • Remove Pi: Full removal of global package and configuration.
  • Remove Paperclip: Stops the PM2 service and preserves the source code and PostgreSQL database.
  • Remove Nanobot: pip uninstall + directory cleanup.
  • 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.

🛠 Code Quality

This project implements a "Zero-Waste" and "Self-Healing" quality gate to maintain high standards for all contributions.

Usage

The gate is lint + both test suites, all pinned in package.json. Run it locally:

pnpm run lint:all                            # ESLint, Stylelint, Markdownlint, shellcheck, ktlint,
                                             # action-spec validation
bash tests/run.sh                            # engine: contract, health, usage, TUI, uninstall
(cd apk && ./gradlew :app:testDebugUnitTest)  # app: refresh policy, supervisor, parsing

CI runs exactly these on every pull request, plus builds the APK.


📄 License

Distributed under the MIT License. See LICENSE for more information.


Explore related projects

Loading…