{ "title": "TUI (Terminal UI)", "content": "1. Start the Gateway.\n\n3. Type a message and press Enter.\n\nUse `--password` if your Gateway uses password auth.\n\n* Header: connection URL, current agent, current session.\n* Chat log: user messages, assistant replies, system notices, tool cards.\n* Status line: connection/run state (connecting, running, streaming, idle, error).\n* Footer: connection state + agent + session + model + think/verbose/reasoning + token counts + deliver.\n* Input: text editor with autocomplete.\n\n## Mental model: agents + sessions\n\n* Agents are unique slugs (e.g. `main`, `research`). The Gateway exposes the list.\n* Sessions belong to the current agent.\n* Session keys are stored as `agent::`.\n * If you type `/session main`, the TUI expands it to `agent::main`.\n * If you type `/session agent:other:main`, you switch to that agent session explicitly.\n* Session scope:\n * `per-sender` (default): each agent has many sessions.\n * `global`: the TUI always uses the `global` session (the picker may be empty).\n* The current agent + session are always visible in the footer.\n\n## Sending + delivery\n\n* Messages are sent to the Gateway; delivery to providers is off by default.\n* Turn delivery on:\n * `/deliver on`\n * or the Settings panel\n * or start with `openclaw tui --deliver`\n\n## Pickers + overlays\n\n* Model picker: list available models and set the session override.\n* Agent picker: choose a different agent.\n* Session picker: shows only sessions for the current agent.\n* Settings: toggle deliver, tool output expansion, and thinking visibility.\n\n## Keyboard shortcuts\n\n* Enter: send message\n* Esc: abort active run\n* Ctrl+C: clear input (press twice to exit)\n* Ctrl+D: exit\n* Ctrl+L: model picker\n* Ctrl+G: agent picker\n* Ctrl+P: session picker\n* Ctrl+O: toggle tool output expansion\n* Ctrl+T: toggle thinking visibility (reloads history)\n\n* `/help`\n* `/status`\n* `/agent ` (or `/agents`)\n* `/session ` (or `/sessions`)\n* `/model ` (or `/models`)\n\n* `/think `\n* `/verbose `\n* `/reasoning `\n* `/usage `\n* `/elevated ` (alias: `/elev`)\n* `/activation `\n* `/deliver `\n\n* `/new` or `/reset` (reset the session)\n* `/abort` (abort the active run)\n* `/settings`\n* `/exit`\n\nOther Gateway slash commands (for example, `/context`) are forwarded to the Gateway and shown as system output. See [Slash commands](/tools/slash-commands).\n\n## Local shell commands\n\n* Prefix a line with `!` to run a local shell command on the TUI host.\n* The TUI prompts once per session to allow local execution; declining keeps `!` disabled for the session.\n* Commands run in a fresh, non-interactive shell in the TUI working directory (no persistent `cd`/env).\n* A lone `!` is sent as a normal message; leading spaces do not trigger local exec.\n\n* Tool calls show as cards with args + results.\n* Ctrl+O toggles between collapsed/expanded views.\n* While tools run, partial updates stream into the same card.\n\n## History + streaming\n\n* On connect, the TUI loads the latest history (default 200 messages).\n* Streaming responses update in place until finalized.\n* The TUI also listens to agent tool events for richer tool cards.\n\n## Connection details\n\n* The TUI registers with the Gateway as `mode: \"tui\"`.\n* Reconnects show a system message; event gaps are surfaced in the log.\n\n* `--url `: Gateway WebSocket URL (defaults to config or `ws://127.0.0.1:`)\n* `--token `: Gateway token (if required)\n* `--password `: Gateway password (if required)\n* `--session `: Session key (default: `main`, or `global` when scope is global)\n* `--deliver`: Deliver assistant replies to the provider (default off)\n* `--thinking `: Override thinking level for sends\n* `--timeout-ms `: Agent timeout in ms (defaults to `agents.defaults.timeoutSeconds`)\n\nNote: when you set `--url`, the TUI does not fall back to config or environment credentials.\nPass `--token` or `--password` explicitly. Missing explicit credentials is an error.\n\nNo output after sending a message:\n\n* Run `/status` in the TUI to confirm the Gateway is connected and idle/busy.\n* Check the Gateway logs: `openclaw logs --follow`.\n* Confirm the agent can run: `openclaw status` and `openclaw models status`.\n* If you expect messages in a chat channel, enable delivery (`/deliver on` or `--deliver`).\n* `--history-limit `: History entries to load (default 200)\n\n* `disconnected`: ensure the Gateway is running and your `--url/--token/--password` are correct.\n* No agents in picker: check `openclaw agents list` and your routing config.\n* Empty session picker: you might be in global scope or have no sessions yet.", "code_samples": [ { "code": "2. Open the TUI.", "language": "unknown" }, { "code": "3. Type a message and press Enter.\n\nRemote Gateway:", "language": "unknown" } ], "headings": [ { "level": "h2", "text": "Quick start", "id": "quick-start" }, { "level": "h2", "text": "What you see", "id": "what-you-see" }, { "level": "h2", "text": "Mental model: agents + sessions", "id": "mental-model:-agents-+-sessions" }, { "level": "h2", "text": "Sending + delivery", "id": "sending-+-delivery" }, { "level": "h2", "text": "Pickers + overlays", "id": "pickers-+-overlays" }, { "level": "h2", "text": "Keyboard shortcuts", "id": "keyboard-shortcuts" }, { "level": "h2", "text": "Slash commands", "id": "slash-commands" }, { "level": "h2", "text": "Local shell commands", "id": "local-shell-commands" }, { "level": "h2", "text": "Tool output", "id": "tool-output" }, { "level": "h2", "text": "History + streaming", "id": "history-+-streaming" }, { "level": "h2", "text": "Connection details", "id": "connection-details" }, { "level": "h2", "text": "Options", "id": "options" }, { "level": "h2", "text": "Troubleshooting", "id": "troubleshooting" }, { "level": "h2", "text": "Troubleshooting", "id": "troubleshooting" } ], "url": "llms-txt#tui-(terminal-ui)", "links": [] }