Skip to content

ChArLiEdance/codex-switch

Repository files navigation

Codex Switch

简体中文 | Changelog | Releases

GitHub stars License Downloads Rust Tauri TypeScript

Codex Switch is a local desktop app for managing multiple OpenAI Codex login profiles on one computer. It lets you view the active account, switch between saved local profiles, refresh quota information, and keep each account's local Codex state separated.

Version 1.0.0 focuses on the account switching, login, quota, settings, and usage/history foundation. The Skills and Prompts pages are visible in the interface, but these two features are not finished yet and will be completed in a later release.

This is not an official OpenAI project. It only manages local, already-authorized Codex login state. It does not collect passwords, bypass MFA, scrape browser cookies, or provide account sharing.

Software Features

  • Account cards: show nickname, detailed account name, plan badge, active login state, 5-hour quota, and weekly quota.
  • Profile management: add, log in, switch, rename, delete, and reorder local Codex account profiles.
  • Quota lookup: refresh and expand account quota details, with per-account usage query settings.
  • Usage statistics: read local Codex session usage, summarize token usage, and show usage trends.
  • Session history: browse local Codex sessions and resume or inspect previous conversations.
  • Settings: switch language, choose light/dark/system theme, configure update URL and Codex CLI path.
  • Privacy-first local flow: uses local Codex/OAuth state and does not store passwords or browser cookies in the repository.

Installation

Download installers from the GitHub Releases page. The current 1.0.0 release provides macOS Apple Silicon and Windows x64 installers.

macOS

  1. Download codex_switch_1.0.0_aarch64.dmg.
  2. Open the .dmg.
  3. Drag codex_switch.app into Applications.
  4. Launch Codex Switch.

You can also download it from Terminal:

curl -L -o ~/Downloads/codex_switch_1.0.0_aarch64.dmg \
  https://github.com/ChArLiEdance/codex-switch/releases/download/v1.0.0/codex_switch_1.0.0_aarch64.dmg

If you prefer a package installer, download codex_switch_1.0.0_aarch64.pkg and open it.

macOS x64 is not included in this release.

The current local package is unsigned or ad-hoc signed depending on the build environment. If macOS blocks the first launch, open System Settings -> Privacy & Security and allow the app.

Windows

  1. Download codex_switch_1.0.0_x64-setup.exe.
  2. Run the installer.
  3. Open Codex Switch from the Start menu or desktop shortcut.

You can also download it from PowerShell:

Invoke-WebRequest `
  -Uri "https://github.com/ChArLiEdance/codex-switch/releases/download/v1.0.0/codex_switch_1.0.0_x64-setup.exe" `
  -OutFile "$env:USERPROFILE\Downloads\codex_switch_1.0.0_x64-setup.exe"

The Windows build uses the Tauri NSIS installer.

Usage

  1. Install and verify Codex CLI on your machine.
  2. Open Codex Switch.
  3. Go to Settings and confirm the Codex CLI path.
  4. Click the plus button to add an account profile.
  5. Click Login and finish the official browser OAuth flow.
  6. Refresh the account card to load plan and quota information.
  7. Add another profile and use Switch to move the active local Codex state between accounts.

Codex Switch works with local account state around:

~/.codex/
~/.codex/account_backup/
~/.codex-switch/

Repository Layout

Current GitHub repository structure:

codex-switch/
  .github/workflows/      GitHub Actions build and release workflow
  macOS-backup/           Legacy shell-based macOS switching scripts
  scripts/                Version sync, macOS artifact, and package helper scripts
  src-tauri/
    capabilities/         Tauri permission capability files
    icons/                App icon assets for macOS and Windows
    mac/                  macOS frontend shell and platform-specific runtime
    shared/               Shared frontend, Tauri commands, metadata, quota, history, and switching logic
    src/                  Tauri Rust entrypoint
    win/                  Windows frontend shell and platform-specific runtime
    Cargo.toml            Rust crate manifest
    tauri.conf.json       Base Tauri configuration
    tauri.macos.conf.json macOS bundle targets
    tauri.windows.conf.json Windows NSIS installer target
  CHANGELOG.md
  LICENSE
  README.md
  README.zh-CN.md
  package.json
  package-lock.json
  tsconfig.json
  vite.config.ts

Generated build outputs such as dist/, node_modules/, and src-tauri/target/ are intentionally ignored by Git.

Development

npm install
npm run build
npm run test:rust
npm run tauri:dev

Preview the Windows UI in a browser with mocked Tauri commands:

npm run dev:windows-preview

Then open http://127.0.0.1:1421. This preview uses mock profiles, quota, usage statistics, session history, settings, and account actions. It does not read or write real Codex credentials and does not switch local accounts.

Build static Windows preview assets without starting a dev server:

npm run build:windows-preview

The static output is written to dist/windows-preview, separate from the production Tauri front-end output in dist/web.

Build local macOS packages:

npm run tauri:build:macos-release

Build Windows installer on a Windows runner:

npm run tauri:build:windows

Release Packaging

Installers should be uploaded as GitHub Release assets. They should not be committed into the source repository and do not belong inside package.json.

Current release assets for 1.0.0:

codex_switch_1.0.0_aarch64.dmg
codex_switch_1.0.0_aarch64.pkg
codex_switch_1.0.0_x64-setup.exe

The repository also has GitHub Actions configured to build release artifacts from version tags. The 1.0.0 public release intentionally does not include macOS x64.

Privacy And Safety

  • Does not collect OpenAI passwords.
  • Does not automate web login.
  • Does not bypass MFA.
  • Does not scrape browser cookies.
  • Does not write tokens, API keys, passwords, or cookies to Git.
  • Login state is used only for local profile switching and quota lookup.

Stack

  • Rust + Tauri 2
  • TypeScript + Vite
  • Native HTML/CSS frontend
  • Local Codex account metadata and quota lookup
  • GitHub Actions multi-platform build workflow

License

MIT License. See LICENSE.

About

Tauri desktop app for managing multiple local OpenAI Codex login profiles, quota metadata, and safe account switching.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors