gotermux icon indicating copy to clipboard operation
gotermux copied to clipboard

Easy-to-use wrapper for Termux API

GoTermux

Code quality checks: CodeFactor Codacy Badge Go Report Card

Documentation reference: GoDoc

Examples and usage of GoTermux: gotermux.mysh.dev

Roadmap: Roadmap

GoTermux gives you the opportunity to execute your scripts in Termux using Golang. All from Go and Termux API features in your hands!

  • GoTermux package
    • Codestyle
    • Examples
    • Installing Termux API
    • Installing the package

Codestyle

Calling termux command from golang looks just like in termux cmd, but without dash (-).

Example:

// Termux CMD:
termux-battery-status
// Golang: 
TermuxBatteryStatus()

Examples

Code examples can be found at: gotermux.mysh.dev!

Or here: now.sh

Installing Termux API

Use F-droid or Google Play to install Termux API.

Do not mix installations of Termux and Addons between Google Play and F-Droid.

To use Termux API you also need to install the termux-api package:

pkg install termux-api

Installing the package

First of all you need install golang:

pkg install golang

And then:

go get -u github.com/hugmouse/gotermux