@comma-agents/tui
TUI
Terminal-based user interface built with Ink (React for terminals) that connects to the daemon over WebSocket.
The @comma-agents/tui package provides a terminal-based user interface built with Ink (React for the terminal). It connects to the daemon over WebSocket to run and observe agent strategies.
Quick Start
# Start the daemon if needed and open the TUI
comma
# Auto-start with a strategy and initial input
comma --input "Build a calculator" --strategy build
# Custom daemon URL
comma --daemon-url ws://my-host:7422/ws
# Enable development tab
comma --devHow It Works
- The TUI opens a WebSocket to the daemon at
ws://localhost:7422/ws - You select a strategy and enter a prompt
- The TUI sends
prepare_run, thenstart_run, and receives streaming agent output, tool calls, thinking blocks, and status updates - When the agent needs input or sandbox permission, the TUI prompts you inline
- You can cycle between Chat and Logs tabs, open the command palette with Ctrl+P, or load persisted sessions
Key Areas
| Section | Description |
|---|---|
| Architecture | Provider tree, routing, data flow, keyboard shortcuts |
| WebSocket | Daemon communication -- message types, typed helpers, commands and subscriptions |
| Pages | Route-level pages -- IntroPage, ChatPage, LogsPage |
| Components | Ink component inventory -- input, chat, scrolling, overlays, layout |
| Hooks | Custom React hooks -- daemon, chat, logging, modal, mouse, breakpoint |
| Theme | Theming system -- tokens, defineTheme builder, built-in presets |
Provider Tree
The app renders a nested tree of context providers:
MemoryRouter
└─ UserConfigContextProvider (persisted user config)
└─ ThemeContextProvider (active theme injection)
└─ DaemonContextProvider (WebSocket to daemon)
└─ ChatSessionsContextProvider (chat session state)
└─ ModalContextProvider (modal stack)
└─ AppEach layer depends on the providers above it. Components consume state through hooks -- see the Hooks section for the full API.
Keyboard Shortcuts
| Key | Action |
|---|---|
| Ctrl+C | Exit the application |
| Ctrl+R | Reset the current chat session |
| Ctrl+P | Open the command palette |
| Alt+1 | Switch to Chat tab |
| Alt+2 | Switch to Logs tab |
| Meta+Enter | Submit input in the chat text area |