跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

codex-multi-profile

Windows Codex Desktop multi-account picker (Codex Accounts app) plus AuthSwap launchers (codex1, codex2, ...). Humans pick accounts in Show-CodexAccountApp.ps1. Agents use pool / stick / route / depleted. ShareLive keeps history in ~/.codex; only auth.json is per-profile. Launch MUST set env vars through a cmd wrapper. Use for Codex clone, multi-account, ShareLive, wrong-account, or AuthSwap bugs.

Hung2124 · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add Hung2124/codex-multi-profile --skill codex-multi-profile

技能说明


name: codex-multi-profile description: >- Windows Codex Desktop multi-account picker (Codex Accounts app) plus AuthSwap launchers (codex1, codex2, ...). Humans pick accounts in Show-CodexAccountApp.ps1. Agents use pool / stick / route / depleted. ShareLive keeps history in ~/.codex; only auth.json is per-profile. Launch MUST set env vars through a cmd wrapper. Use for Codex clone, multi-account, ShareLive, wrong-account, or AuthSwap bugs.

Codex Multi-Profile (Windows)

Unofficial helper for Codex Desktop on Windows when you need more than one authorized ChatGPT login and still want one shared workspace. Not for account sharing, quota bypass, or Terms-of-Use violations.

Pick an account (humans)

The product is Codex Accounts (Show-CodexAccountApp.ps1): a dark WPF window that lists profiles (masked email, last-used, depleted, sticky paths). Click a row launches Launch-CodexProfile.ps1 -FastSwitch (closes any open clone, uses saved auth.json, no password). This app does not implement chatgpt.com / device-code login; first-run still uses AuthSwap bootstrap inside Codex.

$root = "$env:LOCALAPPDATA\CodexParallelDesktop"
powershell -NoProfile -STA -ExecutionPolicy Bypass -File "$root\Show-CodexAccountApp.ps1"
# or
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action accounts

CLI route / pool / stick / depleted stay for agents.

Default: ShareLive + AuthSwap

PieceWhere it lives
Sessions, skills, MCP, memories, projectsAlways %USERPROFILE%\.codex
Accountprofiles\<name>\auth.json, swapped into ~\.codex\auth.json at launch
On closeWatcher saves secondary auth back, then restores main auth.json
Electron UI--user-data-dir=profiles\<name> (profile root, not a nested electron\ folder)

Do not open the main Store Codex and a profile at the same time.

Why AuthSwap (not a second CODEX_HOME)

The Desktop app-server sometimes ignores CODEX_HOME and reads ~\.codex\auth.json anyway. A second home then shows the main account. AuthSwap puts the secondary token in the path the app actually reads.

Launch rules (verified)

  1. Do not run executables from WindowsApps (Access Denied). Clone ChatGPT.exe first.
  2. Entry point is ChatGPT.exe. Codex.exe exits 1.
  3. Get-AppxPackage.InstallLocation can be empty — prefer an existing local clone.
  4. Set both CODEX_ELECTRON_USER_DATA_PATH and --user-data-dir to the profile root.
  5. Do not rely on Start-Process inheriting $env:CODEX_HOME. Write a .cmd with set and start.
  6. PowerShell 5.1 Set-Content -Encoding UTF8 writes a BOM. That can invalidate config.toml. Use [IO.File]::WriteAllText(..., UTF8Encoding $false).
  7. Never set a persistent user-level CODEX_HOME.
  8. Never copy auth.json between machines or into git.

Paths

ItemPath
Install root%LOCALAPPDATA%\CodexParallelDesktop
Shared moduleCodexMultiProfile.psm1
Account pickerShow-CodexAccountApp.ps1 (Desktop: Codex Accounts)
Profile launcherLaunch-CodexProfile.ps1
Restore mainLaunch-CodexMain.ps1
ManagerCodexProfile.ps1 (accounts, new, list, status, doctor, pool, stick, route, depleted, layer, models, …)
Profiles...\profiles\<name>\
Clone...\versions\<ver>\app\ChatGPT.exe
Shared home%USERPROFILE%\.codex

Commands

$root = "$env:LOCALAPPDATA\CodexParallelDesktop"

# Recommended: account picker
powershell -NoProfile -STA -ExecutionPolicy Bypass -File "$root\Show-CodexAccountApp.ps1"

# Recommended launch (AuthSwap, one named profile)
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\Launch-CodexProfile.ps1" -Name codex1

# Restore main Store Codex
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\Launch-CodexMain.ps1"

# Manager
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action new -Name codex2
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action list
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action status
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action status -AsJson
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action doctor
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action processes
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action repair
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action sync-check
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action diagnostics
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action verify
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action stop -Name codex1
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action remove -Name codex2 -Force
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action pool
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action stick -Name codex1
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action route
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action depleted -Name codex1
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action layer
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action models
powershell -NoProfile -ExecutionPolicy Bypass -File "$root\CodexProfile.ps1" -Action accounts

Agent workflow

  1. Human wants to pick an account → Show-CodexAccountApp.ps1 (or -Action accounts). Do not treat PowerShell route as the product UI.
  2. "Switch account / keep my data" → AuthSwa
阅读完整来源 ↗