Welcome to Raspberry Pi 5 repository
04. OpenClaw TUI Interaction
TUI
Quick Start
- Star Gateway. (Usually Gateway has auto-started, no need to run this command)
openclaw gateway
- Open TUI.
xxxxxxxxxxopenclaw tui
- Type message and press Enter.

Remote Gateway:
xxxxxxxxxxopenclaw tui --url ws://<host>:<port> --token <gateway-token>
If your Gateway uses password authentication, use --password.
What You See
- Title bar: connection URL, current agent, current session.
- Chat log: user messages, assistant replies, system notifications, tool cards.
- Status line: connection/run state (connecting, running, streaming, idle, error).
- Footer: connection status + agent + session + model + think/verbose/reasoning + token count + delivery status.
- Input: text editor with autocomplete.
Mental Model: Agent + Session
Agent is a unique identifier (e.g.,
main,research). Gateway exposes list.Sessions belong to the current agent.
Session keys are stored as agent:
: . - If you type
/session main, TUI expands it toagent:<currentAgent>:main. - If you type
/session agent:other:main, you explicitly switch to that agent's session.
- If you type
Session scope:
per-sender(default): multiple sessions per agent.global: TUI always usesglobalsession (selector may be empty).
Current agent + session is always visible in footer.
Sending + Delivery
Messages are sent to Gateway; not delivered to provider by default.
Enable delivery:
/deliver on- or settings panel
- or start with
openclaw tui --deliver
Selectos + Overlays
- Model selector: lists available models and sets session override.
- Agent selector: choose different agent.
- Session selector: shows only current agent's sessions.
- Settings: toggle delivery, tool output expansion, and thinking visibility.
Keyoard Shortcuts
- Enter: send message
- Esc: abort active run
- Ctrl+C: clear input (press twice to exit)
- Ctrl+D: exit
- Ctrl+L: model selector
- Ctrl+G: agent selector
- Ctrl+P: session selector
- Ctrl+O: toggle tool output expansion
- Ctrl+T: toggle thinking visibility (reload history)
Slash Commands
Core:
/help/status/agent <id>(or/agents)/session <key>(or/sessions)/model <provider/model>(or/models)
Session control:
/think <off|minimal|low|medium|high>/verbose <on|full|off>/reasoning <on|off|stream>/usage <off|tokens|full>/elevated <on|off|ask|full>(alias:/elev)/activation <mention|always>/deliver <on|off>
Session lifecycle:
/newor/reset(reset session)/abort(abort active run)/settings/exit
Other Gateway slash commands (e.g., /context) are forwarded to Gateway and displayed as system output. See Slash Commands.
Local Shell Commands
- Lines prefixed with
!run local shell commands on the TUI host. - TUI prompts once per session to allow local execution; refusal disables
!for that session. - Commands run in TUI working directory in a fresh non-interactive shell (no persistent
cd/environment variables). - Standalone
!is sent as regular message; leading space doesn't trigger local execution.
Tool Output
- Tool calls display as cards with parameters + results.
- Ctrl+O toggles between collapsed/expanded view.
- While tool is running, partial updates stream to the same card.
History + Streaming
- On connect, TUI loads recent history (default 200 messages).
- Streaming responses update in-place until complete.
- TUI also listens to agent tool events for richer tool cards.
Connection Details
- TUI registers with Gateway as
mode: "tui". - Reconnects show system message; event gaps appear in log.
Options
--url <url>: Gateway WebSocket URL (default from config orws://127.0.0.1:<port>)--token <token>: Gateway token (if required)--password <password>: Gateway password (if required)--session <key>: session key (default:main, orglobalif scope is global)--deliver: deliver assistant replies to provider (default off)--thinking <level>: override thinking level for sends--timeout-ms <ms>: agent timeout in milliseconds (default fromagents.defaults.timeoutSeconds)--history-limit <n>: number of history entries to load (default 200)
Troubleshooting
No output after sending message:
- Run
/statusin TUI to confirm Gateway is connected and idle/busy. - Check Gateway logs:
openclaw logs --follow. - Confirm agent can run:
openclaw statusandopenclaw models status. - If you expect messages to appear in chat channels, enable delivery (
/deliver onor--deliver).
Troubleshooting
disconnected: ensure Gateway is running and your--url/--token/--passwordare correct.- No agents in selector: check
openclaw agents listand your routing configuration. - Session selector empty: you might be in global scope or don't have sessions yet.
For more TI content, refer to: TUI - OpenClaw