The Termux:API add-on provides command line access to device API:s:

* Read and send sms messages from your terminal.
* Access device GPS location sensor from scripts.
* Pipe the result of commands into the device text-to-speech engine.
* Vibrate the device when something interesting happens.
* Access the system clipboard from shell scripts.
* List contacts from the system contact list.

Besides installing this app an additional package is required to install inside Termux:
$ apt install termux-api

See the following documentation about available API commands:

NOTE: This is an add-on which requires that the main Termux app is installed to use.
From version Termux:API 0.27:
• Do not trim content in termux-clipboard-set.
• Do not append newline in termux-clipboard-get.
• Add support for upcoming termux-notification-list command.
• Support date format option in termux-dialog.
• More options supported in termux-notification.
• Support reading sent sms as well - termux-sms-inbox has been replaced by termux-sms-list.

NOTE: Be sure to run 'pkg update' to ensure that you are running the latest version of all packages!
All versions
September 6, 2018
June 24, 2018
June 15, 2018
June 9, 2018
April 9, 2017