Use this runbook to test the CLI and React dashboard without touching the live
OpenCode account store or Codex auth.json.
Run from the repository you intend to test. No hardcoded user directory is required.
git rev-parse --show-toplevel
bun install --frozen-lockfile
bun run lint
bun run buildbun run build is required after changes under either src/ or web-ui/; it
regenerates the server output and dist/web-ui React assets.
export OMA_SANDBOX_ROOT="${TMPDIR:-/tmp}/oma-sandbox"
export HOME="$OMA_SANDBOX_ROOT/home"
export OPENCODE_MULTI_AUTH_STORE_DIR="$OMA_SANDBOX_ROOT/store"
export OPENCODE_MULTI_AUTH_STORE_FILE="$OMA_SANDBOX_ROOT/store/accounts.json"
export OPENCODE_MULTI_AUTH_CODEX_AUTH_FILE="$OMA_SANDBOX_ROOT/home/.codex/auth.json"
mkdir -p "$HOME/.codex" "$OPENCODE_MULTI_AUTH_STORE_DIR"
printf '%s\n' '{"OPENAI_API_KEY":null,"tokens":{}}' > "$OPENCODE_MULTI_AUTH_CODEX_AUTH_FILE"Never point these variables at the live ~/.config/opencode-multi-auth or
~/.codex directories during destructive tests.
bun dist/cli.js path
printf 'HOME=%s\nSTORE_DIR=%s\nSTORE_FILE=%s\nAUTH_FILE=%s\n' \
"$HOME" \
"$OPENCODE_MULTI_AUTH_STORE_DIR" \
"$OPENCODE_MULTI_AUTH_STORE_FILE" \
"$OPENCODE_MULTI_AUTH_CODEX_AUTH_FILE"Expected paths are all below $OMA_SANDBOX_ROOT. The CLI path command
confirms the resolved store path; the remaining lines confirm the environment
passed to the process.
bun dist/cli.js web --host 127.0.0.1 --port 4343Open http://127.0.0.1:4343.
In another shell with the same environment, verify the current generated assets and state API:
curl -fsS http://127.0.0.1:4343/dashboard.js -o /dev/null
curl -fsS http://127.0.0.1:4343/dashboard.css -o /dev/null
curl -fsS http://127.0.0.1:4343/api/stateBrowser checks:
- React mounts without a blank loading screen.
- Browser console contains no runtime errors.
/api/statepolling succeeds.- Layout has no horizontal overflow at desktop and mobile widths.
- Add-account dialog opens, focuses the email field, closes with Escape, and does not expose credentials in logs.
Non-loopback binding must fail with LOCALHOST_ONLY:
bun dist/cli.js web --host 0.0.0.0 --port 4343Host and browser Origin validation must reject hostile authorities:
curl -i -H 'Host: attacker.example:4343' http://127.0.0.1:4343/
curl -i -H 'Origin: https://attacker.example' http://127.0.0.1:4343/api/stateExpected: 403 with FORBIDDEN_ORIGIN.
Limits confidence:
- Successful limits refresh reports
freshdata. - A failed probe reports
errorwhile preserving the prior authoritative quota values. - An account without authoritative data displays
unknown, not synthetic 0%.
Account lifecycle:
- The account
Enabledswitch is the only disable control. - A disabled account is excluded from rotation.
- The last enabled account cannot be disabled.
- Targeted re-auth updates only the selected alias.
Force Mode:
- Turn Force Mode on, select an enabled alias, and verify requests stay pinned.
- Turn Force Mode off and verify the saved rotation strategy becomes active.
- Keep Force Mode visually and behaviorally separate from account availability.
React filters:
- Search by alias or email.
- Filter by comma-separated tags.
- Sort by recommendation, quota, expiry, refresh, and alias.
Stop the dashboard before deleting its files:
rm -rf "$OMA_SANDBOX_ROOT"
mkdir -p "$HOME/.codex" "$OPENCODE_MULTI_AUTH_STORE_DIR"
printf '%s\n' '{"OPENAI_API_KEY":null,"tokens":{}}' > "$OPENCODE_MULTI_AUTH_CODEX_AUTH_FILE"EADDRINUSE:
bun dist/cli.js web --host 127.0.0.1 --port 4344spawn codex ENOENT during limits refresh means the codex executable is not
on PATH in the sandbox shell. Fix PATH or skip live probe checks.
Use TEST_EXECUTION_PLAN.md for automated gates and codextesting.md for the
manual React/OpenCode validation flow.