Pi runs on Android via Termux, a terminal emulator and Linux environment for Android.
- Install Termux from GitHub or F-Droid (not Google Play, that version is deprecated)
- Install Termux:API from GitHub or F-Droid for clipboard and other device integrations
# Update packages
pkg update && pkg upgrade
# Install dependencies
pkg install nodejs termux-api git
# Install pi
npm install -g @mariozechner/pi-coding-agent
# Create config directory
mkdir -p ~/.pi/agent
# Run pi
piClipboard operations use termux-clipboard-set and termux-clipboard-get when running in Termux. The Termux:API app must be installed for these to work.
Image clipboard is not supported on Termux (the ctrl+v image paste feature will not work).
Create ~/.pi/agent/AGENTS.md to help the agent understand the Termux environment:
# Agent Environment: Termux on Android
## Location
- **OS**: Android (Termux terminal emulator)
- **Home**: `/data/data/com.termux/files/home`
- **Prefix**: `/data/data/com.termux/files/usr`
- **Shared storage**: `/storage/emulated/0` (Downloads, Documents, etc.)
## Opening URLs
```bash
termux-open-url "https://example.com"termux-open file.pdf # Opens with default app
termux-open -c image.jpg # Choose apptermux-clipboard-set "text" # Copy
termux-clipboard-get # Pastetermux-notification -t "Title" -c "Content"termux-battery-status # Battery info
termux-wifi-connectioninfo # WiFi info
termux-telephony-deviceinfo # Device infotermux-share -a send file.txt # Share filetermux-toast "message" # Quick toast popup
termux-vibrate # Vibrate device
termux-tts-speak "hello" # Text to speech
termux-camera-photo out.jpg # Take photo- Termux:API app must be installed for
termux-*commands - Use
pkg install termux-apifor the command-line tools - Storage permission needed for
/storage/emulated/0access
## Limitations
- **No image clipboard**: Termux clipboard API only supports text
- **No native binaries**: Some optional native dependencies (like the clipboard module) are unavailable on Android ARM64 and are skipped during installation
- **Storage access**: To access files in `/storage/emulated/0` (Downloads, etc.), run `termux-setup-storage` once to grant permissions
## Troubleshooting
### Clipboard not working
Ensure both apps are installed:
1. Termux (from GitHub or F-Droid)
2. Termux:API (from GitHub or F-Droid)
Then install the CLI tools:
```bash
pkg install termux-api
Run once to grant storage permissions:
termux-setup-storageIf npm fails, try clearing the cache:
npm cache clean --force