MobileCLI Documentation
Complete reference for v9.9.4 — everything you can do with MobileCLI.
Getting Started
Requirements
- Android 7.0 or higher
- ~2GB free storage (bootstrap + tools)
- Any CPU architecture (ARM64 recommended)
Download & Install
- Download the APK from mobilecli.com
- Open the APK. Allow installation from unknown sources if prompted.
- Launch MobileCLI. The setup wizard runs automatically.
What the Setup Wizard Installs
On first launch, MobileCLI extracts and configures:
- Linux filesystem — bash, apt, coreutils, and a full package manager
- Python 3 and Node.js — pre-installed runtimes
- 89 termux-* scripts — hardware command wrappers
- Git — version control
- Agent system skeleton — extracted from bundled archive
This takes about 5 minutes on a typical device. After setup, the terminal is ready.
First AI Session
Open the navigation drawer (swipe right or tap the menu icon). Under AI Assistants, tap the AI you want to use. Each AI opens a new terminal session. You'll need to authenticate on first use:
- Claude Code — runs
claude. Authenticate with Anthropic (OAuth or API key). - Gemini CLI — runs
gemini. Authenticate with Google. - Codex CLI — runs
codex. Authenticate with OpenAI. - OpenRouter CLI — access 100+ models via unified API key.
AI Assistants
MobileCLI ships with 4 AI coding assistants. These aren't chatbots — they're autonomous agents that read your project, write code across multiple files, run tests, and deploy.
| CLI | Provider | Auth Method |
|---|---|---|
claude | Anthropic | OAuth (Claude Max) or API key |
gemini | Google account | |
codex | OpenAI | ChatGPT Plus or API key |
openrouter | OpenRouter | API key |
Launch any AI from the nav drawer or type its name in the terminal.
AI Collaboration
AIs can work together through standard Unix pipes:
# Claude writes code, Gemini reviews it
claude "Write a REST API" > api.js
gemini "Review this code for bugs" < api.js
# Chain different AIs for different tasks
codex "Add unit tests" < api.js > tests.js
AI Agent System
The agent is an autonomous AI daemon that runs in the background on your phone. It monitors communication channels, processes messages through AI, and responds using your phone's native capabilities.
Starting the Agent
# From the terminal
mcli-open start
# Or use the native dashboard
# Nav drawer → AI Agent → Start
The dashboard (AIAgentActivity) provides real-time status, uptime, conversation count, and gateway indicators. Start, stop, and restart from the UI.
7 Communication Gateways
| Gateway | How It Works |
|---|---|
| SMS Polling | Reads incoming SMS via termux-sms-list, replies via termux-sms-send |
| Twilio | Voice calls, WhatsApp, and SMS via Twilio API webhooks |
| Voice AI | Two-way phone conversations with AI (see Voice AI section) |
| Telegram | Bot API polling — text, photos, commands |
| Discord | REST API polling for messages in configured channels |
| Webhook | HTTP listener on localhost for custom integrations |
| Notifications | Monitors Android notifications and can respond to them |
7 Skill Modules
| Skill | Capabilities |
|---|---|
| SMS | Send text messages programmatically |
| Voice | Speech-to-text, text-to-speech, wake word detection |
| Hardware | Flashlight, IR blaster, NFC, all sensors |
| Media | Camera capture, audio recording and playback |
| Twilio Actions | Make calls, send WhatsApp messages via Twilio |
| Scheduler | Cron-like task scheduling (health checks, briefings) |
| System Monitor | Battery, network, process monitoring and alerts |
Configuration
The agent config lives at ~/.mobilecli-open/config.json. Key settings:
{
"ai_model": "claude-sonnet",
"fallback_model": "gemini",
"gateways": {
"sms": { "enabled": true, "poll_interval": 10 },
"telegram": { "enabled": true, "bot_token": "..." },
"discord": { "enabled": false },
"webhook": { "enabled": true, "port": 8780 }
}
}
The brain supports multiple AI models. Claude Sonnet is the default. If Claude is unavailable, it falls back to Gemini automatically. The brain is channel-aware: SMS caps at 160 characters, WhatsApp allows 4,096, Discord allows 2,000.
Security: No ports are exposed externally. Every gateway uses outbound polling — the phone never accepts inbound connections. Conversations and data stay on your device.
Agent Swarm (v9.9.2)
The Agent Swarm decomposes complex goals into parallel tasks, spawns AI agents in separate terminal tabs, and coordinates their work through file-based IPC.
Commands
| Command | What It Does |
|---|---|
mcli-swarm start "goal" | Decompose goal into tasks, spawn agent tabs |
mcli-swarm status | Show all agents and their current status |
mcli-swarm merge | Combine all agent branches into main |
mcli-swarm stop | Stop all agents in the current session |
mcli-swarm list | List all swarm sessions |
mcli-new-tab "cmd" | Spawn a new terminal tab with a command |
Architecture
- Orchestrator (Tab 0) — uses Claude CLI to decompose the goal into a JSON plan with agent assignments
- Agent tabs — each spawned via
mcli-new-tab, gets its own full 200K context window - File coordination — agents communicate through
~/.mobilecli/swarm/session-{id}/agent-N/status.md - Status protocol — PENDING → WORKING → DONE/BLOCKED (first line of status.md)
- Mixed models — agents can use Claude, Gemini, Codex, or Cursor CLI
- Git branches — each agent works on its own branch,
mcli-swarm mergecombines work
App drawer: The "Agent Swarm" button in the nav drawer opens a goal input dialog. Enter your goal and the swarm starts automatically.
AI Widget (v9.7.0)
The AI Widget is a floating WebView overlay that works while you use other apps. Chat with AI, take photos for analysis, use voice — all without leaving your current app.
Enabling the Widget
- Open the nav drawer and tap AI Widget.
- If prompted, grant the overlay permission (Display over other apps).
- A floating bubble appears. Tap it to expand into the full chat.
Features
- Floating overlay — draggable bubble, expands to full chat, works over any app
- Camera + vision — take photos from the widget, AI analyzes them via base64 pipeline
- Voice mode — speech-to-text input, text-to-speech output, continuous listen-process-speak loop
- Theme support — dark and light themes, persisted in localStorage
- Settings — model selection, voice toggle, theme, all persisted
- Markdown rendering — with XSS protection and code block syntax highlighting
Bridge API
The widget communicates with native Android through window.MobileCLI, a @JavascriptInterface bridge exposed to the WebView. 17 methods are available:
// Examples of bridge methods
window.MobileCLI.sendMessage(text)
window.MobileCLI.takePhoto()
window.MobileCLI.startVoiceInput()
window.MobileCLI.stopVoiceInput()
window.MobileCLI.speak(text)
window.MobileCLI.stopSpeaking()
window.MobileCLI.getSettings()
window.MobileCLI.saveSettings(json)
window.MobileCLI.minimize()
window.MobileCLI.close()
Hot Reload (Developers)
The widget UI is TypeScript compiled with esbuild into a ~14KB bundle. During development:
- Place your source in
~/mobilecli-widget/ - Build with
npx esbuild src/index.ts --bundle --outdir=dist - The widget polls
dist/version.jsonevery 5 seconds - When the mtime changes, the WebView reloads automatically
Load priority: ~/mobilecli-widget/dist/ (dev) takes precedence over assets/widget/ (bundled).
Widget vs AI Chat: The widget (v9.7+) is a native WebView overlay with a Kotlin bridge. The older AI Web Chat (v9.3) is a browser-based Python server on port 8780. Both work; the widget is lighter and doesn't need a running server.
Voice AI
MobileCLI can answer phone calls and let callers have full conversations with AI. The AI can execute commands, control hardware, create files, and report results — all via voice.
Setup
# Interactive Twilio configuration
voice-ai setup
# You'll need:
# - Twilio Account SID
# - Twilio Auth Token
# - A Twilio phone number
# - openssh (pkg install openssh)
Commands
| Command | Description |
|---|---|
voice-ai start | Start voice AI server (HTTP + SSH tunnel) |
voice-ai stop | Stop the server |
voice-ai status | Show server status and tunnel URL |
voice-ai test | Test server health endpoint |
voice-ai log | View recent voice call logs |
voice-ai setup | Interactive Twilio configuration |
How Calls Work
voice-ai startlaunches an HTTP server and an SSH tunnel- Twilio routes incoming calls to the tunnel URL
- Caller speaks → Twilio transcribes to text
- Text is sent to the AI brain for processing
- AI generates a response (and optionally executes commands)
- Response is returned as TwiML → Twilio speaks it to the caller
The AI can do anything it can do in the terminal — create files, turn on the flashlight, check battery, open URLs, send SMS — all triggered by voice commands during a call.
Two-Tier Architecture (v9.9.0)
Voice calls use a dual brain architecture for fast, uninterrupted conversations:
- Fast tier (Haiku) — handles all conversation, responds in 1-3 seconds via direct Anthropic API
- Worker tier (Sonnet/Opus) — runs complex tasks (build games, write code, generate documents) in the background
When the AI needs to build something complex, it dispatches a worker block to a more powerful model. The caller keeps talking to Haiku while the worker runs. Results are delivered live if the caller is still on the line, or via callback/SMS if they hung up.
Worker Block Format
```worker
Build a snake game in HTML/JS. Mobile-friendly. Save to /sdcard/Download/snake.html
```
Multiple workers can run concurrently. Workers work across voice calls, SMS, and Telegram.
Config Options
| Key | Default | Description |
|---|---|---|
voice_conversation_model | haiku | Fast model for real-time voice conversation |
voice_worker_model | sonnet | Heavy model for background worker tasks |
Hardware Commands (65+)
Every command below is available from the terminal. All return structured JSON. All are scriptable.
Clipboard
| Command | Description | Example |
|---|---|---|
termux-clipboard-get | Read clipboard | termux-clipboard-get |
termux-clipboard-set | Write clipboard | termux-clipboard-set "Hello" |
Notifications & UI
| Command | Description | Example |
|---|---|---|
termux-toast | Show toast | termux-toast "Done!" |
termux-notification | System notification | termux-notification -t "Title" -c "Body" |
termux-dialog | Show dialog | termux-dialog confirm -t "Sure?" |
Device Control
| Command | Description | Example |
|---|---|---|
termux-vibrate | Vibrate device | termux-vibrate -d 500 |
termux-torch | Flashlight on/off | termux-torch on |
termux-brightness | Set brightness | termux-brightness 128 |
termux-volume | Set volume | termux-volume music 10 |
termux-wallpaper | Set wallpaper | termux-wallpaper -f image.jpg |
termux-wake-lock | Keep CPU awake | termux-wake-lock |
termux-wake-unlock | Release wake lock | termux-wake-unlock |
Battery & Network
| Command | Description | Example |
|---|---|---|
termux-battery-status | Battery info (JSON) | termux-battery-status |
termux-wifi-connectioninfo | Current WiFi | termux-wifi-connectioninfo |
termux-wifi-scaninfo | Scan networks | termux-wifi-scaninfo |
termux-download | Download file | termux-download "https://..." |
Location
| Command | Description | Example |
|---|---|---|
termux-location | GPS coordinates | termux-location |
Camera
| Command | Description | Example |
|---|---|---|
termux-camera-info | List cameras | termux-camera-info |
termux-camera-photo | Take photo | termux-camera-photo -o /sdcard/Download/photo.jpg |
Audio & Media
| Command | Description | Example |
|---|---|---|
termux-media-player | Play audio | termux-media-player play file.mp3 |
termux-microphone-record | Record audio | termux-microphone-record -f out.m4a -l 10 |
termux-tts-speak | Text to speech | termux-tts-speak "Hello" |
termux-audio-info | Audio device info | termux-audio-info |
termux-media-scan | Scan media files | termux-media-scan -f photo.jpg |
Telephony & SMS
| Command | Description | Example |
|---|---|---|
termux-telephony-deviceinfo | Device info | termux-telephony-deviceinfo |
termux-telephony-cellinfo | Cell tower info | termux-telephony-cellinfo |
termux-telephony-call | Make a call | termux-telephony-call "+1234567890" |
termux-call-log | Call history | termux-call-log |
termux-sms-list | List SMS | termux-sms-list |
termux-sms-send | Send SMS | termux-sms-send -n "+1234567890" "Hi!" |
Contacts
| Command | Description | Example |
|---|---|---|
termux-contact-list | List contacts | termux-contact-list |
Sensors
| Command | Description | Example |
|---|---|---|
termux-sensor -l | List sensors | termux-sensor -l |
termux-sensor -s | Read sensor | termux-sensor -s accelerometer |
Biometrics
| Command | Description | Example |
|---|---|---|
termux-fingerprint | Fingerprint auth | termux-fingerprint |
Bluetooth
| Command | Description | Example |
|---|---|---|
termux-bluetooth-paired | Paired devices | termux-bluetooth-paired |
termux-bluetooth-scaninfo | Scan devices | termux-bluetooth-scaninfo |
IR Blaster
| Command | Description | Example |
|---|---|---|
termux-infrared-transmit | Send IR signal | termux-infrared-transmit -f 38000 50,50,50,50 |
NFC & USB
| Command | Description | Example |
|---|---|---|
termux-nfc | Read NFC tag | termux-nfc |
termux-usb | USB devices | termux-usb -l |
Storage & Sharing
| Command | Description | Example |
|---|---|---|
termux-share | Android share | termux-share file.txt |
termux-open | Open with default app | termux-open file.pdf |
termux-open-url | Open URL | termux-open-url "https://..." |
termux-storage-get | Pick file | termux-storage-get output.pdf |
Development Tools
Android App Building
MobileCLI can compile and sign Android APKs on the device itself.
# One-time setup
install-dev-tools
# This installs:
# - Java 17 (openjdk-17)
# - Gradle
# - aapt2 (Android asset packaging)
# - d8 (DEX compiler)
# - apksigner
# Build an Android app
cd ~/my-app
./gradlew assembleDebug
# Copy to Downloads for user access
cp app/build/outputs/apk/debug/*.apk /sdcard/Download/
ARM build note: Add android.aapt2FromMavenOverride=/data/data/com.termux/files/home/android-sdk/build-tools/34.0.0/aapt2 to gradle.properties to use the ARM-native aapt2 instead of the x86 version Gradle downloads.
Self-Modification
MobileCLI can rebuild itself from source:
# Clone source
git clone https://github.com/MobileDevCLI/MobileCLI-v8.0.0.git ~/MobileCLI
# Make changes, rebuild
cd ~/MobileCLI
./gradlew assembleDebug
# Install the new version
cp app/build/outputs/apk/debug/app-debug.apk /sdcard/Download/MobileCLI-new.apk
MobileCLI has gone through 16+ versions built this way — AI running inside the app modifying the app's source code, compiling, and producing a new APK. On a phone.
Game Development
Godot 4 game engine is available. Build games and export to Android, iOS, Web, Windows, Mac, or Linux.
# Export to Android
godot4 --headless --export-release "Android" /sdcard/Download/game.apk
Deployment CLIs
Deploy directly from your phone:
# Vercel (websites, serverless)
vercel --prod
# Firebase (hosting, functions)
firebase deploy
# GitHub (releases with binary attachments)
gh release create v1.0.0 ./app.apk --title "v1.0.0"
# Netlify
netlify deploy --prod
# Fly.io
fly deploy
IDE Integration (v9.9.1)
Full IDE environments run on-device via proot-distro Ubuntu (needed for glibc compatibility).
| IDE | How It Works | Launch |
|---|---|---|
| VS Code | code-server runs inside proot-distro Ubuntu on localhost:8080 | Nav drawer → "VS Code IDE" or vscode command |
| Cursor Agent | Cursor CLI wrapped to run through proot-distro Ubuntu for glibc | Nav drawer → "Cursor Agent" or cursor-agent command |
Both IDEs auto-install Ubuntu via proot-distro on first run (~500MB). The proot layer provides full glibc compatibility that Termux's Bionic libc cannot.
24 Platform CLIs
| CLI | Provider | What It Does |
|---|---|---|
claude | Anthropic | AI coding assistant (Opus, Sonnet) |
gemini | AI coding assistant (Gemini 2.5) | |
codex | OpenAI | AI coding assistant |
openrouter | OpenRouter | 100+ AI models via unified API |
vercel | Vercel | Deploy websites, Next.js, serverless |
gh | GitHub | Repos, PRs, issues, releases |
firebase | Hosting, database, auth, functions | |
netlify | Netlify | Sites, serverless, edge handlers |
fly | Fly.io | Deploy and run apps globally |
heroku | Heroku | Platform apps, dynos, add-ons |
eas | Expo | React Native build, submit, update |
convex | Convex | Realtime backend with TypeScript |
godot4 | Godot | Game engine (2D/3D, multi-platform) |
supabase | Supabase | Database, auth, storage, edge |
telegram-cli | Telegram | Build and run Telegram bots |
discord-cli | Discord | Build and run Discord bots |
slack | Slack | Build Slack apps and workflows |
twilio | Twilio | SMS, voice, WhatsApp APIs |
shopify | Shopify | Apps, themes, storefronts |
sanity | Sanity | Headless CMS |
contentful | Contentful | Headless CMS |
huggingface-cli | Hugging Face | AI models, datasets, spaces |
vscode | code-server | VS Code IDE via proot-distro Ubuntu |
cursor-agent | Cursor | Cursor AI agent via proot-distro Ubuntu |
File System & Paths
| Path | Variable | Use For |
|---|---|---|
~/ | $HOME | Projects, data, configuration |
/sdcard/Download/ | — | Files the user can access from the file manager |
/sdcard/DCIM/ | — | Photos and camera output |
/sdcard/ | — | All user-accessible storage |
/data/data/com.termux/files/usr/ | $PREFIX | System packages, binaries |
$PREFIX/tmp/ | $TMPDIR | Temporary files (NOT /tmp) |
/proc/ | — | Process info, CPU, memory stats |
/sys/ | — | Kernel info, device settings |
Never use /tmp — it will fail with permission denied. Use ~/tmp or $PREFIX/tmp instead.
User-accessible files: Always save output files to /sdcard/Download/ so the user can find them in their file manager.
Support & Donations (v9.9.4)
The "Support MobileCLI" button in the nav drawer collects user feedback and offers donation via PayPal or Stripe. Donations are separate from subscriptions — they don't unlock Pro, they're just a way to support development.
How It Works
- User fills out 3-field feedback form (what you love, what to change, what to build)
- Feedback saves locally to
~/.mobilecli/feedback/ - Feature requests auto-create GitHub issues tagged
community-request - Payment method chooser: Stripe (card) or PayPal
- Stripe donations use the
create-donation-checkoutSupabase Edge Function (one-time payment, not subscription)
Troubleshooting
What's Auto-Installed vs. Manual Setup
| Component | Auto-installed? | How to Set Up |
|---|---|---|
| Bootstrap (bash, apt, coreutils) | Yes | Automatic on first launch |
| 89 termux-* scripts | Yes | Extracted by BootstrapInstaller |
| Python 3, Node.js, Git | Yes | Installed during bootstrap |
| Agent system skeleton | Yes | Extracted from bundled archive |
| Claude, Gemini, Codex CLIs | No | Nav drawer → "Install AI" |
| Android SDK / build tools | No | install-dev-tools |
| Twilio CLI | No | npm install -g twilio-cli |
| Telegram (Telethon) | No | pip install telethon |
| AI API keys / auth | No | Each AI prompts on first use |
| Twilio / Telegram credentials | No | User-specific config (see Agent docs) |
Common Issues
Setup wizard seems stuck
The bootstrap download can take 5+ minutes on slow connections. Don't close the app. If it fails, relaunch and it will resume.
/tmp permission denied
Android doesn't allow writing to /tmp. Use ~/tmp or $PREFIX/tmp instead.
Gradle downloads x86 aapt2
Add to gradle.properties:
android.aapt2FromMavenOverride=/data/data/com.termux/files/home/android-sdk/build-tools/34.0.0/aapt2
AI CLI won't authenticate
Make sure you have a valid account with the AI provider. Claude requires an Anthropic account (free tier or Claude Max). Gemini requires a Google account. Codex requires an OpenAI account.
Overlay permission for Widget
Android requires "Display over other apps" permission for floating windows. MobileCLI will prompt you and take you to the settings page. Toggle it on, then return to the app.
Voice AI calls not connecting
Ensure openssh is installed (pkg install openssh), Twilio credentials are configured (voice-ai setup), and the tunnel is active (voice-ai status).