yequ172672/dsh-codex-subscription 预览 preview

yequ172672/dsh-codex-subscription

DSH 插件:直接复用 Codex CLI 本地登录订阅凭证,在 DeepSeek Harness 中使用 ChatGPT 订阅模型,无需 API Key

Project Overview项目介绍

This is a native LLM adapter plugin built exclusively for DeepSeek Harness (DSH). It lets DSH users reuse the existing local login credentials from OpenAI Codex CLI, so you can access ChatGPT subscription models like gpt-5.6-sol directly within DSH without requiring a separate OpenAI API key. As an official DSH plugin package with a valid bundle manifest, it activates automatically right after installation via DSH’s built-in plugin command. It does not require users to manually edit any composition or configuration files to get it working.

The plugin works by reading the auth.json credential file that Codex CLI generates after a successful login. It automatically refreshes expired access tokens and writes the updated token back to the original file atomically, keeping credentials perfectly in sync between DSH and Codex CLI. It also fetches the available model list in real time, and falls back to a local cached list then a built-in static list if the remote fetch fails. When paired with the dsh-session-import-codex plugin, it allows importing past Codex conversations for seamless continued chatting.

Before installing the plugin, you need to have the DSH core framework and pnpm package manager installed already, complete the login flow via Codex CLI, and have active network access to chatgpt.com. After successful installation, a new “Codex (ChatGPT subscription)” option will appear in DSH’s model selector, and users can configure proxy, custom credential file path and other optional settings. The plugin only supports text input, and shares the same ChatGPT subscription quota tied to your Codex CLI account.

这是一款专为 DeepSeek Harness(DSH)开发的原生 LLM 适配器插件,支持用户直接复用 Codex CLI 的本地登录凭证,在 DSH 中使用 gpt-5.6-sol 等 ChatGPT 订阅模型,无需额外配置 OpenAI API Key。它是标准的 DSH 插件包,通过 DSH 官方插件命令安装后会自动激活,不需要用户手动编辑配置文件。

插件原理是同源读取 Codex CLI 生成的 auth.json 凭证文件,支持自动刷新过期令牌并原子写回原文件,保证两边凭证状态同步,还支持实时拉取可用模型列表,失败时会逐层回退到本地缓存和内置静态列表。搭配 dsh-session-import-codex 插件还可导入 Codex 历史会话,实现模型与历史全链路打通。

安装前需要先安装 DSH 本体和 pnpm,完成 Codex CLI 登录,且确保网络可访问 chatgpt.com。安装后可在 DSH 的模型选择器中看到 Codex 订阅模型选项,支持配置代理、自定义凭证路径等,当前不支持图片内容输入,订阅额度和 Codex CLI 共用同一账号配额。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • 16 stars - an early-stage project星标 16,属于早期项目
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add dsh-llm-codex

把 yequ172672/dsh-codex-subscription 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-llm-codex

📦 已发布到 npm:dsh-llm-codex@0.1.1 · 📚 GitHub:yequ172672/dsh-codex-subscription · 🏷️ 属于 dsh-plugin 插件话题

DSH(DeepSeek Harness)LLM 适配器插件:直接复用 Codex CLI 的本地登录凭证,在 DSH 中 使用 ChatGPT 订阅模型(gpt-5.6-sol 等),不需要 API Key。

这是一个标准的 dsh 插件包:包内 dsh.bundle.patch 声明使其成为 profile 层, 通过官方 dsh plugin 命令安装后自动激活,无需手工编辑任何 composition 文件。

搭配推荐:dsh-session-import-codex

配合 dsh-session-import-codex 使用 效果更佳:它把 Codex 的历史会话导入 DSH(会话 id 形如 codex-<thread-id>),与本插件的 "凭证/模型复用"互补 —— 在 DSH 里既能用 Codex 订阅模型对话,又能无缝续聊 Codex 里 开过的对话,实现"模型 + 历史"全链路打通。

dsh plugin --profile web add dsh-session-import-codex
# 迁移(离线流程:先停止 dsh web 进程 → dry-run → 正式导入 → 重启 dsh)
pnpm --dir "$env:USERPROFILE\.dsh\profiles\web" exec dsh-import-codex --profile web --dry-run
pnpm --dir "$env:USERPROFILE\.dsh\profiles\web" exec dsh-import-codex --profile web

ℹ️ dsh-session-import-codex@0.1.1 起已正确声明全部依赖,直接安装即可。

原理

Codex CLI(codex login)会把 ChatGPT 订阅的 OAuth 令牌写入 ~/.codex/auth.json(或 CODEX_HOME)。本插件与 codex CLI 同源读取该文件,并参照两个成熟实现 (参考实现:你的 oh-my-pi-cn 与 opencodex)的 wire 细节:

凭证形态 端点 认证
tokens(auth_mode: chatgpt,订阅) https://chatgpt.com/backend-api/codex/responses Authorization: Bearer <access_token> + chatgpt-account-id + OpenAI-Beta: responses=experimental + originator: pi + version
OPENAI_API_KEY(auth_mode: apikey) https://api.openai.com/v1/responses Authorization: Bearer <api_key>
  • 凭证热跟随:每次请求都重新读 auth.json,CLI 登录/换号/登出,DSH 下一次请求自动生效。
  • 令牌刷新:access_token 过期(HTTP 401)时用 refresh_token 走 auth.openai.com/oauth/token 刷新并自动重试一次;刷新成功后默认原子写回 auth.json(writeBack: false 可关闭),与 codex CLI 行为一致,两边凭证永远同步。
  • 模型目录:优先实时拉取 GET {base}/codex/models,失败时回退 ~/.codex/models_cache.json,再回退内置静态列表。
  • 协议:OpenAI Responses API(stream: true SSE),推理摘要、正文、工具调用分别映射为 DSH 的 reasoning / text / tool-call 块,usage 从 response.completed 提取。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev DSH-Plan-Graph 下一个 Next dsh-ponytail →