?

Overview

rousseau chat opens a Bubble Tea TUI with three regions:

+------------------------------------------------------+
|                       Header                         |  session title
+------------------------------------------------------+
|                                                      |
|                                                      |
|                     Viewport                         |  scrollable history
|          (messages, streamed reply preview)          |
|                                                      |
|                                                      |
+------------------------------------------------------+
|                     Textarea                         |  input, Enter to send
+------------------------------------------------------+
| status: idle | spinner | streaming | error           |
+------------------------------------------------------+

Runs in Bubble Tea's alt-screen mode — the TUI takes over the terminal buffer and restores it on exit.

Keybindings

Rousseau's TUI keeps the binding set small. When in doubt, standard Bubble Tea viewport / textarea shortcuts apply.

Global

Key Action
Ctrl+C Quit. Saves the current session, prints nothing on the way out.
Esc Quit. Same as Ctrl+C.
Enter Send the current textarea contents. No-op while the agent is busy.

Textarea (input)

Standard Bubble Tea textarea behaviour:

Key Action
Any printable character Insert at cursor.
Backspace Delete character before cursor.
Delete Delete character under cursor.
Arrow keys Move cursor.
Home / End Jump to line start / end.
Ctrl+A / Ctrl+E Jump to line start / end (Emacs bindings).
Ctrl+U Kill to line start.
Ctrl+K Kill to line end.
Shift+Enter (Terminal-dependent) newline without submitting; often mapped as literal \n.

The textarea grows vertically as content wraps; the viewport shrinks to accommodate.

Viewport (history)

The viewport supports the usual Bubble Tea viewport shortcuts. Focus is on the viewport when the textarea is empty; typing routes to the textarea automatically.

Key Action
PgUp / PgDn Scroll one page.
/ Scroll one line.
Home / End Jump to top / bottom.
Mouse wheel Scroll.

Panel semantics

Header

rousseau · <session title>. The title comes from --title when the session was created (default: chat YYYY-MM-DD HH:MM).

Viewport

Rendered history plus, while a turn is in-flight, a streaming preview at the bottom. The preview reflects deltas as the provider streams; when the turn finishes, the preview is replaced by the final assistant message.

Every message is prefixed by its role (you, rousseau, tool) so the flow is unambiguous when the model requests a tool call.

Textarea

Placeholder text: Ask, or press Ctrl+C to quit…. Enter submits; the textarea resets on submit.

While the agent is busy, Enter is a no-op so accidental double-submits don't stack turns.

Status line

Underneath the textarea. Content varies:

State Line
Idle Empty.
Busy Spinner + thinking…. Spinner ticks come from bubbles/spinner.
Streaming Spinner continues; the streaming delta appears in the viewport preview.
Error Error string in red. The next successful turn clears it.

Session persistence

Every turn is persisted to ~/.local/share/rousseau/sessions.db via state.Store.Save. If the daemon crashes mid-turn:

  • The user turn is already saved (it was appended before doTurn fires).
  • The assistant reply is only saved once the turn completes.

On restart, rousseau chat --session <id> resumes from the last successfully saved state.

Session commands from the CLI

The TUI does not surface every session operation. Manage sessions from a shell:

rousseau session list
rousseau session show <id>
rousseau session search "kubectl"
rousseau session delete <id>

Streaming semantics

Providers that implement StreamingProvider.ChatStream (Anthropic, claudecli) stream deltas into the viewport preview. Providers that only implement Provider.Chat (Bedrock, Vertex, OpenAI-compatible depending on shim) deliver the reply as a single block on turn completion — the preview stays empty and the reply appears when busy becomes false.

When things go wrong

  • The TUI hangsCtrl+C twice. The first Ctrl+C signals tea.Quit, which flushes state. The second is captured by the OS.
  • The viewport is empty and the textarea won't accept input — the alt-screen may have been corrupted by an escape-sequence-emitting subprocess (e.g. a tool call that prints ANSI codes). Restart the TUI.
  • The status line stays on thinking… — the provider hasn't returned. Check the daemon's stderr (rousseau writes slog to stderr; if you piped it away, resurface it).

Next

Type to search 150+ pages. Ranking: BM25 with title/description boost.