Home Features AI Agent Docs Built Today Download

MobileCLI Documentation

Complete reference for v9.9.4 — everything you can do with MobileCLI.

Getting Started

Requirements

Download & Install

  1. Download the APK from mobilecli.com
  2. Open the APK. Allow installation from unknown sources if prompted.
  3. Launch MobileCLI. The setup wizard runs automatically.

What the Setup Wizard Installs

On first launch, MobileCLI extracts and configures:

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:

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.

CLIProviderAuth Method
claudeAnthropicOAuth (Claude Max) or API key
geminiGoogleGoogle account
codexOpenAIChatGPT Plus or API key
openrouterOpenRouterAPI 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

GatewayHow It Works
SMS PollingReads incoming SMS via termux-sms-list, replies via termux-sms-send
TwilioVoice calls, WhatsApp, and SMS via Twilio API webhooks
Voice AITwo-way phone conversations with AI (see Voice AI section)
TelegramBot API polling — text, photos, commands
DiscordREST API polling for messages in configured channels
WebhookHTTP listener on localhost for custom integrations
NotificationsMonitors Android notifications and can respond to them

7 Skill Modules

SkillCapabilities
SMSSend text messages programmatically
VoiceSpeech-to-text, text-to-speech, wake word detection
HardwareFlashlight, IR blaster, NFC, all sensors
MediaCamera capture, audio recording and playback
Twilio ActionsMake calls, send WhatsApp messages via Twilio
SchedulerCron-like task scheduling (health checks, briefings)
System MonitorBattery, 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

CommandWhat It Does
mcli-swarm start "goal"Decompose goal into tasks, spawn agent tabs
mcli-swarm statusShow all agents and their current status
mcli-swarm mergeCombine all agent branches into main
mcli-swarm stopStop all agents in the current session
mcli-swarm listList all swarm sessions
mcli-new-tab "cmd"Spawn a new terminal tab with a command

Architecture

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

  1. Open the nav drawer and tap AI Widget.
  2. If prompted, grant the overlay permission (Display over other apps).
  3. A floating bubble appears. Tap it to expand into the full chat.

Features

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:

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

CommandDescription
voice-ai startStart voice AI server (HTTP + SSH tunnel)
voice-ai stopStop the server
voice-ai statusShow server status and tunnel URL
voice-ai testTest server health endpoint
voice-ai logView recent voice call logs
voice-ai setupInteractive Twilio configuration

How Calls Work

  1. voice-ai start launches an HTTP server and an SSH tunnel
  2. Twilio routes incoming calls to the tunnel URL
  3. Caller speaks → Twilio transcribes to text
  4. Text is sent to the AI brain for processing
  5. AI generates a response (and optionally executes commands)
  6. 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:

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

KeyDefaultDescription
voice_conversation_modelhaikuFast model for real-time voice conversation
voice_worker_modelsonnetHeavy model for background worker tasks

Hardware Commands (65+)

Every command below is available from the terminal. All return structured JSON. All are scriptable.

Clipboard

CommandDescriptionExample
termux-clipboard-getRead clipboardtermux-clipboard-get
termux-clipboard-setWrite clipboardtermux-clipboard-set "Hello"

Notifications & UI

CommandDescriptionExample
termux-toastShow toasttermux-toast "Done!"
termux-notificationSystem notificationtermux-notification -t "Title" -c "Body"
termux-dialogShow dialogtermux-dialog confirm -t "Sure?"

Device Control

CommandDescriptionExample
termux-vibrateVibrate devicetermux-vibrate -d 500
termux-torchFlashlight on/offtermux-torch on
termux-brightnessSet brightnesstermux-brightness 128
termux-volumeSet volumetermux-volume music 10
termux-wallpaperSet wallpapertermux-wallpaper -f image.jpg
termux-wake-lockKeep CPU awaketermux-wake-lock
termux-wake-unlockRelease wake locktermux-wake-unlock

Battery & Network

CommandDescriptionExample
termux-battery-statusBattery info (JSON)termux-battery-status
termux-wifi-connectioninfoCurrent WiFitermux-wifi-connectioninfo
termux-wifi-scaninfoScan networkstermux-wifi-scaninfo
termux-downloadDownload filetermux-download "https://..."

Location

CommandDescriptionExample
termux-locationGPS coordinatestermux-location

Camera

CommandDescriptionExample
termux-camera-infoList camerastermux-camera-info
termux-camera-photoTake phototermux-camera-photo -o /sdcard/Download/photo.jpg

Audio & Media

