Skip to content

ghollbeck/cli-session-bridge

Repository files navigation

CLI Auth Bridge (Codex / Claude / Gemini)

Frontend + backend app to:

  • start chat turns against Codex CLI, Claude Code CLI, and Gemini CLI,
  • initiate provider-auth login/logout flows (OpenAI / Anthropic / Google),
  • persist auth artifacts as encrypted local storage,
  • normalize tool-call output into one UI structure.

Run

npm install
npm run dev
  • Backend: http://localhost:3001
  • Frontend: http://localhost:5173

Logs and debugging

  • Backend request + adapter logs are printed in the terminal running npm run dev:server.
  • Frontend action logs are shown in the in-app Activity panel.
  • Login/logout API responses include details with command/stdout/stderr snippets.
  • Child CLI stdout/stderr is streamed live into backend logs with adapter prefixes.

Env

Create .env in repo root:

PORT=3001
BRIDGE_ENCRYPTION_KEY=<32-byte-base64-or-64-char-hex>
# Optional:
# BRIDGE_STORE_PATH=./data/store.json
# GEMINI_OUTPUT_FORMAT=stream-json

Provider-auth behavior

  • codex: uses codex login --device-auth, codex logout, codex login status.
  • claude: auth is interactive-only in this bridge (claude then /login or /logout).
  • gemini: /auth flow is CLI-driven and may require interactive confirmation depending on environment.

Frontend auth UX:

  • If backend can extract an auth URL or device code from CLI output, UI shows an auth handoff panel.
  • UI attempts to open auth URL in new tab and also shows a manual clickable link.
  • While auth handoff is pending, UI polls refresh every 5s to pick up completed login.
  • For Claude specifically, CLI login is interactive; there is no guaranteed redirect back into this web UI.

If a CLI requires interactive TTY for login, use the CLI once locally to complete provider auth, then use this app for chat/session handling.

Prompt trail

Long-running agent prompt-trail artifacts are provided under codex_prompts/.

Sources used for implementation assumptions

About

Web-based Docker bridge for Claude Code, OpenAI Codex & Gemini CLI — xterm.js terminal + auth + chat UI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors