# AIZU-CLI — Overview

## Apa itu AIZU-CLI?

AIZU-CLI adalah AI Agent yang berjalan langsung di terminal (Termux di Android, Linux, macOS, Windows). Dikembangkan oleh **Ardhana Aizu**, tool ini dibuat sebagai alternatif open-source dari Claude Code dengan fitur lengkap dan zero external dependencies.

## Informasi Dasar

| Item | Detail |
|------|--------|
| **Nama** | AIZU-CLI |
| **Versi** | 2.1.202 |
| **Author** | Ardhana Aizu |
| **GitHub** | https://github.com/ardhanaaizu/AIZU-CLI |
| **Website** | https://cli.aaizu.id |
| **Knowledge Base** | https://cli.aaizu.id/knowledge/ |
| **Bahasa** | Python 3 (tanpa dependency eksternal) |
| **Platform** | Termux (Android), Linux, macOS, Windows |
| **Total Kode** | ~13,500+ baris (12 file Python) |

## Arsitektur

```
AIZU-CLI/
├── agent.py          ← Main entry, chat loop, LLM calls, slash commands (~2,900 lines)
├── tui.py            ← Responsive TUI, ClaudeStyleTUI, streaming (~2,100 lines)
├── tools.py          ← 35+ tools, ToolCache, parallel execution (~1,500 lines)
├── plugins.py        ← Plugin system, hot-reload, sandboxing (~1,400 lines)
├── memory.py         ← Smart recall (TF-IDF), dedup, auto-extract (~1,050 lines)
├── mcp_bridge.py     ← MCP bridge, Windows support, SSE auto-reconnect (~930 lines)
├── workflow.py       ← Workflow persistence, background runner (~580 lines)
├── user_data.py      ← Profil user management (~530 lines) ← NEW
├── generate_surat.py ← PDF surat lamaran generator (~460 lines) ← NEW
├── scheduler.py      ← Cron-based task scheduling (~460 lines)
├── tasks.py          ← Task management (~330 lines)
├── skills.py         ← Reusable prompt templates (~330 lines)
└── plugins/          ← 9 included plugins
```

## Perbedaan dengan Claude Code

| Aspek | AIZU-CLI | Claude Code |
|-------|----------|-------------|
| **Harga** | Gratis | Berbayar |
| **Backend** | Multi-backend (Groq, OpenAI, dll) | Claude API only |
| **Platform** | Termux, Linux, macOS, Windows | Semua platform |
| **Dependency** | Python standard only | Node.js |
| **Open Source** | Ya (MIT License) | Partial |
| **Streaming** | ✅ Real-time | ✅ |
| **Context Compression** | ✅ | ✅ |
| **Plugin System** | ✅ (4 tipe + sandbox) | ✅ |
| **Sub-agents** | ✅ (dengan worktree) | ✅ |
| **Memory System** | ✅ (smart recall TF-IDF) | ✅ |
| **Tool Cache** | ✅ (TTL + LRU) | ✅ |
| **User Data** | ✅ (profil management) | ❌ |

## Fitur Utama

- 🌐 **Multi-backend** — Groq, OpenAI, Gemini, OpenRouter, Ollama, Custom
- 🛠️ **35+ Tools** — File, Web, Git, Shell, Calculator, Memory, GitHub
- 🔌 **Plugin System** — 4 tipe + hot-reload + sandboxing
- 🤖 **Sub-agents** — Explore, code-reviewer, implementer + background agents
- 🧠 **Smart Memory** — TF-IDF recall, dedup, garbage collect, auto-extract
- 📋 **Skills** — 7 built-in templates
- ⏰ **Scheduler** — Cron-based task scheduling
- 📌 **Task Management** — CRUD dengan dependencies
- ⚡ **Workflow** — Pipeline, parallel, persistence, background runner
- 🌉 **MCP Bridge** — stdio + SSE, Windows support, auto-reconnect
- 🎭 **7 Mode** — chat, code, ringkas, shell, detail, git, belajar
- 📊 **Token Usage** — Real-time + cost estimation (USD & IDR)
- 🗜️ **Context Compression** — Smart strategy (TF-IDF + importance scoring)
- 💾 **Session** — Save & resume percakapan
- 🔐 **Permission System** — 3 opsi: sekali, selalu, tolak
- 🎨 **Responsive TUI** — 3-region layout, Claude Code style
- 👤 **User Data** — Profil, pendidikan, pengalaman, keahlian, sertifikat, dokumen
- 📄 **PDF Generator** — Surat lamaran kerja otomatis
- 📱 **Telegram Bridge** — Kirim PDF ke Telegram via bot

## Update Terbaru (Juli 2026)

### v2.1.202 — 18 Juli 2026 (Streaming Stability Fix)
- **Fix streaming 400**: `sanitize_messages()` jaga hanya 1 system role, merge consecutive user, fix empty `tool_call_id`, hapus orphan tool results
- **Fix compress**: `_build_tool_groups()` + `_smart_compress()` preserve tool_call/result atomic, cegah Groq 400 invalid_request
- **Fix SSE**: DONE flag handling, timeout raise (bukan silent break), id fallback timestamp, repair truncated JSON args
- **Fix memory**: recall inject sebagai user-wrapped di compressed copy saja, bukan system mutasi permanen
- **Fix loop detection**: pakai role user, bukan system
- **Observability**: full error log ke `/tmp/aizu_last_error.json`, warning length 200 bukan 60

### v2.1.0 — 06 Juli 2026 (Major Update, +4,611 baris)
- **TUI**: ResponsiveTUI + ClaudeStyleTUI (3-region layout, slash autocomplete 28+ commands)
- **Tools**: ToolCache (TTL 5 menit, LRU), parallel execution
- **Memory**: smart_recall() TF-IDF, deduplicate(), garbage_collect(), auto_extract()
- **Plugins**: Thread safety, hot-reload, sandboxing (blokir exec/eval/subprocess)
- **MCP**: Windows support, SSE auto-reconnect (exponential backoff)
- **Workflow**: WorkflowManager (persistence), BackgroundWorkflowRunner
- **New**: user_data.py (profil management), generate_surat.py (PDF generator), aizu.bat

### v2.0.0 — 03 Juli 2026
- Banner ASCII art baru (5 baris, cyan/teal)
- Visual refresh: header, separator, status bar
- Fix: duplikasi jawaban streaming
- Fix: handle_slash() pakai tui_print()

## Timeline

| Tanggal | Milestone |
|---------|-----------|
| 2024 | Rilis awal AIZU-CLI |
| 2025-07 | Rebranding, 17 tools, landing page |
| 2026-07-02 | v2.0.0: Plugin system, sub-agents, memory, skills, scheduler, tasks, workflow, MCP bridge |
| 2026-07-03 | Visual refresh, bug fixes, 35+ tools |
| 2026-07-06 | v2.1.0: Responsive TUI, smart memory, tool cache, user data, PDF generator |
| 2026-07-06 | v2.1.0+: Telegram bridge (kirim PDF ke Telegram) |
| 2026-07-18 | v2.1.202: Streaming stability — fix Groq 400, atomic tool groups, sanitize payload |
