Skip to main content
Version: 0.2.3

Terminal UI Overview

The TUI (Terminal User Interface) provides an interactive, visual interface for searching your indexed documents directly in the terminal.

Purpose

While the CLI is great for scripting and quick searches, the TUI offers:

FeatureBenefit
Visual feedbackSee results as you type
Keyboard navigationBrowse results without leaving the terminal
Persistent sessionSearch multiple queries without restarting
Rich formattingStyled output with colors and layout

Architecture Pattern

The TUI follows the Elm Architecture (Model-Update-View), which provides:

  • Predictable state management - All state changes flow through Update()
  • Testable components - Pure functions for rendering
  • Unidirectional data flow - Messages trigger updates, updates trigger views

Component Hierarchy

The TUI is organized into layers:

LayerPurpose
AppMain entry point, routes messages, manages views
ViewsCompose components into screens
ComponentsReusable UI elements (input, list, status)
FoundationStyles, keymaps, message types

Integration with Hexagonal Architecture

The TUI is a driving adapter that calls into the core via driving ports:

The TUI never imports core services directly—it only depends on port interfaces, maintaining architectural purity.

Next