一个用于从浏览器当前
chatgpt.com登录态中提取 OAuthaccess_token、生成 Codex CLIauth.json并复制到剪贴板的 Chrome 扩展。A Chrome extension that extracts the OAuth
access_tokenfrom the currentchatgpt.combrowser session, generates a Codex CLIauth.json, and copies it to the clipboard.
- 跳过 Codex 登录阶段的手机号校验
- 从当前浏览器登录态读取
chatgpt.com/api/auth/session - 自动提取
access_token - 生成可用于 Codex CLI 的
auth.json - 一键复制到剪贴板
- 在弹窗中预览生成结果
- 显示账号、套餐和过期时间等信息
- 克隆或下载本仓库
- 打开 Chrome / Edge 浏览器,进入扩展管理页面:
- Chrome:
chrome://extensions/ - Edge:
edge://extensions/
- Chrome:
- 打开右上角的“开发者模式”
- 点击“加载已解压的扩展程序”
- 选择本仓库目录
- 先在浏览器中登录
https://chatgpt.com - 点击浏览器工具栏中的扩展图标
- 点击 “抓取并复制 auth.json”
- 扩展会读取当前会话并生成
auth.json - 将复制到剪贴板的内容粘贴到:
~/.codex/auth.jsonauth.json包含敏感凭据,请勿泄露给他人- 当前生成结果不包含
refresh_token - 当
access_token过期后,需要重新在扩展中执行一次导出 - 使用前请确保当前浏览器中的
chatgpt.com登录状态有效
本项目采用 Apache License 2.0,详见 LICENSE。
- Skip phone number verification during Codex login
- Reads the current
chatgpt.com/api/auth/sessionbrowser session - Extracts the OAuth
access_token - Generates a Codex CLI compatible
auth.json - Copies the result to the clipboard with one click
- Shows a preview inside the extension popup
- Displays account, plan, and expiration details
- Clone or download this repository
- Open the browser extension management page:
- Chrome:
chrome://extensions/ - Edge:
edge://extensions/
- Chrome:
- Enable Developer mode
- Click Load unpacked
- Select this repository folder
- Sign in to
https://chatgpt.comin your browser - Click the extension icon in the browser toolbar
- Click “抓取并复制 auth.json”
- The extension will read the current session and generate
auth.json - Paste the copied content into:
~/.codex/auth.json- The generated
auth.jsoncontains sensitive credentials; do not share it - The output does not include a
refresh_token - After the
access_tokenexpires, run the export again from the extension - Make sure your
chatgpt.comsession is valid before using the extension
This project is licensed under the Apache License 2.0. See LICENSE for details.


