Hysen Labs
Open-source project
piperhex/codex-switch avatar
piperhex

codex-switch

codex-switch & codex theme & codex mobile & chatgpt codex & codex relay & cc switch & cockpit-tools & codex skin & codexplusplus & CSwitch

194 stars11 forksTypeScriptApache-2.0
DEEP OPEN-SOURCE ANALYSIS

Codex Switch manages multiple Codex and ChatGPT accounts from one desktop app

A Tauri workbench for account login, usage tracking, local proxy switching, token analysis, and theme skins.

What the workbench covers

Codex Switch is a multi account management workbench aimed at users of Codex and ChatGPT. The README describes it as a Tauri 2 desktop application that also launches a local web version, bringing account login, usage viewing, quick switching, third party provider support, local hot swap proxying, token analysis, a skills market, and one click theming into a single entry point. It can connect to a self hosted backend and to a mobile client for cross device coordination. On login, it reuses the Codex CLI OAuth 2.0 plus PKCE flow and supports both an in app window and the system browser. Users can import and manage several auth.json files, including common third party JSON exports and multi account files, and the app atomically swaps the active auth.json that Codex reads. A backup package format exports and restores local account and provider configuration. The dashboard shows account email, plan and expiry, primary and secondary usage windows, reset cards, and the day's token count, with customizable table columns. Refresh can be manual or scheduled, and a best effort restart ChatGPT action is available from the console and tray. These features target people who run several accounts and want one place to see status instead of signing in and out repeatedly.

Proxy, token tracking, and provider support

A notable part of Codex Switch is its local proxy. Third party providers are reached through a local proxy that listens on 127.0.0.1 port 15722, and the app can hot swap between the official account and a provider without restarting the whole session. Requests that pass through the proxy are recorded for token usage, and the app shows proxy sessions, messages, context occupancy, and response latency, with structured diagnostic exports available. Token consumption is analyzed through weekly heatmaps and trend charts, plus rankings by token type, provider, model, and account. When the upstream returns a 429, the proxy backs off with increasing waits of one, three, and five seconds and retries automatically for up to five minutes before returning the last 429 to the client. In official account mode, when quota is exhausted the app can refresh the account, pick the available account with the lowest primary window usage, and switch credentials. The provider support spans OpenAI Responses, Chat Completions compatible third parties, multiple models, model control policy, and common relay balance queries. Account and provider keys are kept in the Rust backend and not exposed to the React UI or logs. That separation is the project's answer to the risk of leaking secrets through the interface, and it keeps the sensitive material inside the Rust backend where the proxy and login logic run.

Interface, skills market, and tech stack

The interface side includes a top menu, entry search, and system tray shortcuts, plus an optional floating usage orb that toggles between a compact circle and a glass info panel showing usage, reset countdown, and quota state. Built in theming offers more than three hundred Dream Skin presets and compatibility with the Codex Dream Skin project, with one click apply, custom backgrounds, and appearance tweaks. A skills market lets users search and install community skills, and after signing into a cloud account they can publish or update their own versioned skill packages. Settings are grouped by appearance, window, usage, network, privacy, and storage, covering language, theme color, close to tray, privacy mode, the orb, account refresh, and token statistics scope. The tech stack is React 18, TypeScript, Vite, and Ant Design on the front, Tauri 2 on the desktop runtime, and Rust with Reqwest and Serde on the back, with an optional NestJS, TypeORM, PostgreSQL, Redis, and JWT cloud service and a React Native Expo mobile client in an npm workspaces monorepo. The README warns that local credentials and keys are not statically encrypted and must be protected like auth.json. The warning is repeated rather than assumed, because the convenience of switching depends on those secrets being handled with care.

Editorial conclusion

The project is published under the Apache-2.0 license and its most recent commit was on 2026-08-26.

DEEP OPEN-SOURCE ANALYSIS

Official sources

Community notes

Community notes