Terminal User Interface (TUI)¶
SuperQode includes a rich Terminal User Interface (TUI) for interactive QE sessions.
Features¶
- Rich Output: Colored, formatted terminal output
- Progress Tracking: Real-time progress indicators
- Interactive Prompts: User input with completion
- File Browser: Navigate project files
- Agent Switcher: Switch between QE roles
- Command Palette: Quick actions
- Status Bar: Session status at a glance
Launching the TUI¶
TUI Layout¶
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SuperQode - QE Session: qe-20260108-143052 รโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Sidebar โ Main Content Area โ
โ โ โ
โ โ Files โ Agent Output โ
โ โฏ Agents โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โฏ Findings โ โ
โ โฏ Artifacts โ Analyzing src/api/users.py... โ
โ โ โ
โ Files โ Found potential SQL injection at line 42 โ
โ โโโ src/ โ โ
โ โ โโโ api/ โ ```python โ
โ โ โโโ utils/ โ query = f"SELECT * FROM users WHERE id = {id}" โ
โ โโโ tests/ โ ``` โ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โK Command Palette โ Mode: Quick Scan โ Findings: 2 โ 00:45 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Key Bindings¶
| Key | Action |
|---|---|
Ctrl+K | Open command palette |
Ctrl+F | Toggle file browser |
Ctrl+A | Switch agent/role |
Ctrl+S | Save session |
Ctrl+Q | Quit |
Escape | Close modal/cancel |
Enter | Submit input |
Tab | Next widget |
Shift+Tab | Previous widget |
: | Command mode (for commands like :connect, :qe, etc.) |
Quick Actions¶
Access via Command Palette (Ctrl+K) or Command Mode (:) in TUI:
:connect- Connect to provider/agent:qe <role>- Switch to QE role mode (e.g.,:qe security_tester):view <file>- View file content:help- Show all available commands
Note: QE analysis sessions are run via CLI, not TUI commands. Use superqe run . in your terminal to start QE sessions.
Configuration¶
TUI configuration in superqode.yaml:
Widgets¶
Available Widgets¶
| Widget | Purpose |
|---|---|
Prompt | User input with completion |
FileBrowser | Navigate project files |
AgentSwitcher | Switch QE roles |
CommandPalette | Quick actions |
StatusBar | Session status |
Throbber | Loading indicator |
Toast | Notifications |
DiffView | Show file diffs |
FileViewer | View files with syntax highlighting |
Example Usage¶
from superqode.widgets import FileBrowser, AgentSwitcher
# File browser
browser = FileBrowser(root=project_root)
file = await browser.select_file()
# Agent switcher
roles = [
("qe.security_tester", "Security Testing"),
("qe.performance_tester", "Performance Testing"),
]
switcher = AgentSwitcher(roles)
selected = await switcher.select()
Integration with QE¶
The TUI allows you to interact with agents in QE roles, while QE analysis sessions are run separately via CLI:
# Start TUI
superqode
# In TUI, switch to QE role
:qe security_tester
# Run QE analysis via CLI (in separate terminal)
superqe run . --mode quick
superqe run . --mode deep
# View QE artifacts (via CLI)
superqe artifacts .
superqe dashboard
Requirements¶
The TUI requires:
Troubleshooting¶
TUI Not Starting¶
If the TUI fails to start:
-
Check Textual installation:
-
Verify terminal compatibility:
- Terminal must support ANSI escape codes
-
Recommended: iTerm2, Alacritty, Windows Terminal
-
Check terminal size:
- Minimum: 80x24
- Recommended: 120x40
Performance Issues¶
For slow TUI performance:
- Reduce terminal size
- Disable syntax highlighting
- Use quick mode instead of deep mode