本机已登录的 Codex(ChatGPT Plus/Pro)订阅接入 DSH。用途:①在侧边栏展示 5 小时窗口与一周窗口的剩余额度、重置时间与剩余重置券数量,并支持一键消耗一张重置券重置额度;②读取额度时自动把订阅线路注册进 llm-pi-ai(openai-codex 路由),使 Codex 模型出现在模型选择器中;③access token 到期前自动续期并原子写回,无需手动更换密钥;④提供 codex 工具把任务委派给本机 Codex agent。无需填写任何 API key。
安装
# Release 预构建包
dsh plugin --profile web add "https://github.com/mia-wong1016/dsh-codex-plus/releases/download/v0.1.4/dsh-codex-plus-0.1.4.tgz"
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:mia-wong1016/dsh-codex-plus
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
用途:把你本机已经登录的 Codex(ChatGPT Plus/Pro)订阅接入 DeepSeek Harness。 它显示 5 小时窗口与一周窗口的剩余额度、重置时间与剩余重置券数量,支持选择并消耗指定重置券来重置额度; 读取额度时自动把订阅线路注册进 DSH,使 Codex 模型出现在模型选择器中;并在 access token 到期前 自动续期。无需填写任何 API key,使用的是你本机 Codex 登录已有的凭证。
平台支持:Linux 与 Windows。 Windows 会从 PATH、OpenAI Codex 官方安装目录和 npm 命令垫片中定位 CLI。
中文更新记录:CHANGELOG.zh.md
English: use your Codex (ChatGPT Plus/Pro) subscription inside DeepSeek Harness
用途
- 看得见订阅额度 —— 侧边栏
Codex胶囊与面板显示两个窗口的剩余额度与重置券; - 能用订阅的模型 —— 读额度时自动注册
openai-codex路由,模型出现在模型选择器; - 能指定重置券 —— 面板逐张列出可用券并单选,按钮只消耗所选券,重置 5 小时 + 一周窗口;
- 凭证自动续期 —— token 剩余不足 24 小时时自动续期并原子写回。
中文详解(功能明细、面板路由、安装与配置、安全边界)见 README.zh.md。
English
Use your Codex (ChatGPT Plus/Pro) subscription inside DeepSeek Harness.
It reads the quota of the Codex account you are already signed in to on this machine, shows it in the UI, exposes the subscription's models to DSH's model picker, and can spend a specifically selected rate-limit reset credit.
What it does
Quota panel
- A
Codexchip in the sidebar footer: remaining 5-hour window, remaining weekly window, and how many reset credits are left (collapses to the percentage when the sidebar is in rail mode). - Click it for a panel with both windows (used %, reset time) and every reset credit with its expiry date.
- Selected-credit reset spends the reset credit selected with the radio control and resets the 5-hour + weekly windows.
The button is disabled when no credit is available, and the outcome is reported
(
reset/nothingToReset/noCredit/alreadyRedeemed). This consumes a real credit and cannot be undone.
Model routing
Reading the quota also registers the subscription route in the llm-pi-ai settings namespace,
so the Codex models appear in DSH's model picker:
llm-pi-ai:
providers:
openai-codex:
apiKeyEnv: OPENAI_CODEX_API_KEY
displayName: Codex (ChatGPT Plus/Pro)
baseURL: https://chatgpt.com/backend-api
Only that provider entry is replaced through settingsController.mutate(). No fixed settings-file path is assumed, and every other provider remains untouched. The profile declares the complete eight-model catalog, including gpt-6-luna and gpt-6-sol.
Token upkeep
The access token is refreshed against auth.openai.com when it has less than 24 hours left,
and the rotated access_token / refresh_token / id_token triple is written back to
auth.json atomically; POSIX systems additionally enforce mode 0600, while Windows keeps the profile ACL. The current access token is stored in DSH's
credential store under the reference name above, so settings.yaml never holds a secret.
Panel transport
The browser half talks to the host half over this plugin's own same-origin routes —
GET /codex-plus/status, POST /codex-plus/sync, POST /codex-plus/reset (JSON body: { "creditId": "…" }) — which the DSH web
server already protects with its browser-session policy. No new RPC channel and no token in the
page are involved.
Delegation tool
codex hands a self-contained task to the local Codex agent and returns its final answer —
useful for a second opinion, a fresh-context review, or an independent subtask.
| Tool | Purpose |
|---|---|
codex |
Run a task through codex exec and return the answer |
codex_quota |
Read the quota and re-sync the provider route |
codex_models_sync |
Refresh the token and re-register the models now |
codexprobe |
Diagnostics: resolved CLI, Codex home, cached catalog, quota read |
Requirements
- Linux and Windows are supported.
- A Codex CLI on this machine that is already signed in with a ChatGPT account
(
codex login); its login lives in<codexHome>/auth.json. - The CLI lookup order is
DSH_CODEX_BIN, the established Linux locations, PATH, then Windows fallbacks under%LOCALAPPDATA%\OpenAI\Codex\bin\<hash>\codex.exeand%APPDATA%\npm\codex.cmd|exe. A real.exeis preferred over command shims. - The Codex home is
DSH_CODEX_HOME, else~/.codexon both platforms. - Node 20 or newer. No Python, no extra npm dependency.
Install
dsh plugin --profile web add dsh-codex-plus
Then restart the profile and refresh the page. Switch the conversation's model to Codex (ChatGPT Plus/Pro) to use the subscription for that session.
Configuration
All keys are optional.
- id: codex-plus
name: 'dsh-codex-plus'
config:
codexBin: /usr/local/bin/codex # explicit CLI path
codexHome: ~/.codex # explicit CODEX_HOME
workspace: /path/to/workspace # shell sandbox root (default: process cwd)
providerRoute: openai-codex # pi-ai catalog route to configure
providerDisplayName: Codex (ChatGPT Plus/Pro)
credentialRef: OPENAI_CODEX_API_KEY # credential-store reference name
syncProviders: true # set false to skip the settings write entirely
sandboxPolicy: true # false disables the workspace-write policy
Set syncProviders: false if you only want the quota panel and would rather wire the
provider yourself.
Security
- No credentials are bundled, and none are logged. The plugin reads the token your own
Codex login already wrote to
auth.json. - The token value goes to DSH's credential store;
settings.yamlonly carries the reference nameOPENAI_CODEX_API_KEY. auth.jsonis only ever written with the refreshed triple, atomically, at mode0600.- The reset action requires an explicit confirmation argument and an available credit.
- The panel routes are readable by any caller that already holds a valid DSH web session (they are behind the same browser-session policy as the rest of the web UI); they expose the quota, the plan type, and the account email, not the token.
codex execruns with the sandbox you pass to thecodextool (read-onlyby default). Note that running Codex inside a sandbox that already blocks user namespaces can make Codex's own workspace-write sandbox fail;danger-full-accessthen defers to DSH's own sandbox, which is the safer pairing.
Licence
MIT
链接
同类插件
Ebony-Vinyl/dsh-our-free-model★ 64128
为 dsh 接入免费模型车道(含 DeepSeek V4.1 Flash、Kimi K3 等),无需登录、注册或填写 API Key,并提供本地 OpenAI 兼容网关、降级路由与用量看板。
dingminhua/dsh-connect-workbuddy★ 1244
将本机登录的 WorkBuddy 模型(国内版与国际版)接入 DSH,每次刷新按上游目录读取每个模型的积分倍率,支持逐模型图片输入开关、带自动换号的账号池、手动每日签到,以及卡片与输入框里的只读积分胶囊读数。
Alice-Marx/dsh-model-router★ 859
为 DeepSeek Harness 规划有依赖的工作包,将其分配给已配置的模型 API 或支持的厂商 CLI,并提供费用预览。
V1ki/dsh-plugin-subscriptions★ 568
把 ChatGPT(Codex)、Claude、Grok 订阅当作 DeepSeek Harness 的 LLM 提供方:设置页登录、模型目录、用量展示,以及 image_generate、video_generate 与 x_search 工具。
Mars-Sea/dsh-commandcode-provider★ 460
非官方 Command Code 模型接入插件:注册 `commandcode` 路由,带实时模型目录与推理强度支持。
XDTrees/dsh-workbuddy-xdpool★ 447
把本机 WorkBuddy 桌面 App 登录过的所有账号自动并入 DSH 模型池:多账号轮换自动容错、实时积分,模型目录按模型标注积分倍率与限时免费 / 夜间折扣。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。