apus tui

Open the terminal UI connected to the Gateway, or run it in local embedded mode.

apus tui [target]

target can be a Control UI session URL, a compact host/agent/ref, a bare short reference such as movies-a1166b81, or a literal agent:... session key. A URL or host target authoritatively selects that Gateway; a bare reference uses the configured or default Gateway. You can also paste a Control UI URL directly as apus <url> and place the TUI options before or after it, for example apus <url> --token <token> --deliver.

The bare-URL form accepts --token, --password, --tls-fingerprint, --deliver, --thinking, --message, --timeout-ms, and --history-limit. URL-valued messages work in either position, including apus --message https://example.com/article <url>. Use apus tui <url> when you need another TUI option; --local, --url, and --session conflict with a session URL.

Related guide: TUI

Options

Flag Default Description
--local false Run against the local embedded agent runtime instead of a Gateway.
--url <url> gateway.remote.url from config Gateway WebSocket URL.
--token <token> (none) Gateway token if required.
--password <pass> (none) Gateway password if required.
--tls-fingerprint <sha256> gateway.remote.tlsFingerprint Expected TLS certificate fingerprint for a pinned wss:// Gateway.
--session <key> main (or global when scope is global) Session key. Inside an agent workspace it auto-selects that agent unless prefixed.
--deliver false Deliver assistant replies through configured channels.
--thinking <level> (model default) Thinking level override.
--message <text> (none) Send an initial message after connecting.
--timeout-ms <ms> agents.defaults.timeoutSeconds Agent timeout. Invalid values log a warning and are ignored.
--history-limit <n> 200 History entries to load on attach.

Aliases: apus chat and apus terminal invoke this command with --local implied.

Notes

Session target errors

Failure Recovery
The Gateway predates short-link resolution Copy the full session key from that Gateway's Control UI.
Session missing or short ref ambiguous For the configured/local Gateway, run apus sessions list; for a URL/host target, choose a longer or full key in that Gateway's Control UI.
Gateway unreachable The error names the selected origin. For a *.ts.net host, connect Tailscale and confirm the Gateway is reachable on the tailnet.
Identity-aware proxy rejected the upgrade Configure gateway.remote.edgeAuth for the configured remote Gateway; the error includes the relevant remote-access docs link.
Stored device token revoked or rotated Rotate it with apus devices rotate --device <deviceId> --role operator, then reconnect.
TLS certificate pin mismatch The original TLS fingerprint error passes through unchanged; verify the configured or explicit pin before retrying.

Examples

apus chat
apus tui --local
apus tui
apus tui https://gateway.example/dashboard/main/movies-a1166b81
apus https://gateway.example/dashboard/main/movies-a1166b81 --token <token>
apus tui movies-a1166b81
apus tui --url ws://127.0.0.1:18789 --token <token>
apus tui --session main --deliver
apus chat --message "Compare my config to the docs and tell me what to fix"
# when run inside an agent workspace, infers that agent automatically
apus tui --session bugfix

Config repair loop

Use local mode to have the embedded agent inspect the current config, compare it against the docs, and help repair it from the same terminal.

If apus config validate is already failing, run apus configure or apus doctor --fix first; apus chat does not bypass the invalid-config guard.

apus chat

Then inside the TUI:

!apus config file
!apus docs gateway auth token secretref
!apus config validate
!apus doctor

Apply targeted fixes with apus config set or apus configure, then rerun apus config validate. See TUI and Config.

Related