TUI
The@tui decorator wraps a @llm_chat agent into a full Textual terminal UI with streaming output, tool visualization, and input handling.
Basic Usage
Features
- Streaming display — Model responses appear character-by-character
- Tool call cards — Each tool call gets a visual card showing name, arguments, and result
- Specialized cards —
execute_code,read_file,grep,sed,echo_intohave custom rendering - Abort —
Ctrl+Ccancels the current response - Copy —
Ctrl+Ycopies the full transcript to clipboard - Multi-column forks — When using SelfRef forks, child agents get their own columns
Slash Commands
Custom Event Hooks
Handle custom events (e.g., PyRepl streaming output) with hooks:Decorator Parameters
ToolRenderSnapshot
Passed to event hooks with context about the current tool card:Keyboard Shortcuts
When to Use @tui vs Custom UI
Use@tui when:
- You want a working chat interface quickly
- The built-in tool cards are sufficient
- You don’t need custom widgets or layouts
- You need confirmation modals for dangerous actions
- You want a status bar with custom metrics
- You need non-chat UI elements (file trees, progress bars)
- You’re building a product, not a tool
ReactOutput stream directly and render with Textual or any other framework.