An open API service indexing awesome lists of open source software.

https://github.com/reapercanuk39/termux-kotlin-app

πŸš€ Termux Android Terminal Emulator - Fully converted to Kotlin! A modern, type-safe fork of the official termux-app with 100% Kotlin codebase.
https://github.com/reapercanuk39/termux-kotlin-app

android android-app android-terminal bash kotlin kotlin-android linux shell terminal terminal-app terminal-emulator termux termux-app termux-kotlin

Last synced: 5 months ago
JSON representation

πŸš€ Termux Android Terminal Emulator - Fully converted to Kotlin! A modern, type-safe fork of the official termux-app with 100% Kotlin codebase.

Awesome Lists containing this project

README

          

# πŸš€ Termux Kotlin App

[![CI](https://github.com/reapercanuk39/termux-kotlin-app/actions/workflows/ci.yml/badge.svg)](https://github.com/reapercanuk39/termux-kotlin-app/actions/workflows/ci.yml)
[![Release](https://github.com/reapercanuk39/termux-kotlin-app/actions/workflows/release.yml/badge.svg)](https://github.com/reapercanuk39/termux-kotlin-app/actions/workflows/release.yml)
[![GitHub Downloads](https://img.shields.io/github/downloads/reapercanuk39/termux-kotlin-app/total?style=for-the-badge&logo=github&label=Downloads&color=success)](https://github.com/reapercanuk39/termux-kotlin-app/releases)
[![Latest Release](https://img.shields.io/github/v/release/reapercanuk39/termux-kotlin-app?style=for-the-badge&logo=android&label=Latest&color=blue)](https://github.com/reapercanuk39/termux-kotlin-app/releases/latest)

[![Kotlin](https://img.shields.io/badge/Kotlin-100%25-7F52FF?style=for-the-badge&logo=kotlin&logoColor=white)](https://kotlinlang.org/)
[![Android](https://img.shields.io/badge/Android-7.0+-3DDC84?style=for-the-badge&logo=android&logoColor=white)](https://www.android.com/)
[![License](https://img.shields.io/badge/License-GPLv3-blue?style=for-the-badge)](LICENSE.md)
[![Fork](https://img.shields.io/badge/Fork%20of-termux%2Ftermux--app-orange?style=for-the-badge&logo=github)](https://github.com/termux/termux-app)

**The official Termux Android terminal emulator, fully converted to Kotlin!**


Download APK

[Features](#features) β€’ [Installation](#installation) β€’ [Building](#building) β€’ [Contributing](#contributing) β€’ [Original Project](#original-project)

---

## πŸ“± What is Termux?

**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)

## ✨ What is Termux Kotlin App?

This repository is a **complete Kotlin conversion** of the official [termux-app](https://github.com/termux/termux-app). Every Java file has been meticulously converted to idiomatic Kotlin while maintaining 100% compatibility with the original app.

### 🎯 Why Kotlin?

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

## πŸ”„ Conversion Statistics

| 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+** |

## πŸš€ Features

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

### πŸ†• Kotlin-Exclusive Features

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 |

### πŸ“± Integrated Device API (No Separate APK!)

Unlike standard Termux which requires installing the separate **Termux:API** APK, the Kotlin version has device APIs **built directly into the main app**:

```bash
# 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 accelerometer
```

**Features:**
- βœ… **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](ARCHITECTURE.md#-integrated-device-api) for the full API list and implementation details.

### πŸ—οΈ Modern Architecture

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 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 β”‚ β”‚ 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 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

### Core Modules

| Module | Description |
|--------|-------------|
| `core/api` | Type-safe `Result` 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 |

### 🎨 Built-in Themes

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 |

### πŸ’Ύ Package Management

Advanced package management features that surpass standard Termux:

```bash
# 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-repair
```

## πŸ“₯ Installation

### Download APK

Download the latest release APK from the [Releases](https://github.com/reapercanuk39/termux-kotlin-app/releases) page.

Choose the appropriate variant for your device:
- `arm64-v8a` - Modern 64-bit phones (most devices)
- `armeabi-v7a` - Older 32-bit phones
- `x86_64` - 64-bit emulators/ChromeOS
- `x86` - 32-bit emulators
- `universal` - Works on all (larger file size)

### Build from Source

See [Building](#building) section below.

## πŸ”¨ Building

### Prerequisites

- **JDK 17** or higher
- **Android SDK** with Build Tools
- **Android NDK** (for native components)

### Build Commands

```bash
# 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/
```

### Build Variants

| Variant | Description |
|---------|-------------|
| `debug` | Development build with debugging enabled |
| `release` | Production build (requires signing) |

## πŸ”— Related Repositories

| Repository | Description |
|------------|-------------|
| [termux/termux-app](https://github.com/termux/termux-app) | 🏠 Original Termux app (Java) |
| [reapercanuk39/termux-app](https://github.com/reapercanuk39/termux-app) | 🍴 My fork of official repo |
| [termux/termux-packages](https://github.com/termux/termux-packages) | πŸ“¦ Package build scripts |
| [termux/termux-api](https://github.com/termux/termux-api) | πŸ”Œ Android API access plugin |

## 🀝 Contributing

Contributions are welcome! This project follows the same contribution guidelines as the original Termux project.

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit changes (`git commit -m 'Add amazing feature'`)
4. Push to branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

### Code Style

- Follow [Kotlin coding conventions](https://kotlinlang.org/docs/coding-conventions.html)
- Use meaningful variable/function names
- Add KDoc comments for public APIs
- Prefer immutable (`val`) over mutable (`var`)

## πŸ“‹ Original Project

This is a Kotlin conversion of the official **Termux** project:

- **Original Repository**: [github.com/termux/termux-app](https://github.com/termux/termux-app)
- **Original Authors**: [Termux Developers](https://github.com/termux)
- **License**: [GPLv3](LICENSE.md)

All credit for the original implementation goes to the Termux team. This conversion aims to modernize the codebase while maintaining full compatibility.

## πŸ“„ License

```
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](https://github.com/reapercanuk39)

⭐ **Star this repo** if you find it useful!