Termux API

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-get

Set clipboard contents

termux-clipboard-set <text>

Hardware & Sensors

Get battery status

termux-battery-status

List available sensors

termux-sensor -s

Read sensor data

termux-sensor -n <sensor>

Turn on flashlight

termux-torch on

Turn off flashlight

termux-torch off

Vibrate for 500ms

termux-vibrate -d 500

Camera

Get camera information

termux-camera-info

Take a photo

termux-camera-photo

Location

Get GPS location

termux-location

Notifications

Show notification

termux-notification -t "Title" -c "Content"

Remove notification

termux-notification-remove <id>

Telephony & SMS

Get device info

termux-telephony-deviceinfo

Get cell info

termux-telephony-cellinfo

List SMS inbox

termux-sms-inbox

Send SMS

termux-sms-send -n <number> <msg>

Connectivity

Get WiFi connection info

termux-wifi-connectioninfo

Scan WiFi networks

termux-wifi-scaninfo

Media & 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-dialog

Show confirmation dialog

termux-dialog confirm

Show text input dialog

termux-dialog text

Show radio button dialog

termux-dialog radio

Show bottom sheet picker

termux-dialog sheet

Voice input dialog

termux-dialog speech

Request file from storage

termux-storage-get

Requirements

Termux:API requires two components to work. The APK grants Android permissions, and the package provides the command-line interface.

1. Install the APK

Download and install the Termux:API app from GitHub.

Download APK

2. Install the Package

Inside Termux, install the API package:

pkg install termux-api