Connect the CLI terminal UI
Remote terminal UI mode lets you run app-server on one machine and connect the Codex CLI terminal interface from another. Start a WebSocket listener:
bash
codex app-server --listen ws://127.0.0.1:4500Then connect the terminal UI:
bash
codex --remote ws://127.0.0.1:4500For a non-local connection, configure WebSocket authentication and put the connection behind TLS. Store the bearer token in an environment variable and pass its name instead of putting the token on the command line:
bash
export CODEX_REMOTE_TOKEN="$(cat "$HOME/.codex/app-server-token")"
codex --remote wss://remote-host:4500 \
--remote-auth-token-env CODEX_REMOTE_TOKENThe --remote option accepts ws://, wss://, unix://, and unix://PATH endpoints. Use plain WebSockets only for localhost or an SSH port-forwarded connection.