CommandDescriptionExample
termux-media-playerPlay audiotermux-media-player play file.mp3
termux-microphone-recordRecord audiotermux-microphone-record -f out.m4a -l 10
termux-tts-speakText to speechtermux-tts-speak "Hello"
termux-audio-infoAudio device infotermux-audio-info
termux-media-scanScan media filestermux-media-scan -f photo.jpg

Telephony & SMS

CommandDescriptionExample
termux-telephony-deviceinfoDevice infotermux-telephony-deviceinfo
termux-telephony-cellinfoCell tower infotermux-telephony-cellinfo
termux-telephony-callMake a calltermux-telephony-call "+1234567890"
termux-call-logCall historytermux-call-log
termux-sms-listList SMStermux-sms-list
termux-sms-sendSend SMStermux-sms-send -n "+1234567890" "Hi!"

Contacts

CommandDescriptionExample
termux-contact-listList contactstermux-contact-list

Sensors

CommandDescriptionExample
termux-sensor -lList sensorstermux-sensor -l
termux-sensor -sRead sensortermux-sensor -s accelerometer

Biometrics

CommandDescriptionExample
termux-fingerprintFingerprint authtermux-fingerprint

Bluetooth

CommandDescriptionExample
termux-bluetooth-pairedPaired devicestermux-bluetooth-paired
termux-bluetooth-scaninfoScan devicestermux-bluetooth-scaninfo

IR Blaster

CommandDescriptionExample
termux-infrared-transmitSend IR signaltermux-infrared-transmit -f 38000 50,50,50,50

NFC & USB

CommandDescriptionExample
termux-nfcRead NFC tagtermux-nfc
termux-usbUSB devicestermux-usb -l

Storage & Sharing

CommandDescriptionExample
termux-shareAndroid sharetermux-share file.txt
termux-openOpen with default apptermux-open file.pdf
termux-open-urlOpen URLtermux-open-url "https://..."
termux-storage-getPick filetermux-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).

IDEHow It WorksLaunch
VS Codecode-server runs inside proot-distro Ubuntu on localhost:8080Nav drawer → "VS Code IDE" or vscode command
Cursor AgentCursor CLI wrapped to run through proot-distro Ubuntu for glibcNav 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

CLIProviderWhat It Does
claudeAnthropicAI coding assistant (Opus, Sonnet)
geminiGoogleAI coding assistant (Gemini 2.5)
codexOpenAIAI coding assistant
openrouterOpenRouter100+ AI models via unified API
vercelVercelDeploy websites, Next.js, serverless
ghGitHubRepos, PRs, issues, releases
firebaseGoogleHosting, database, auth, functions
netlifyNetlifySites, serverless, edge handlers
flyFly.ioDeploy and run apps globally
herokuHerokuPlatform apps, dynos, add-ons
easExpoReact Native build, submit, update
convexConvexRealtime backend with TypeScript
godot4GodotGame engine (2D/3D, multi-platform)
supabaseSupabaseDatabase, auth, storage, edge
telegram-cliTelegramBuild and run Telegram bots
discord-cliDiscordBuild and run Discord bots
slackSlackBuild Slack apps and workflows
twilioTwilioSMS, voice, WhatsApp APIs
shopifyShopifyApps, themes, storefronts
sanitySanityHeadless CMS
contentfulContentfulHeadless CMS
huggingface-cliHugging FaceAI models, datasets, spaces
vscodecode-serverVS Code IDE via proot-distro Ubuntu
cursor-agentCursorCursor AI agent via proot-distro Ubuntu

File System & Paths

PathVariableUse For
~/$HOMEProjects, 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/$PREFIXSystem packages, binaries
$PREFIX/tmp/$TMPDIRTemporary 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

  1. User fills out 3-field feedback form (what you love, what to change, what to build)
  2. Feedback saves locally to ~/.mobilecli/feedback/
  3. Feature requests auto-create GitHub issues tagged community-request
  4. Payment method chooser: Stripe (card) or PayPal
  5. Stripe donations use the create-donation-checkout Supabase Edge Function (one-time payment, not subscription)

Troubleshooting

What's Auto-Installed vs. Manual Setup

ComponentAuto-installed?How to Set Up
Bootstrap (bash, apt, coreutils)YesAutomatic on first launch
89 termux-* scriptsYesExtracted by BootstrapInstaller
Python 3, Node.js, GitYesInstalled during bootstrap
Agent system skeletonYesExtracted from bundled archive
Claude, Gemini, Codex CLIsNoNav drawer → "Install AI"
Android SDK / build toolsNoinstall-dev-tools
Twilio CLINonpm install -g twilio-cli
Telegram (Telethon)Nopip install telethon
AI API keys / authNoEach AI prompts on first use
Twilio / Telegram credentialsNoUser-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).