DeepSeek Harness 插件

dsh-codex-auth-nzfern

ChatGPT (Codex) OAuth login and access-token keep-alive for the DeepSeek Harness: use your ChatGPT Plus/Pro/Team/Enterprise quota through the openai-codex provider(英文原文)

跳到安装方式

来源信息

GitHub 仓库
nzfern/dsh-codex-auth
最近更新
2026年8月14日
分类
模型与服务商
GitHub stars
0
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/nzfern/dsh-codex-auth
插件名:dsh-codex-auth-nzfern
作者:nzfern

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器4 个文件
README.md来源说明 · 只读预览
README 语言

dsh-codex-auth

> Run DeepSeek Harness on your ChatGPT (Codex) subscription quota — one-click ChatGPT login in the UI, automatic token refresh, and a live remaining-quota badge.

![License: MIT](LICENSE) ![Release](https://github.com/nzfern/dsh-codex-auth/releases) ![Stars](https://github.com/nzfern/dsh-codex-auth) ![issues](https://github.com/nzfern/dsh-codex-auth)

中文版: README.zh.md

Run models in DeepSeek Harness using your ChatGPT (Codex) quota — no OpenAI API key needed. If you have a ChatGPT Plus/Pro/Team/Enterprise subscription, you already have Codex capacity; this plugin lets the Harness use it.

✨ Features

FeatureDescription
🔑 One-click ChatGPT login in the UISettings → General card: click "Log in with ChatGPT", authorize in the browser with the device code, done
🔄 Automatic access-token refreshChecks every 30s and swaps a fresh access token from the refresh token before expiry
📊 Remaining-quota badgePassive floating badge (bottom-right) with Codex remaining xx% + reset date/time; color-coded green/orange/red; toggleable in settings
📈 Plan & windowsShows your ChatGPT plan (plus/pro/…) and per-window remaining quota (fast window / daily window) via the official WHAM usage endpoint
💻 CLIcodex-login / codex-status / codex-logout commands and standalone scripts work without a GUI

📸 Screenshots

<img width="1028" height="980" alt="image" src="https://github.com/user-attachments/assets/e6876200-7539-42a8-b330-94f46c61316f" />

🚀 Install (recommended)

# 1. Make sure pnpm is available (once)
npm install -g pnpm

# 2. Install the plugin into the web profile (pnpm fetches from GitHub and registers the bundle)
dsh plugin --profile web add github:nzfern/dsh-codex-auth

# 3. Activate the provider and restart
#    Under llm-pi-ai.providers in $DSH_HOME/settings.yaml add:
#      openai-codex:
#        apiKeyEnv: OPENAI_CODEX_ACCESS_TOKEN
#    Then restart dsh web

Or run the one-liner installer (installs pnpm, installs the plugin, writes settings.yaml):

Set-ExecutionPolicy -Scope Process Bypass; iex (irm https://raw.githubusercontent.com/nzfern/dsh-codex-auth/main/install.ps1)

🖥️ Manual install

1. Clone/download this repo into the profile's plugin directory and register it as a bundle. 2. Activate the provider in $DSH_HOME/settings.yaml:

llm-pi-ai:
  providers:
    openai-codex:
      apiKeyEnv: OPENAI_CODEX_ACCESS_TOKEN

3. Restart dsh web.

🔑 Login

Web UI (recommended): after restart, open Settings → General, find "ChatGPT · Codex 额度", click Log in with ChatGPT → follow the inline link to https://auth.openai.com/codex/device, enter the code and authorize with your ChatGPT account → the card flips to "Connected".

CLI:

node "$env:USERPROFILE\.dsh\profiles\web\node_modules\dsh-codex-auth\bin\codex-login.mjs"
node "$env:USERPROFILE\.dsh\profiles\web\node_modules\dsh-codex-auth\bin\codex-status.mjs"

💡 Usage

After logging in, pick an openai-codex model in the model picker:

  • gpt-5.4 / gpt-5.4-mini (image input supported)
  • gpt-5.5 / gpt-5.6-luna / gpt-5.6-sol / gpt-5.6-terra
  • gpt-5.3-codex-spark

The model list comes from pi-ai's catalog and updates with the dependency.

⚙️ How it works

The Harness ships the openai-codex provider inside dsh-llm-pi-ai (pi-ai), which talks to https://chatgpt.com/backend-api/codex/responses with a ChatGPT access token as the bearer credential — but it cannot log in or keep the token alive (access tokens expire in ~10 minutes). This plugin fills in the OAuth lifecycle:

  • Device-code login flow (same as the official Codex CLI); the refresh token is stored in the Harness credential store and hot-reloaded by the web service;
  • Auto-refresh: on boot and every 30s, exchange the refresh token for a fresh access token;
  • Quota: read plan type and window remaining from chatgpt.com/backend-api/wham/usage.

❓ FAQ

  • Requires a subscription: Codex needs ChatGPT Plus / Pro / Team / Enterprise (free tier gets little to none).
  • Usage limit errors: ChatGPT rate-limits Codex usage; the error tells you when to retry.
  • Login invalidated: if the refresh token is revoked (password change, sign-out elsewhere), /codex-status shows logged out; just log in again.
  • Badge missing: toggle "在主页面显示用量" off in Settings → General; or you're logged out / the usage endpoint is unavailable.
  • Configuration: the codex-auth: section in $DSH_HOME/settings.yaml can tune clientId, credential refs, refresh interval, etc.

📦 Files

  • lib/codex.js — OAuth protocol core (device flow, refresh, WHAM usage query)
  • lib/index.js — host plugin (token keep-alive, /api/codex.* endpoints, commands)
  • lib/client.js — browser plugin (settings login card, floating quota badge)
  • bin/codex-login.mjs / bin/codex-status.mjs / bin/codex-logout.mjs — CLI

🤝 Support & Contributing

  • Bugs → Issues
  • Ideas → Discussions
  • Like it? Give it a ⭐ so more people can use their Codex quota!