Skip to content

About

A clean-room, Android-native AI coding agent inspired by OpenCode. Open code projects on your device, chat with an AI agent that understands your repository, review proposed changes as diffs, and apply them safely.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

Koda Dev Banner

Koda Dev Icon

Koda Dev

Android-Native Self-Hosting AI Coding Agent & Full Linux Development Environment

Latest Release License Android Support Ubuntu in PRoot Tests Passed Kotlin Koda Obsidian

Download APK (v1.0.0) • Screenshots • Key Features • Self-Hosting • Architecture • Build & Run


📱 Screenshots & UI Tour

Autonomous Agent Chat
Multi-turn tool calling, git control, and real-time execution cards

Autonomous AI Chat
Native Ubuntu 24.04 Terminal
Full glibc Linux in PRoot, 24-bit truecolor, multi-session tabs, and programmer keyboard

Ubuntu Terminal in PRoot
Antiroute Tunnel & QR Scanner
Zero-config local model pairing via camera scanning, and E2EE cloud sync

Settings & Antiroute Tunnel

⚡ The On-Device Self-Hosting Milestone

Koda Dev is a self-hosting development platform. It doesn't just run on Android—it builds itself on Android:

 ┌────────────────────────────────────────────────────────────────────────┐
 │                      On-Device Compilation Flow                        │
 │                                                                        │
 │  Android Phone (ARM64) ──> Ubuntu 24.04 PRoot ──> OpenJDK 21          │
 │                                                         │              │
 │  app-debug.apk (35MB) <── D8/R8 <── kotlinc <── Bundled ARM64 AAPT2   │
 └────────────────────────────────────────────────────────────────────────┘
  1. Native ARM64 AAPT2 Integration: Android Gradle Plugin (AGP) normally downloads x86_64 AAPT2 binaries from Google Maven, resulting in Exec format error on ARM64 hardware. Koda Dev bundles a native ARM64 AAPT2 binary (Platform Tools 37.0.0) and dynamically overrides AGP via System.setProperty("android.aapt2FromMavenOverride", ...).
  2. On-Device Proof: On a physical Realme 8i (ARM64-v8a, 4GB RAM), Koda Dev pulled its own git commits, compiled its resources, ran its Gradle tasks, and built its own signed 35MB production APK directly on-device.

🚀 Key Features

🤖 Autonomous Coding Agent

  • Unbounded Multi-Turn Execution: The agent autonomously loops through tool calls—reading files, searching code, proposing edits, and running commands—without artificial iteration caps.
  • Background Task Manager (manage_task): Agent manages long-running commands (dev servers, test runners, builds) in the background with list, status, kill, and send_input controls, protected by a reactive stall watchdog and a 5-task concurrency ceiling.
  • Safety-Bounded File Reading: 800-line pagination limit, 45 KB byte limit, and 100 MB max file size safeguards prevent LLM context blowups while giving the agent explicit next-page guidance.
  • Diff Review System: Every proposed code modification is presented as a colored side-by-side / unified diff for manual approval or rejection before anything touches disk.

🐧 Real Linux Terminal (Ubuntu 24.04 PRoot)

  • Standard glibc Linux Userland: Runs Ubuntu 24.04 LTS (Noble) inside PRoot without root access or Android API 29+ W^X SELinux restrictions.
  • Real Package Manager (apt): Install real compilers and tools: build-essential, gcc, g++, make, python3, openjdk-21-jdk, nodejs, rustc, vim, git.
  • Termux Terminal Engine: VT100 / ANSI terminal emulator with 24-bit truecolor, alternate screen buffers (vim, nano, TUIs), dynamic font scaling (9–28 sp), pinch-to-zoom, and multi-session tabs.
  • Mobile Programmer Keyboard: Accessory bar with dedicated ESC, TAB, CTRL, CTRL-C, arrow keys (↑, ↓, ←, →), and quick bash tokens.

🌐 Antiroute Tunnel & Web Intelligence

  • Antiroute Tunnel Provider: Built-in 1-tap CameraX QR code scanner to instantly connect to local/remote Antiroute LLM tunnels without typing keys or URLs.
  • Multi-Provider & Live Model Discovery: Switch between OpenAI, Anthropic, OpenRouter, DeepSeek, Ollama, and custom proxies with dynamic /models queries.
  • Agent Web Intelligence: Jsoup-powered web_search and fetch_web_page tools allow the agent to look up real-time documentation and debugging solutions.

