Termux:API
Termux:API exposes Android and hardware features as command-line commands. Access clipboard, sensors, camera, notifications, and more directly from your terminal.
Download Termux:API# Install Termux:API package after installing the apppkg install termux-api
Available Commands
Install the APK and the termux-api package, then run any command below
Clipboard
Get clipboard contents
termux-clipboard-getSet clipboard contents
termux-clipboard-set <text>Hardware & Sensors
Get battery status
termux-battery-statusList available sensors
termux-sensor -sRead sensor data
termux-sensor -n <sensor>Turn on flashlight
termux-torch onTurn off flashlight
termux-torch offVibrate for 500ms
termux-vibrate -d 500Camera
Get camera information
termux-camera-infoTake a photo
termux-camera-photoLocation
Get GPS location
termux-locationNotifications
Show notification
termux-notification -t "Title" -c "Content"Remove notification
termux-notification-remove <id>Telephony & SMS
Get device info
termux-telephony-deviceinfoGet cell info
termux-telephony-cellinfoList SMS inbox
termux-sms-inboxSend SMS
termux-sms-send -n <number> <msg>Connectivity
Get WiFi connection info
termux-wifi-connectioninfoScan WiFi networks
termux-wifi-scaninfoMedia & TTS
Text-to-speech
termux-tts-speak <text>Scan file for media library
termux-media-scan <file>Show a toast popup
termux-toast <text>Input & UI
Show a dialog box
termux-dialogShow confirmation dialog
termux-dialog confirmShow text input dialog
termux-dialog textShow radio button dialog
termux-dialog radioShow bottom sheet picker
termux-dialog sheetVoice input dialog
termux-dialog speechRequest file from storage
termux-storage-getRequirements
Termux:API requires two components to work. The APK grants Android permissions, and the package provides the command-line interface.
2. Install the Package
Inside Termux, install the API package:
pkg install termux-api