TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/termux/termux-app/llms.txt
Use this file to discover all available pages before exploring further.
termux-shared library is a Gradle module inside the termux-app repository that centralises every constant, utility class, and shared preference key used by the Termux app and its official plugins. It was introduced in v0.109 specifically to remove hardcoded paths and strings from both the app and plugin codebases. Any value that could appear in more than one place — a file path, an intent action, a package name — lives here rather than being duplicated.
Key classes
All Termux-specific classes live under thecom.termux.shared.termux package. General-purpose utilities live outside that package.
| Class | Description |
|---|---|
TermuxConstants | All package names, file paths, intent actions, and intent extras for the Termux app and every plugin |
TermuxPropertyConstants | All termux.properties key names and their accepted values and defaults |
TermuxBootstrap | Bootstrap package variant handling (apt-android-7 vs apt-android-5) |
TermuxUtils | General utility methods for the Termux app |
TermuxShellManager | Shell session management and tracking |
TermuxPluginUtils | Utility methods shared across plugin apps |
Adding termux-shared as a dependency
The library is published to JitPack from the maintermux/termux-app repository. Add the JitPack Maven repository and declare the dependency in your plugin project.
If you are building against a local checkout of
termux-app, use composite builds or run ./gradlew publishToMavenLocal and add mavenLocal() to your repositories block instead of using the JitPack coordinate.Key constants from TermuxConstants
TermuxConstants (version v0.53.0) is the single source of truth for package names, paths, and intent strings across the entire Termux ecosystem. Always reference these constants rather than writing string literals.
RUN_COMMAND intent
To run commands in Termux from a third-party app or plugin, use theRUN_COMMAND intent action constant:
Plugin package names
Forking and local development
If you are forking Termux or developing a plugin against a modified version oftermux-shared, avoid publishing intermediate versions to JitPack. Instead, use one of the following approaches:
- Local Maven publishing
- Composite build
mavenLocal() to your plugin’s repositories block. This is the simplest approach for rapid iteration.Always use
TermuxConstants constants rather than hardcoding strings. Hardcoded values such as "com.termux" or "/data/data/com.termux/files/usr" in pull requests will not be accepted.