🎨 Koda Obsidian Theme & Typography

  • Obsidian Dark Palette: High-contrast dark IDE interface (#0B0F19, #111726, #161E31, #238636 accent) engineered for low eye strain.
  • JetBrains Mono Typography: First-class monospace developer typography across all editor, terminal, chat, and status surfaces.

🔐 Zero-Knowledge Cloud Sync ($0 Infrastructure)

  • End-to-End Encryption: Synchronize API keys, provider configurations, and settings cross-device via hidden GitHub Gists.
  • Client-Side AES-256-GCM + PBKDF2: Encrypted using passphrases derived with 100,000 iterations—no third-party servers or subscriptions.
  • 1-Tap GitHub Browser OAuth: Seamless authentication via OAuth Device Authorization Flow in your default web browser.

🏗️ Architecture

┌──────────────────────────────────────────────────────────────────┐
│                             app                                  │
│         MainActivity · AppNavHost · AppModule (DI)               │
├────────────┬────────────┬────────────┬────────────┬──────────────┤
│  feature/  │  feature/  │  feature/  │  feature/  │  feature/    │
│  projects  │   chat     │   editor   │  terminal  │  settings    │
├────────────┴────────────┴────────────┴────────────┴──────────────┤
│ core/agent  core/terminal  core/git   core/ai   core/files       │
│ AgentOrch.  TermuxSession  CliGitOps  AiProv.   File FS          │
│ ToolExec.   PosixExecutor  Git CLI    SSE/Fetch PathSafe / Diff  │
│ TaskManager PRoot Userland W^X Pream. ModelFetch                 │
├───────────────────────────────────────┬──────────────────────────┤
│              core/data                │         core/ui          │
│   Room DB · EncryptedKeyStore         │    Theme · MarkdownView  │
│   CloudSyncManager · VaultCrypto      │    Obsidian · JBMono     │
│   GitHubGistSyncClient · SyncAccount  │                          │
├───────────────────────────────────────┴──────────────────────────┤
│                           core/model                             │
│              Project · Session · Message · Tools                 │
└──────────────────────────────────────────────────────────────────┘

Module Breakdown

Module Responsibility
app Navigation (AppNavHost), Hilt application entry point, dependency injection bindings
feature/projects Directory browser, project creation, recent workspaces
feature/chat AI chat interface with streaming text deltas, tool-call event chips, active background task pills, diff banners
feature/editor Responsive split view / full-screen code viewer, compact file search bar, breadcrumbs, terminal shortcut
feature/terminal Dedicated Linux terminal screen, Termux TerminalView canvas, soft keyboard toggle, accessory bar
feature/settings Multi-provider manager (OpenAI, Anthropic, Antiroute QR scanner), live dynamic model discovery, Zero-Knowledge E2EE cloud sync, web search toggle
core/model Domain entities (Project, Session, Message, PendingChange, ToolSpec, PopularProviders)
core/ai AiProvider interface, OpenAI-compatible SSE streaming, dynamic ModelFetcher
core/agent Unbounded AgentOrchestrator loop, TaskManager (background concurrency & stall watchdog), ToolExecutor, ToolRegistry, EditResolver
core/terminal TermuxSessionManager (PTY & Termux bridge), UbuntuBootstrapManager & AlpineBootstrapManager (PRoot), PosixTerminalExecutor
core/git Native CLI Git operations (CliGitOperations), repository status, branch tracking
core/files Direct file filesystem (FileProjectFileSystem), path safety guards, diff engine
core/data Room database, VaultCrypto (AES-256-GCM + PBKDF2), CloudSyncManager, GitHubGistSyncClient, SyncAccountStorage
core/ui Koda Obsidian theme, JetBrains Mono monospace styling, Markdown rendering composable

🛠️ Build & Run

Prerequisites

Tool Version Install Guide
JDK 21 (Temurin) sdk install java 21.0.12-tem
Android SDK API 36+ Android Studio SDK Manager
Gradle 9.7+ ./gradlew wrapper bundled

Build Options

# Using build helper script:
./build.sh                  # Build debug APK
./build.sh --release        # Build release APK (35 MB)
./build.sh --bundle         # Build Android App Bundle (AAB)
./build.sh --clean          # Clean and rebuild

# Or directly via gradlew:
export JAVA_HOME=~/.local/opt/jdk-21
./gradlew assembleRelease

Release APK output: app/build/outputs/apk/release/app-release-unsigned.apk (or signed koda-dev-v1.0.0.apk).

Run Unit Tests

# Run all 176 unit tests across all 9 modules:
./test.sh

# Run specific module or test class:
./test.sh -m core:agent
./test.sh -c ToolExecutorTest --report

On-Device Self-Build (Android Smartphone)

Koda Dev can build itself inside its own Ubuntu terminal on an ARM64 Android device:

# Inside Koda Dev Ubuntu terminal:
./build.sh --release

Bundled ARM64 AAPT2 and Gradle memory configurations (-Xmx1536m) are automatically configured.

Install on Device

# Install directly via ADB:
./install.sh --adb --launch

# Or start a local Wi-Fi server with a terminal QR code to scan with your phone camera:
./install.sh --qr

📋 Milestones & Roadmap

  • v1.0.0 Core Scaffold & Multi-Module Architecture
  • Full Device Storage Access (MANAGE_EXTERNAL_STORAGE)
  • Autonomous Tool-Calling Agent Loop (Unbounded with Safety Pagination)
  • Terminal Engine & Ubuntu 24.04 LTS (Noble) PRoot Userland
  • ARM64 AAPT2 Integration & On-Device Self-Hosting
  • Autonomous Background Task Engine (manage_task) & Stall Watchdog
  • Antiroute Tunnel Provider & CameraX QR Code Scanner
  • Agent Web Intelligence (Jsoup Search & Web Scraping)
  • Zero-Knowledge E2EE Cloud Sync via Secret GitHub Gists
  • Koda Obsidian Design System & JetBrains Mono Typography
  • Integrated Dev Server & In-App Web Preview
  • Visual Git Studio & 3-Way Merge Conflict Resolver
  • Adaptive Multi-Pane IDE for Foldables, Tablets & Samsung DeX
  • Language Server Protocol (LSP) Engine in PRoot

📄 License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0).

About

A clean-room, Android-native AI coding agent inspired by OpenCode. Open code projects on your device, chat with an AI agent that understands your repository, review proposed changes as diffs, and apply them safely.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages