# Terminal User Interface (TUI)
A Terminal User Interface (TUI) is a text-based user interface that runs within a terminal or console. Unlike [[Command Line Interface (CLI)]] that rely solely on text commands and output, TUIs provide interactive elements like menus, windows, forms, and visual feedback using text characters and ANSI escape codes.
TUIs bridge the gap between simple CLIs and graphical user interfaces (GUIs). They offer richer interaction than plain text while remaining lightweight and accessible over remote connections like SSH.
## Key Characteristics
- **Text-based rendering**: Uses characters, box-drawing symbols, and colors instead of pixels
- **Keyboard-driven**: Navigation typically via arrow keys, vim bindings, or keyboard shortcuts
- **Low resource usage**: Runs in any terminal without requiring a display server
- **Remote-friendly**: Works seamlessly over SSH and in headless environments
- **Cross-platform**: Functions consistently across operating systems
## Common Elements
- Menus and navigation bars
- Split panes and windows
- Forms and input fields
- Progress bars and status indicators
- Tables and lists
- Scrollable content areas
## Popular TUI Frameworks
- **ncurses**: The classic C library for Unix-like systems
- **Bubble Tea**: Modern Go framework using The Elm Architecture
- **Textual**: Python framework for rich terminal applications
- **Ratatui**: Rust library for building terminal interfaces
- **blessed**: Node.js curses-like library
- **Rich**: Python library for rich text and formatting
## Examples of TUI Applications
- **htop/btop**: System monitoring
- **Midnight Commander (mc)**: File management
- **lazygit**: Git interface
- **vim/neovim**: Text editing
- **tmux**: Terminal multiplexing
- [[Beads Viewer]]: Issue tracking visualization
## References
- https://en.wikipedia.org/wiki/Text-based_user_interface
## Related
- [[Command Line Interface (CLI)]]
- [[Graphical User Interface (GUI)]]
- [[TMux]]
- [[Beads Viewer]]
- [[Ralph TUI]]
- [[Shell]]