Skip to content

feat: seamless account switching without restarting the app#103

Open
Loongphy wants to merge 18 commits into
mainfrom
app-command
Open

feat: seamless account switching without restarting the app#103
Loongphy wants to merge 18 commits into
mainfrom
app-command

Conversation

@Loongphy
Copy link
Copy Markdown
Owner

@Loongphy Loongphy commented May 14, 2026

Description

This PR adds codex-auth app to enable automatic account switching without restarting the desktop app. It routes the app through a custom codex-cli (codext) via CODEX_CLI_PATH.

PixPin_2026-05-21_07-44-38

Key Features

  • App ID Launching: Launches packaged Codex apps by Windows package name/AUMID or macOS bundle identifier instead of filesystem app paths.
  • Custom Environment: Supports temporary overrides for CODEX_HOME and CODEX_CLI_PATH.
  • Managed CLI: Downloads and caches the latest supported codext CLI for the selected platform when --codex-cli-path is omitted.
  • Non-Invasive: Uses the supported CODEX_CLI_PATH env var to inject the forked CLI without patching the closed-source app.
  • Proper Reloading: Reloads credentials only at safe boundaries (thread/start, turn/start, thread/resume) to prevent account switching from interrupting active tasks while maximizing current credits usage.

Usage

codex-auth app [--app-id <id>] [--codex-cli-path <path>] [--codex-home <path>] [--platform win|wsl|mac] [--std]
Parameter Description
--app-id <id> Selects the packaged app. Windows accepts an AppX/MSIX package name such as OpenAI.Codex, or a full AUMID. macOS accepts a bundle identifier such as com.openai.codex. Defaults to OpenAI.Codex on Windows/WSL or com.openai.codex on macOS.
--codex-cli-path <path> Sets the CODEX_CLI_PATH value for this launch. The path must exist; when omitted, the command downloads or reuses the managed latest Loongphy/codext CLI for the selected platform.
--codex-home <path> Sets the CODEX_HOME directory for this launch and for managed CLI cache lookup.
--platform <win|wsl|mac> Selects the app runtime platform. win and wsl update the Windows app agent setting; mac launches by bundle identifier.
--std Resolves the packaged app executable and attaches stdout/stderr to the current terminal for debugging.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 14, 2026

Open in StackBlitz

@loongphy/codex-auth-darwin-arm64

npx https://pkg.pr.new/@loongphy/codex-auth-darwin-arm64@0dbc473

@loongphy/codex-auth-darwin-x64

npx https://pkg.pr.new/@loongphy/codex-auth-darwin-x64@0dbc473

@loongphy/codex-auth-linux-arm64

npx https://pkg.pr.new/@loongphy/codex-auth-linux-arm64@0dbc473

@loongphy/codex-auth-linux-x64

npx https://pkg.pr.new/@loongphy/codex-auth-linux-x64@0dbc473

@loongphy/codex-auth-win32-arm64

npx https://pkg.pr.new/@loongphy/codex-auth-win32-arm64@0dbc473

@loongphy/codex-auth-win32-x64

npx https://pkg.pr.new/@loongphy/codex-auth-win32-x64@0dbc473

@loongphy/codex-auth

npx https://pkg.pr.new/@loongphy/codex-auth@0dbc473

commit: 0dbc473

@Loongphy Loongphy changed the title feat: add Codex app CLI override command feat: seamless account switching without restarting the app May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant