yfzhou0904/dsh-plugin-gallery--plugins-codex-subscription0

@yfzhou/dsh-llm-codex-subscription

DSH LLM 适配器插件:复用 Codex CLI 本地登录凭证(~/.codex/auth.json)在 DSH 中直接使用 ChatGPT 订阅模型

包名
@yfzhou/dsh-llm-codex-subscription
版本
0.1.1
许可证
MIT
最近更新
2026年8月16日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:yfzhou0904/dsh-plugin-gallery#0bca5d11a39014e69e5a571bf6d6ca97a491b2bb&path:plugins/codex-subscription

机器相关配置(settings.yaml,不进包)

ChatGPT 后端通常需要走本地代理;Node 原生 fetch 不读系统代理,在 $DSH_HOME/settings.yaml 配置:

llm-codex-subscription:
  proxy: http://127.0.0.1:7890
  account: personal
  accounts:
    personal: ~/.codex-personal/auth.json
    work: ~/.codex-work/auth.json

也可用环境变量 HTTPS_PROXY(优先级:显式 proxy 配置 > HTTPS_PROXY > HTTP_PROXY;NO_PROXY 命中的主机直连)。其他可选字段:clientVersion(默认 0.144.1)、writeBack(默认 true)、authFilemodelsCacheFilestaticModels(显式模型目录)。设置段热更新,无需重启。

多账户切换

可以为每个 ChatGPT/Codex 账户保存一份独立的 auth.json,然后通过 account 选择当前账户:

llm-codex-subscription:
  account: personal
  accounts:
    personal: ~/.codex-personal/auth.json
    work: ~/.codex-work/auth.json

每次请求都会读取所选文件;切换 account 后新的请求使用新账户,不需要复制回 ~/.codex/auth.json。令牌刷新只会写回当前选中的文件。若未配置 accounts,仍兼容原来的 authFile 或默认 ~/.codex/auth.json

注意:这里的 account 是配置别名,不是 OpenAI 的 account_id;后者仍从所选 auth.json 的 tokens.account_id 读取。

选用 codex 作为默认模型(settings.yaml):

agent-default-model:
  provider: codex
  model: gpt-5.6-sol
  reasoningEffort: medium