#!/usr/bin/env bash # Start the Codex native UI host — the only entry point for the UI host. # # scripts/run-codex-ui.sh UI on :8095 # UI_PORT=9000 scripts/run-codex-ui.sh custom port # # Env (all optional, no secrets in this file): # CODEX_APP_SERVER_BIN codex binary for the app-server bridge # (default /opt/hatch-image/bin/codex) # CODEX_UI_ORIGINAL_ROOT vendored original/ webview directory # (default ~/workspace/user/downloads/codex-ui-stack/original; # original/ is never committed — see docs/codex-native-ui-alignment.md §4) # UI_PORT port to listen on (default 8095) # BUMIAN_API_KEY real-relay key, only when relay-config.json points # at the real relay (see host/relay-config.README.md) set -euo pipefail REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" UI_PORT="${UI_PORT:-8095}" export CODEX_APP_SERVER_BIN="${CODEX_APP_SERVER_BIN:-/opt/hatch-image/bin/codex}" export CODEX_UI_ORIGINAL_ROOT="${CODEX_UI_ORIGINAL_ROOT:-$HOME/workspace/user/downloads/codex-ui-stack/original}" export CODEX_WEB_PORT="$UI_PORT" echo "[codex-ui] UI http://127.0.0.1:${UI_PORT}/" echo "[codex-ui] codex ${CODEX_APP_SERVER_BIN}" echo "[codex-ui] root ${CODEX_UI_ORIGINAL_ROOT}" exec node "$REPO_ROOT/cloud/codex-ui-host/host/web-server.mjs" --port "${UI_PORT}"