Why Use the TUI?
The TUI is the fastest way to:- Monitor multiple rooms - Watch participant status and LLM request activity across rooms
- Manage the hub - Start and stop the local hub server with a simple interface
- Create and join rooms - Quickly create rooms or join as an LLM participant
- Real-time updates - See participants join/leave and track LLM requests as they happen
- Keyboard-driven workflow - Navigate and control everything without touching the mouse
Launching the TUI
The TUI launches automatically when you run the CLI without arguments in a TTY:apps/tui directory:
The TUI connects to
http://localhost:3000 by default. Make sure to start a hub first if you want to monitor existing rooms.Tech Stack
The TUI is built with modern technologies optimized for terminal applications:| Layer | Technology | Purpose |
|---|---|---|
| UI Framework | OpenTUI (@opentui/react) | React reconciler for terminal rendering with flexbox layout |
| Server State | TanStack Query | API calls, automatic caching, and background refetch |
| Client State | Zustand | Navigation history, hub URL, and session management |
| Real-time | SSE (Server-Sent Events) | Live updates for participant and room events |
| Validation | Zod | Type-safe API response and SSE event validation |
Main Features
Hub Management
Start and stop the local Gambiarra hub server directly from the TUI. Configure the port, hostname, and enable mDNS discovery for automatic network detection.Room Operations
- Create rooms - Generate new rooms with optional password protection
- List rooms - Browse all available rooms on the hub
- Join as participant - Share your LLM endpoint with a room
- Monitor activity - Watch real-time participant status and request logs
Multi-Room Monitoring
The monitor screen is the heart of the TUI:- Track multiple rooms simultaneously with tabbed interface
- See participant online/offline/busy status with visual indicators
- View live activity log showing joins, leaves, and LLM requests
- Expand participant cards to see detailed specs and performance metrics
- Auto-refresh room state via Server-Sent Events
Participant Session
When you join a room as a participant:- Health checks run automatically in the background (every 10s)
- Your participant badge appears in the header showing health status
- Monitor screen highlights your own participant card
- Leave the room with a single keypress
Navigation
Screen-based routing with history stack:- Use
Escapeto go back through your navigation history - Global shortcuts (
h,c,j,l,m) jump to any screen instantly - Footer shows contextual keyboard shortcuts for current screen
Architecture
The TUI follows a clean architecture with clear separation of concerns:State Management Strategy
Server State (TanStack Query) - Data from the hub API:- Room lists and participant data
- Health checks and machine specs
- Automatic caching and background refetch
- Navigation history and current screen
- Hub URL and connection settings
- Participant session status
- Form inputs and focus management
- UI toggles and modals
Real-Time Updates
SSE events keep room data in sync:participant:joined/participant:left- Update participant listsparticipant:offline- Mark participants that miss heartbeatsllm:request/llm:complete/llm:error- Track LLM request lifecycleroom:created- Update room metadata
Design System
The TUI uses a consistent color palette defined intypes.ts:
| Color | Usage |
|---|---|
Cyan (#00FFFF) | Headers, focused elements, primary actions |
Green (#00FF00) | Online status, success messages, confirmations |
Orange (#FFAA00) | Busy/processing state, warnings |
Red (#FF5555) | Offline status, errors |
Pink (#FF79C6) | Performance metrics, accents |
Gray (#666666) | Secondary text, muted elements |
●Online (green)◐Busy/processing (orange)○Offline (gray)✓Complete (green)✗Error (red)
Next Steps
Screens
Learn about each screen and how to navigate between them
Keyboard Shortcuts
Master all keyboard shortcuts for efficient workflow