🧩 Codex 技能 — 从本地 ChatGPT 网页会话刷新 Codex CLI auth.json。对防火墙后、WSL/容器或远程环境中的 Codex 用户尤为重要。
This is an OpenClaw skill for Codex CLI. It provides Windows tooling to refresh Codex's
auth.jsonwith a fresh ChatGPT session token.
適用於 Codex · For Codex CLI users
Codex CLI users who are stuck with any of these:
😤 Pain💥 Why it sucksCodex OAuth won't completeProxies, WSL, containers — browser never opensOpenAI 2FA every timeToken expires every few hoursForced to use API proxiesCan't get official auth working, settle for third-partyToken dies mid-sessionLose context, workflow destroyed
Extracts a fresh access_token from your existing ChatGPT browser session and writes it directly to Codex's ~/.codex/auth.json. No reverse engineering. No MITM. No API abuse.
适用于 Codex CLI!Codex 走不了 OAuth 时的救星。
powershell
git clone https://github.com/zcz-user/codex-auth-session-refresh.git
cd codex-auth-session-refresh
npm install
.\login-profile.ps1 # Login ChatGPT → press Enter
.\status.ps1 # Check Codex auth state
Then Codex will see the fresh token in ~/.codex/auth.json.
bash
clawhub install codex-auth-session
CommandWhat it doeslogin-profile.ps1First login / re-login into ChatGPT (for Codex)run-refresh.ps1Refresh Codex's access token nowstatus.ps1Check Codex auth.json statusinstall-scheduled-task.ps1Auto-refresh Codex auth every N hourscreate-desktop-toolbox.ps1Desktop shortcuts for Codex auth management
text
You (browser login to ChatGPT)
│
▼
Playwright → chatgpt.com/api/auth/session → accessToken
│
▼
~/.codex/auth.json
(backup created before update)
│
▼
Windows Scheduled Task
(auto-refresh, so Codex never loses auth)
delete safe.token before writeauth.json backed up with timestamp before every update.gitignore