The official Termux Android terminal emulator, fully converted to Kotlin!
Features β’ Installation β’ Building β’ Contributing β’ Original Project
Termux is a powerful Android terminal emulator and Linux environment app that works directly with no rooting or setup required. It provides a complete Linux environment on your Android device with access to:
- π§ Linux shell (bash, zsh, fish)
- π¦ Package manager (apt/pkg) with thousands of packages
- π Programming languages (Python, Node.js, Ruby, Go, Rust, C/C++)
- π§ Development tools (git, vim, nano, ssh, rsync)
- π Networking utilities (curl, wget, nmap, netcat)
This repository is a complete Kotlin conversion of the official termux-app. Every Java file has been meticulously converted to idiomatic Kotlin while maintaining 100% compatibility with the original app.
Termux Kotlin App uses the com.termux package name for 100% compatibility with upstream Termux packages. All packages install and work without any modification:
/data/data/com.termux/files/usr
What works:
- β
pkg install python- Python 3.12.12 installs perfectly - β
pip install <package>- pip works out of the box - β All upstream packages work without path rewriting
- β Uses official Termux bootstrap unchanged
Trade-off: Cannot be installed alongside the official Termux app (same package name, different signing key). This approach is inspired by ZeroTermux which uses the same strategy.
This fork focuses on:
- 100% Kotlin codebase (converted from Java)
- Modern Android development practices
- AI agent integration for development assistance
The agent framework now runs in pure Kotlin with zero Python dependency:
| Feature | Description |
|---|---|
| Auto-start | Daemon starts automatically when app launches |
| 45+ Capabilities | Fine-grained permission system for agents |
| 4 Pure Kotlin Skills | pkg, fs, git, diagnostic |
| Swarm Intelligence | Stigmergy-based multi-agent coordination |
| Python Fallback | Complex skills gracefully degrade if Python missing |
No more separate plugin APKs! These features are now built-in:
| Plugin | Status | Features |
|---|---|---|
| Termux:Boot | β Built-in | Auto-run scripts on device boot |
| Termux:Styling | β Built-in | 11 color schemes, custom fonts, Compose UI |
| Termux:Widget | β Built-in | 3 widget sizes, shortcut execution |
| Termux:API | β Built-in | 20+ hardware APIs (battery, sensors, camera, etc.) |
| Termux:Tasker | π Planned | Tasker integration |
| Architecture | APK Size | Bootstrap Size |
|---|---|---|
arm64-v8a |
~35 MB | 30 MB |
armeabi-v7a |
~32 MB | 27 MB |
x86_64 |
~34 MB | 29 MB |
x86 |
~34 MB | 29 MB |
universal |
~130 MB | All 4 combined |
Why is it larger than original Termux?
The APK includes 66 packages rebuilt from source with native com.termux.kotlin paths. These packages have the correct paths compiled directly into the ELF binaries, ensuring:
- β SSL/TLS works immediately (libgnutls uses correct cert path)
- β Package management works out-of-box (apt/dpkg)
- β No runtime path-patching needed
The original Termux downloads these packages from their repository, while we bundle them for immediate functionality.
The app automatically configures all necessary environment variables:
| Category | Variables | Purpose |
|---|---|---|
| Core | HOME, PREFIX, PATH, TMPDIR |
Basic terminal operation |
| Libraries | LD_LIBRARY_PATH |
Override hardcoded RUNPATH in binaries |
| Terminal | TERMINFO, TERM, COLORTERM |
Full terminal capability support |
| Package Manager | DPKG_ADMINDIR, DPKG_DATADIR |
dpkg/apt path overrides |
| SSL/TLS | SSL_CERT_FILE, CURL_CA_BUNDLE |
HTTPS mirror support |
See ARCHITECTURE.md for the complete list.
| Feature | Benefit |
|---|---|
| Null Safety | Compile-time null checks prevent NullPointerExceptions |
| Concise Syntax | ~40% less boilerplate code |
| Type Inference | Cleaner, more readable code |
| Extension Functions | Enhanced API without inheritance |
| Coroutines Ready | Modern async programming support |
| Interoperability | Seamless Java library compatibility |
| Component | Java Files Converted | Kotlin Files Created |
|---|---|---|
| app | 40+ | 40+ |
| terminal-emulator | 15+ | 15+ |
| terminal-view | 10+ | 10+ |
| termux-shared | 80+ | 80+ |
| Total | 145+ | 145+ |
All original Termux features are preserved:
- β Full Linux terminal with touch/keyboard support
- β Package management via apt (pkg)
- β Session management with multiple terminal tabs
- β Customizable extra keys row
- β Styling support via Termux:Styling
- β Plugin ecosystem (Termux:API, Termux:Boot, Termux:Widget, etc.)
- β Hardware keyboard support with shortcuts
- β Background execution via Termux:Tasker
- β URL handling and file sharing
New features only available in the Kotlin version:
| Feature | Description |
|---|---|
| π¨ Jetpack Compose UI | Modern declarative UI for settings and dialogs |
| π Command Palette | VS Code-style fuzzy command search (Ctrl+Shift+P) |
| π Split Terminal | Side-by-side or top/bottom terminal panes |
| π SSH Manager | Save and manage SSH connection profiles |
| π Command History | Searchable command history with statistics |
| β‘ Kotlin Coroutines | Efficient async operations with Flow |
| π Dependency Injection | Hilt for clean architecture |
| πΎ DataStore | Modern preferences with reactive updates |
| π Profile System | Named profiles with theme, font, shell, and env vars |
| ποΈ Theme Gallery | 10+ built-in themes with live preview |
| πΎ Package Backup | Full backup/restore of packages, repos, and dotfiles |
| π©Ί Package Doctor | Health checks with auto-repair suggestions |
| π οΈ termuxctl CLI | Unified CLI for backup, doctor, and profile management |
| π± Integrated Device API | Built-in Termux:API - no separate APK needed |
| π HTTPS Support | Proper SSL/TLS certificate configuration for secure mirrors |
| π₯οΈ Full Terminal Support | TERMINFO configured for clear, tput, ncurses apps |
| π€ Agent Framework | Offline Python-based agent system with skills & capabilities |
Unlike standard Termux which requires installing the separate Termux:API APK, the Kotlin version has device APIs built directly into the main app:
# Battery status
termuxctl device battery
termuxctl device battery --json --extended
# List available APIs
termuxctl device list
# Coming soon: location, sensors, clipboard, camera, wifi, and more
termuxctl device location --provider gps
termuxctl device sensor --name accelerometerFeatures:
- β Zero Setup - APIs work immediately after install
- β Coroutine-Based - Efficient async operations
- β Type-Safe - Sealed Result types and error handling
- β Unified Permissions - Integrated permission manager
See ARCHITECTURE.md for the full API list and implementation details.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Compose UI Layer β
β (Settings, Command Palette, SSH Manager, Dialogs) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β ViewModels + StateFlow β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Repositories β
β (Settings, Sessions, History, SSH Profiles, Permissions) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Core Modules β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββ β
β β core/api β β core/logging β β core/permissions β β
β β Sealed Types β βTermuxLogger β β PermissionManager β β
β β Result<T,E> β β File Logging β β Activity Result API β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββ β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββ β
β βcore/terminal β β core/plugin β β core/deviceapi β β
β β EventBus β β Plugin API β β Battery, Location β β
β β Flow Events β β Versioning β β Sensors, Camera... β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β DataStore / Coroutines / Hilt DI β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Module | Description |
|---|---|
core/api |
Type-safe Result<T,E> and sealed error hierarchies |
core/logging |
Centralized logging with file output and Flow |
core/permissions |
Unified permission handling with coroutines |
core/terminal |
Flow-based event bus replacing callbacks |
core/plugin |
Stable plugin API with semantic versioning |
core/deviceapi |
Integrated device APIs (battery, location, sensors, etc.) |
ui/settings |
Material 3 Compose settings with DataStore |
pkg/backup |
Package backup/restore manager |
pkg/doctor |
Package health diagnostics and auto-repair |
10 beautiful themes included out of the box:
| Theme | Author | Description |
|---|---|---|
| Dark Steel | Termux Kotlin | Signature dark theme with steel blue accents |
| Molten Blue | Termux Kotlin | GitHub-inspired dark theme |
| Obsidian | Termux Kotlin | VS Code-inspired dark theme |
| Dracula | Zeno Rocha | Popular dark theme |
| Nord | Arctic Ice Studio | Arctic north-bluish palette |
| Solarized Dark | Ethan Schoonover | Classic precision colors |
| Solarized Light | Ethan Schoonover | Light variant |
| Gruvbox Dark | morhetz | Retro groove palette |
| Gruvbox Light | morhetz | Light variant |
| High Contrast | Termux Kotlin | Maximum readability |
Advanced package management features that surpass standard Termux:
# Create a full backup
termuxctl backup create --type full
# Restore with dry-run preview
termuxctl backup restore backup.json --dry-run
# Run package health diagnostics
termuxctl pkg doctor
# Auto-repair issues
termuxctl pkg doctor --auto-repairThe Termux-Kotlin Agent Framework is a fully offline, Python-based agent system:
# Install Python (required)
pkg install python
pip install pyyaml
# List available agents
agent list
# Run a task through an agent
agent run debug_agent "apk.analyze" apk_path=/path/to/app.apk
# Show agent info and capabilities
agent info build_agent
# List available skills
agent skillsBuilt-in Agents:
| Agent | Purpose |
|---|---|
build_agent |
Package building, CI scripts, build log analysis |
debug_agent |
APK/ISO analysis, QEMU tests, binwalk |
system_agent |
Storage check, bootstrap validation, environment repair |
repo_agent |
Package repo sync, Packages.gz generation |
Built-in Skills: pkg, git, fs, qemu, iso, apk, docker
Key Features:
- π Offline-only - No external API calls, runs entirely locally
- π‘οΈ Capability system - Fine-grained permissions (filesystem, network, exec)
- π¦ Plugin architecture - Easy to add new skills
- πΎ Per-agent memory - JSON-based persistent storage
- π Sandboxing - Isolated directories per agent
See AI.md for complete documentation.
Download the latest release APK from the Releases page.
Choose the appropriate variant for your device:
arm64-v8a- Modern 64-bit phones (most devices)armeabi-v7a- Older 32-bit phonesx86_64- 64-bit emulators/ChromeOSx86- 32-bit emulatorsuniversal- Works on all (larger file size)
See Building section below.
- JDK 17 or higher
- Android SDK with Build Tools
- Android NDK (for native components)
# Clone the repository
git clone https://github.com/reapercanuk39/termux-kotlin-app.git
cd termux-kotlin-app
# Build debug APK
./gradlew assembleDebug
# Build release APK (requires signing)
./gradlew assembleRelease
# APKs will be in app/build/outputs/apk/| Variant | Description |
|---|---|
debug |
Development build with debugging enabled |
release |
Production build (requires signing) |
The app includes custom-built bootstraps with native com.termux.kotlin paths. To rebuild them:
# See full documentation
cat docs/CUSTOM_BOOTSTRAP_BUILD.md
# Quick overview:
# 1. Use Docker with termux/package-builder
# 2. Set TERMUX_APP__PACKAGE_NAME="com.termux.kotlin" in properties.sh
# 3. Build apt, dpkg, termux-exec, termux-tools, termux-core
# 4. Integrate into bootstrap zipsPre-built packages are available in the repo/ directory.
| Repository | Description |
|---|---|
| termux/termux-app | π Original Termux app (Java) |
| reapercanuk39/termux-app | π΄ My fork of official repo |
| termux/termux-packages | π¦ Package build scripts |
| termux/termux-api | π Android API access plugin |
Contributions are welcome! This project follows the same contribution guidelines as the original Termux project.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Kotlin coding conventions
- Use meaningful variable/function names
- Add KDoc comments for public APIs
- Prefer immutable (
val) over mutable (var)
This is a Kotlin conversion of the official Termux project:
- Original Repository: github.com/termux/termux-app
- Original Authors: Termux Developers
- License: GPLv3
All credit for the original implementation goes to the Termux team. This conversion aims to modernize the codebase while maintaining full compatibility.
Termux Kotlin App - Android terminal emulator (Kotlin version)
Copyright (C) 2024 Termux Developers & Contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Keywords: termux termux-app termux-kotlin android-terminal terminal-emulator linux-android kotlin-android android-app terminal shell bash linux android-terminal-emulator termux-android kotlin-conversion
Made with β€οΈ by reapercanuk39
β Star this repo if you find it useful!