Skip to main content
max tui opens an interactive terminal interface for chatting with Max. It connects to the running daemon at http://127.0.0.1:7777 via SSE (Server-Sent Events) and streams responses in real time with markdown rendering.
max tui
The daemon must be running before you open the TUI. Start it in a separate terminal with max start.

How it works

The TUI establishes a persistent SSE connection to the daemon’s /stream endpoint. When you type a message and press Enter:
  1. The message is POSTed to /message on the daemon.
  2. The daemon enqueues it to the orchestrator.
  3. Response tokens stream back over the SSE connection and are rendered inline.
Proactive messages (e.g. worker completions triggered by background tasks) arrive over the same SSE stream and are printed with a MAX label whenever the TUI is open.

Connection

By default the TUI connects to http://127.0.0.1:7777. Override this with:
MAX_API_URL=http://remote-host:7777 max tui
Authentication uses a Bearer token read from ~/.max/api-token and sent as an Authorization header on every request. If the daemon is not reachable, the TUI retries every 5 seconds:
    ✗ cannot connect to daemon
      start with: max start
Once connected it prints:
  ● max — connected

Slash commands

Type a slash command at the prompt to control the daemon or the TUI itself.
CommandDescription
/model [name]Show the current model, or switch to a named model
/autoToggle automatic model routing on or off
/memoryList all stored memories
/skillsList installed skills; enter a number to uninstall a local skill
/workersList active worker sessions with their status and working directory
/copyCopy the last response to the system clipboard
/statusPrint the daemon’s health check JSON
/restartRestart the daemon process in place
/clearClear the terminal screen
/helpPrint the command reference inside the TUI
/cancelCancel the current in-flight request
/quit or /exitExit the TUI

Switching models

/model
  model: claude-sonnet-4.6

/model gpt-4.1
  model: claude-sonnet-4.6 → gpt-4.1

Keyboard shortcuts

KeyAction
EscapeCancel the currently running response
Up / DownNavigate input history
Ctrl+CExit the TUI
Escape sends a /cancel request to the daemon and stops both streaming and the thinking indicator without exiting the TUI.

Real-time streaming

Responses stream token-by-token as they arrive. The TUI renders markdown to ANSI escape codes in real time:
  • Headings (#, ##, ###) are styled with bold/colour.
  • Bullet and numbered lists are formatted with indent markers.
  • Code blocks are surrounded by a dim border.
  • Inline code, bold, and strikethrough are rendered with ANSI formatting.
A Thinking... spinner is shown while the daemon processes the request before the first token arrives.

History persistence

Every message you send (non-command lines) is appended to ~/.max/tui_history. The history file is capped at 1,000 entries and trimmed automatically on exit. History is loaded into readline on startup so Up/Down navigation works across sessions.

Debug logging

Set MAX_TUI_DEBUG=1 to write a structured event log to ~/.max/tui-debug.log:
MAX_TUI_DEBUG=1 max tui
The log captures SSE lifecycle events, stream chunk details, and input rendering events as newline-delimited JSON.

Build docs developers (and LLMs) love