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

https://github.com/alex72-py/aria-termux

Terminal-native AI assistant built specifically for Termux and Android development.
https://github.com/alex72-py/aria-termux

ai ai-agents aiagent android assistant cli gemma gemma4 llm mobile mobile-development mobile-first mobile-friendly python termux

Last synced: about 2 months ago
JSON representation

Terminal-native AI assistant built specifically for Termux and Android development.

Awesome Lists containing this project

README

          

# ๐Ÿš€ ARIA โ€” AI Terminal Co-Pilot for Termux

[![Python](https://img.shields.io/badge/Python-89%25-3776ab?logo=python&logoColor=white)](https://python.org)
[![Shell](https://img.shields.io/badge/Shell-11%25-4EAA25?logo=gnu-bash&logoColor=white)](https://www.gnu.org/software/bash/)
[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
[![Google Gemma 4](https://img.shields.io/badge/Google%20Gemma-4-4285F4?logo=google&logoColor=white)](https://ai.google.dev/)

> **Built for developers who use Termux as a real development environment on Android.**

---

## ๐Ÿ“‹ Table of Contents

- [About](#about)
- [โœจ Features](#-features)
- [๐Ÿ“ธ Screenshots](#-screenshots)
- [๐ŸŽฌ Demo](#-demo)
- [๐Ÿš€ Quick Start](#-quick-start)
- [๐Ÿ”‘ First Run](#-first-run)
- [๐Ÿ“– Usage](#-usage)
- [๐Ÿ—๏ธ Architecture](#-architecture)
- [๐Ÿง  Knowledge Base](#-knowledge-base)
- [๐Ÿ›ก๏ธ Safety Features](#-safety-features)
- [๐Ÿ“Š Supported Models](#-supported-models)
- [โš™๏ธ Configuration](#-configuration)
- [๐Ÿงช Testing](#-testing)
- [โš ๏ธ Limitations](#-limitations)
- [๐Ÿค Contributing](#-contributing)
- [๐Ÿ“„ License](#-license)

---

## About

ARIA is a terminal-native AI assistant designed specifically for Termux and Android development workflows. It combines Google's Gemma 4 models with a Termux-focused knowledge base, command system, and[...]

### Why ARIA?

Unlike generic desktop-focused coding assistants, ARIA understands the unique constraints of Android-based development:

โš™๏ธ **Clang** instead of GCC
๐Ÿ—‚๏ธ **Android filesystem quirks**
๐Ÿ”’ **Proot/container environments**

๐Ÿ“ฑ **Mobile-only workflows**
๐Ÿšซ **Package and permission limitations**
๐Ÿ› **Termux-specific debugging patterns**

---

## โœจ Features

### ๐Ÿ’ป Advanced Terminal UI
- Slash Command Interface (`/ask`, `/fix`, `/models`, `/watch`)
- Rich syntax highlighting & formatting
- Animated startup sequences
- Color-coded output

### ๐Ÿค– Intelligent AI
- Dynamic Gemma model discovery
- Auto model switching
- Self-healing API layer
- Graceful fallback handling

### ๐Ÿ›ก๏ธ Safety First
- Risk scoring system
- Confirmation prompts for dangerous operations
- Guardian safety layer
- Multi-level command validation

### ๐Ÿ“š Knowledge Base
- Common Termux errors
- Package management tips
- Python environments
- Proot-distro setup
- Android bridge tools

### ๐Ÿ“‹ Additional Features
- **Clipboard Integration**: Copy commands with one keystroke
- **Watch Mode**: Auto-detect and analyze terminal errors
- **Offline Support**: Works without internet for KB queries

---

## ๐Ÿ“ธ Screenshots

๐Ÿ“ฑ Click to expand screenshot gallery

### Startup Interface
Startup Screen

### Model Selection
Model Selection

### Error Analysis
Error Analysis

---

## ๐ŸŽฌ Demo

https://github.com/user-attachments/assets/0bdec9c0-fd24-4844-8c09-aea0cd376e34

---

## ๐Ÿš€ Quick Start

### Prerequisites
- Termux app on Android
- Python 3.8+
- Internet connection (for AI features)

### Installation

```bash
# Update system packages
pkg update && pkg upgrade -y

# Install required tools
pkg install python git -y
pkg install termux-api -y

# Clone and install ARIA
git clone https://github.com/Alex72-py/aria-termux.git
cd aria-termux

# Install Python dependencies
pip install -r requirements.txt

# Launch ARIA
python run_aria.py
```

> ๐Ÿ’ก **Tip:** `termux-api` is optional but recommended for clipboard integration. ARIA will gracefully fall back without it.

---

## ๐Ÿ”‘ First Run

ARIA launches an interactive configuration wizard on first startup:

```
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘ Welcome to ARIA Configuration Wizard โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Enter Google AI Studio API key: โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข
Enter preferred model: gemma-4-31b-it
Enable Guardian mode? [y/n]: y
Enable watch mode? [y/n]: n
```

**Get your free API key here:**
๐Ÿ”— [Google AI Studio](https://aistudio.google.com/app/apikey)

---

## ๐Ÿ“– Usage

### Command Reference

CommandDescriptionExample

/ask
Ask ARIA any question about Termux or development
/ask How do I install Python on Termux?

/fix
Analyze and fix terminal errors
/fix "clang: error: linker command failed"

/models
List all available Gemma models
/models

/kb
Search the offline knowledge base
/kb python module not found

/watch
Enable automatic error detection
/watch

---

## ๐Ÿ—๏ธ Architecture

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ ARIA Core System โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ ๐Ÿ“‹ Command System โ”‚
โ”‚ โ”œโ”€ /ask, /fix, /models, /kb, /watch โ”‚
โ”‚ โ”‚
โ”‚ ๐Ÿค– API Client โ”‚
โ”‚ โ”œโ”€ Auto Model Discovery โ”‚
โ”‚ โ”œโ”€ Intelligent Retry Logic โ”‚
โ”‚ โ””โ”€ Fallback Handling โ”‚
โ”‚ โ”‚
โ”‚ ๐Ÿ›ก๏ธ Guardian Safety Layer โ”‚
โ”‚ โ”œโ”€ Risk Assessment โ”‚
โ”‚ โ””โ”€ Confirmation Prompts โ”‚
โ”‚ โ”‚
โ”‚ ๐Ÿ‘€ Watch Mode โ”‚
โ”‚ โ”œโ”€ Error Detection โ”‚
โ”‚ โ””โ”€ Auto Analysis โ”‚
โ”‚ โ”‚
โ”‚ ๐Ÿ“š Offline Knowledge Base โ”‚
โ”‚ โ””โ”€ Termux Troubleshooting โ”‚
โ”‚ โ”‚
โ”‚ ๐ŸŽจ Rich Terminal UI โ”‚
โ”‚ โ”œโ”€ Syntax Highlighting โ”‚
โ”‚ โ”œโ”€ Animations โ”‚
โ”‚ โ””โ”€ Color-Coded Output โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

---

## ๐Ÿง  Knowledge Base

ARIA includes comprehensive offline knowledge covering:

| Category | Topics |
|----------|--------|
| ๐Ÿ› **Common Errors** | Package conflicts, permission issues, build errors |
| ๐Ÿ“ฆ **Package Management** | pkg, apt, pip installation & troubleshooting |
| ๐Ÿ **Python** | Virtual environments, venv, pip caching |
| ๐Ÿง **Proot-Distro** | Linux distributions, container setup |
| ๐Ÿ”Œ **Android Bridge** | Termux:API, Tasker integration, system access |
| ๐Ÿ” **Git & SSH** | SSH keys, Git configuration, GitHub access |
| ๐ŸŒ **Networking** | Port forwarding, localhost, DNS issues |

---

## ๐Ÿ›ก๏ธ Safety Features

### Guardian Safety Layer

ARIA analyzes potentially dangerous commands before execution with a comprehensive risk assessment system:

Risk Level
Color
Description
Action

๐ŸŸข Low
Green
Safe operations (listing, viewing)
Execute immediately

๐ŸŸก Medium
Yellow
Network/code operations
Execute with notice

๐ŸŸ  High
Orange
User/system modifications
Require confirmation

๐Ÿ”ด Critical
Red
Recursive deletion, destructive commands
Require explicit approval

---

## ๐Ÿ“Š Supported Models

ARIA supports the full lineup of Google Gemma 4 models:

```
Gemma 4 Model Family
โ”œโ”€โ”€ gemma-4-2b-it (Lightweight, 2B parameters)
โ”œโ”€โ”€ gemma-4-4b-it (Balanced, 4B parameters)
โ”œโ”€โ”€ gemma-4-26b-a4b-it (Advanced, 26B parameters)
โ””โ”€โ”€ gemma-4-31b-it (Expert, 31B parameters)
```

**Auto-discovery:** ARIA fetches available models from your API key automatically.

---

## โš™๏ธ Configuration

### Config File

Configuration is stored locally in:
```
~/.aria/config.json
```

Example structure:
```json
{
"api_key": "your-google-ai-studio-key",
"model": "gemma-4-31b-it",
"guardian_mode": true,
"watch_mode": false
}
```

### Environment Variables

Override config with environment variables:

```bash
export ARIA_API_KEY="your-key"
export ARIA_MODEL="gemma-4-31b-it"
export ARIA_GUARDIAN_MODE="true"
```

---

## ๐Ÿงช Testing

Run the test suite with pytest:

```bash
# Run all tests
python -m pytest tests/

# Run with verbose output
python -m pytest tests/ -v

# Run specific test file
python -m pytest tests/test_api.py
```

---

## โš ๏ธ Limitations

> **Development Status:** This is a hackathon submission. These limitations are planned for future releases.

- ๐Ÿ”„ Watch mode is experimental and may require manual review
- ๐ŸŒ Internet connection required for AI features (knowledge base works offline)
- ๐Ÿ“ฑ Optimized primarily for Termux on Android
- ๐Ÿค” Some auto-fix suggestions require manual verification
- ๐Ÿ“Š Transparent reasoning output shows intermediate model thinking

---

## ๐Ÿง  Transparent Reasoning

ARIA intentionally exposes intermediate reasoning during operations. This helps:

โœ… Debug prompt and model behavior
โœ… Inspect reasoning quality
โœ… Improve transparency during testing
โœ… Analyze response generation in real time

**Future releases** will include:
- Optional hidden reasoning mode
- Cleaner response streaming
- User-configurable verbosity levels
- Dedicated developer/debug modes

---

## ๐Ÿ“ฆ Dependencies

| Package | Purpose |
|---------|---------|
| `google-generativeai` | Google Gemma API client |
| `rich` | Rich terminal formatting & UI |
| `click` | CLI command interface |
| `pydantic` | Data validation & models |
| `python-dotenv` | Environment variable management |

See `requirements.txt` for versions and additional dependencies.

---

## ๐Ÿค Contributing

We welcome contributions! Here's how to get started:

```bash
# Create a feature branch
git checkout -b feature/my-feature

# Make your changes and commit
git add .
git commit -m "Add my feature"

# Push and create a pull request
git push origin feature/my-feature
```

**Guidelines:**
- Follow PEP 8 for Python code
- Add tests for new features
- Update documentation
- Keep commits focused and descriptive

---

## ๐Ÿ“„ License

This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.

```
MIT License

Copyright (c) 2026 Alex72-py

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
```

---

## ๐ŸŽฏ Hackathon Submission

**Submitted for:** Google Gemma 4 Challenge

### ๐Ÿ† Highlights

- ๐ŸŽฏ **Real-world Focus**: Actual Termux developer workflow optimization
- ๐Ÿ”„ **Dynamic Discovery**: Auto-detect and switch between available models
- ๐Ÿ›ก๏ธ **Resilient API**: Self-healing with intelligent retry logic
- ๐Ÿ“ฑ **Mobile-First**: Terminal UI optimized for small screens
- ๐Ÿ’พ **Offline Ready**: Fallback support without internet connection
- ๐Ÿ” **Safety-Conscious**: Risk assessment before executing commands

---

### ๐Ÿš€ ARIA

*Making Android terminal development faster, safer, and more usable.*

**[โฌ† back to top](#-aria--ai-terminal-co-pilot-for-termux)**

[![Stars](https://img.shields.io/github/stars/Alex72-py/aria-termux?style=social)](https://github.com/Alex72-py/aria-termux)
[![GitHub](https://img.shields.io/badge/GitHub-Alex72--py-181717?logo=github)](https://github.com/Alex72-py)