Skip to content

TUI Reference

Crucible’s Terminal User Interface (TUI) provides an interactive chat experience with streaming responses, tool call visualization, and modal interactions.

The TUI uses the Oil renderer — a React-like immediate-mode UI with flexbox layout (taffy):

  • ChatApp - Main application state and event handling
  • InputBox - Text input with cursor
  • StatusBar - Mode indicator, status, model info
  • MessageList - Conversation history with markdown rendering
  • Popup - Command/file/agent autocomplete

The UI renders in three layers:

  1. Base - Main conversation view (history + input + status)
  2. Popup - Autocomplete overlays
  3. Modal - Dialog boxes (capture all input)

Events propagate top-down through layers:

  • Modal dialogs capture all events
  • Popups receive events when focused
  • Base layer handles remaining events

Three session modes control agent permissions (see Modes):

  • Normal - Auto-read, ask for writes (default)
  • Plan - Read-only, creates plan files
  • Auto - Full access, minimal prompts

Toggle with Shift+Tab.

The TUI status bar is driven by Lua configuration. Define your own layout with cru.statusline.setup() — choose which components appear (mode badge, model name, context usage, notifications) and style them with colors and formatting. If no Lua config is present, the TUI uses a sensible default layout.

See Configuration for the full statusline API and examples.

Quick reference (see Keybindings for complete list):

KeyAction
EnterSend message / confirm
Ctrl+CCancel (double to exit)
Shift+TabCycle mode
Alt+TToggle reasoning panel
Alt+MToggle mouse capture
/Open command popup
@Open file/agent popup
[[Open notes popup
!Execute shell command
EscDismiss popup/dialog

Readline-style editing (Ctrl+A/E/W/U/K, Alt+B/F) is supported in the input box.

For developers contributing to the TUI, see E2E Testing for information on the expectrl-based test harness that enables PTY-based end-to-end testing.

The TUI supports vim-style : commands for runtime configuration:

CommandDescription
:set option=valueSet configuration option
:set option?Query current value
:set option!Toggle boolean option
:modelOpen model picker popup
:model <name>Switch to specific model
:quit / :qExit chat
:helpShow help

See Commands for the complete command reference.