2026-01-09 01:01:17 +01:00
---
summary: "Terminal UI (TUI): connect to the Gateway from any machine"
read_when:
- You want a beginner-friendly walkthrough of the TUI
- You need the complete list of TUI features, commands, and shortcuts
2026-01-31 16:04:03 -05:00
title: "TUI"
2026-01-09 01:01:17 +01:00
---
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
# TUI (Terminal UI)
## Quick start
2026-01-31 21:13:13 +09:00
1. Start the Gateway.
2026-01-09 01:01:17 +01:00
```bash
2026-01-30 03:15:10 +01:00
openclaw gateway
2026-01-09 01:01:17 +01:00
```
2026-01-31 21:13:13 +09:00
2026-02-06 10:00:08 -05:00
2. Open the TUI.
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
```bash
2026-01-30 03:15:10 +01:00
openclaw tui
2026-01-09 01:01:17 +01:00
```
2026-01-31 21:13:13 +09:00
2026-02-06 10:00:08 -05:00
3. Type a message and press Enter.
2026-01-09 01:01:17 +01:00
Remote Gateway:
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
```bash
2026-01-30 03:15:10 +01:00
openclaw tui --url ws://< host > :< port > --token < gateway-token >
2026-01-09 01:01:17 +01:00
```
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
Use `--password` if your Gateway uses password auth.
## What you see
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
- Header: connection URL, current agent, current session.
- Chat log: user messages, assistant replies, system notices, tool cards.
- Status line: connection/run state (connecting, running, streaming, idle, error).
- Footer: connection state + agent + session + model + think/verbose/reasoning + token counts + deliver.
- Input: text editor with autocomplete.
## Mental model: agents + sessions
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
- Agents are unique slugs (e.g. `main` , `research` ). The Gateway exposes the list.
- Sessions belong to the current agent.
- Session keys are stored as `agent:<agentId>:<sessionKey>` .
- If you type `/session main` , the TUI expands it to `agent:<currentAgent>:main` .
- If you type `/session agent:other:main` , you switch to that agent session explicitly.
- Session scope:
- `per-sender` (default): each agent has many sessions.
- `global` : the TUI always uses the `global` session (the picker may be empty).
- The current agent + session are always visible in the footer.
## Sending + delivery
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
- Messages are sent to the Gateway; delivery to providers is off by default.
- Turn delivery on:
- `/deliver on`
- or the Settings panel
2026-01-30 03:15:10 +01:00
- or start with `openclaw tui --deliver`
2026-01-09 01:01:17 +01:00
## Pickers + overlays
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
- Model picker: list available models and set the session override.
- Agent picker: choose a different agent.
- Session picker: shows only sessions for the current agent.
- Settings: toggle deliver, tool output expansion, and thinking visibility.
## Keyboard shortcuts
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
- Enter: send message
- Esc: abort active run
- Ctrl+C: clear input (press twice to exit)
- Ctrl+D: exit
- Ctrl+L: model picker
- Ctrl+G: agent picker
- Ctrl+P: session picker
- Ctrl+O: toggle tool output expansion
- Ctrl+T: toggle thinking visibility (reloads history)
## Slash commands
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
Core:
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
- `/help`
- `/status`
- `/agent <id>` (or `/agents` )
- `/session <key>` (or `/sessions` )
- `/model <provider/model>` (or `/models` )
Session controls:
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
- `/think <off|minimal|low|medium|high>`
2026-01-17 05:33:27 +00:00
- `/verbose <on|full|off>`
2026-01-09 01:01:17 +01:00
- `/reasoning <on|off|stream>`
2026-01-18 05:35:22 +00:00
- `/usage <off|tokens|full>`
2026-01-22 05:32:13 +00:00
- `/elevated <on|off|ask|full>` (alias: `/elev` )
2026-01-09 01:01:17 +01:00
- `/activation <mention|always>`
- `/deliver <on|off>`
Session lifecycle:
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
- `/new` or `/reset` (reset the session)
- `/abort` (abort the active run)
- `/settings`
- `/exit`
2026-01-23 19:47:45 +00:00
Other Gateway slash commands (for example, `/context` ) are forwarded to the Gateway and shown as system output. See [Slash commands ](/tools/slash-commands ).
2026-01-22 23:38:44 +00:00
## Local shell commands
2026-01-31 21:13:13 +09:00
2026-01-22 23:38:44 +00:00
- Prefix a line with `!` to run a local shell command on the TUI host.
- The TUI prompts once per session to allow local execution; declining keeps `!` disabled for the session.
- Commands run in a fresh, non-interactive shell in the TUI working directory (no persistent `cd` /env).
- A lone `!` is sent as a normal message; leading spaces do not trigger local exec.
2026-01-09 01:01:17 +01:00
## Tool output
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
- Tool calls show as cards with args + results.
- Ctrl+O toggles between collapsed/expanded views.
- While tools run, partial updates stream into the same card.
## History + streaming
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
- On connect, the TUI loads the latest history (default 200 messages).
- Streaming responses update in place until finalized.
- The TUI also listens to agent tool events for richer tool cards.
## Connection details
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
- The TUI registers with the Gateway as `mode: "tui"` .
- Reconnects show a system message; event gaps are surfaced in the log.
## Options
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
- `--url <url>` : Gateway WebSocket URL (defaults to config or `ws://127.0.0.1:<port>` )
- `--token <token>` : Gateway token (if required)
- `--password <password>` : Gateway password (if required)
- `--session <key>` : Session key (default: `main` , or `global` when scope is global)
- `--deliver` : Deliver assistant replies to the provider (default off)
- `--thinking <level>` : Override thinking level for sends
2026-01-09 21:28:14 +01:00
- `--timeout-ms <ms>` : Agent timeout in ms (defaults to `agents.defaults.timeoutSeconds` )
2026-01-25 04:33:14 +00:00
2026-02-04 18:59:44 -05:00
Note: when you set `--url` , the TUI does not fall back to config or environment credentials.
Pass `--token` or `--password` explicitly. Missing explicit credentials is an error.
2026-01-25 04:33:14 +00:00
## Troubleshooting
No output after sending a message:
2026-01-31 21:13:13 +09:00
2026-01-25 04:33:14 +00:00
- Run `/status` in the TUI to confirm the Gateway is connected and idle/busy.
2026-01-30 03:15:10 +01:00
- Check the Gateway logs: `openclaw logs --follow` .
- Confirm the agent can run: `openclaw status` and `openclaw models status` .
2026-01-25 04:33:14 +00:00
- If you expect messages in a chat channel, enable delivery (`/deliver on` or `--deliver` ).
2026-01-09 01:01:17 +01:00
- `--history-limit <n>` : History entries to load (default 200)
2026-02-06 09:35:57 -05:00
## Connection troubleshooting
2026-01-31 21:13:13 +09:00
2026-01-09 01:01:17 +01:00
- `disconnected` : ensure the Gateway is running and your `--url/--token/--password` are correct.
2026-01-30 03:15:10 +01:00
- No agents in picker: check `openclaw agents list` and your routing config.
2026-01-09 01:01:17 +01:00
- Empty session picker: you might be in global scope or have no sessions yet.