Bundle
dsh-everything-oauth
Windows fork of dsh-everything-oauth: Codex / Grok / Claude subscription login for DeepSeek Harness
- Source
- 4sa1ary9
- stars
- 1 stars
- License
- Apache-2.0
- Updated
- Updated 5 days ago
Readme
# dsh-everything-oauth
> **已停用。** 正确的上游是 [AITabby/dockyard-dsh](https://github.com/AITabby/dockyard-dsh),Windows 二次开发在 [4sa1ary9/dockyard-dsh](https://github.com/4sa1ary9/dockyard-dsh)。不要再把本仓库和 Dockyard 一起装进 DSH。
[English](README.en.md)
Windows 上把本机 **Codex / Grok / Claude 订阅**接到 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 的插件。设置页只有三张账号卡:登录,或导入本机 CLI 已经登过的账号。
这不是官方插件。它从 [kam74515-boop/dsh-everything-oauth](https://github.com/kam74515-boop/dsh-everything-oauth) **fork 后二次开发**,针对 Windows 安装和凭据路径做了改动,设置页收成 Codex / Grok / Claude 三个供应商。界面排布参考了 [Yan-Zero/dsh-codex](https://github.com/Yan-Zero/dsh-codex) 和 [MirDie/dsh-xai](https://github.com/MirDie/dsh-xai) 的账号卡片。上游安装脚本在 Windows 上的修复,也参考过 [jjksam 的 PR](https://github.com/kam74515-boop/dsh-everything-oauth/pull/1)。
本仓库与 DeepSeek AI、OpenAI、xAI、Anthropic 都没有从属关系。套餐能不能用、额度怎么扣,由各家账号自己决定。
## 相对上游改了什么
上游用 `dsh plugin add github:...` 在 Windows 上经常装不上:`prepare` 会 `spawnSync('npx')`,Windows 上 `npx` 是 `.cmd`,Node 直接 spawn 会失败。Claude 订阅 OAuth 也只读 macOS 钥匙串。
这个 fork:
- 去掉 npm `prepare`。`lib/` 已提交,安装直接用预构建产物。
- Claude:读 `~\.claude\.credentials.json` 里的 `claudeAiOauth`;再按名字查 Windows 凭据管理器里的 `Claude Code-credentials` / `Claude Code`。同文件里的 MCP token 会跳过。
- 设置页不再扫 CC Switch、OpenCode、环境变量和自定义网关。
- 设置页做成三张供应商卡片,不再铺一长串来源列表。
## 环境要求
| 项 | 要求 |
|---|---|
| 系统 | Windows 10 / 11(本 fork 按这个目标改的)。macOS / Linux 上登录流也能跑,但凭据路径和安装脚本是按 Windows 测的。 |
| Node.js | `^22.19.0` 或 `>=24` |
| DeepSeek Harness | 能跑 `npx @deepseek-ai/dsh`。开发时对着 `0.1.0-rc.6` 测过。 |
| pnpm | `dsh plugin add` 会转给 pnpm。本机没有的话先装:`npm install -g pnpm` |
## 认证条件
三个供应商各自独立。没有对应套餐或本机登录态时,卡片会显示「未登录」,导入按钮也不会出现。
### Codex(ChatGPT 订阅)
需要 **带 Codex 资格的 ChatGPT 套餐**,不是 OpenAI Platform 的按量 API Key。插件走的是 ChatGPT Codex 后端,不会把订阅变成通用 OpenAI API。
两种接入方式,满足其一即可:
1. **设置里点「登录」**,走 ChatGPT OAuth。Web 上走 device code 时,ChatGPT 要先打开「Enable device code authorization for Codex」(设置 → Apps & connectors / Codex,界面名称可能变)。
2. **导入本机登录**:本机已经 `codex login`,且 `%USERPROFILE%\.codex\auth.json` 里有 `tokens.access_token` 和 `tokens.refresh_token`。
注意:
- 非官方客户端用 ChatGPT / Codex OAuth,存在账号被限制的风险。主号请自己判断。
- 导入会复制 refresh token。DSH 下次刷新可能把 Codex CLI 登出,需要再 `codex login`。
- 模型列表、额度、是否可用,以 OpenAI 账号为准。
### Grok(SuperGrok / X Premium)
需要 **能走 xAI 推理的 SuperGrok 或 X Premium**,不是随便一个 X 账号。
两种接入方式,满足其一即可:
1. **设置里点「登录」**,走 xAI device code。
2. **导入本机登录**:本机已经 `grok login`,且 `%USERPROFILE%\.grok\auth.json` 里能解析出 access / refresh(常见字段是条目下的 `key` + `refresh_token`)。
注意:
- 有的 SuperGrok 档位浏览器登录成功,推理却返回 HTTP 403。那是 xAI 套餐门禁,不是 Windows 或 token 过期。那种情况请改用官方 `XAI_API_KEY` 走 DSH 自带的 API Key 通道。
- 导入同样可能轮换 refresh token,Grok CLI 可能被登出。
### Claude(Claude 订阅)
需要 **Claude 订阅登录态**(Claude Pro / Max,或已经 `claude` CLI / Claude Code 登过的同一套 OAuth)。`settings.json` 里指向自建网关的 `ANTHROPIC_API_KEY` **不会**被导入。
接入方式:
1. **设置里点「登录」**,走 Anthropic / Claude OAuth。
2. **导入本机登录**,按下面顺序找,找到可用的 OAuth 才会出现导入按钮:
- `%USERPROFILE%\.claude\.credentials.json` 里的 `claudeAiOauth`(`accessToken` + `refreshToken`)
- Windows 凭据管理器里名为 `Claude Code-credentials` 或 `Claude Code` 的通用凭据
注意:
- 只有 MCP 登录(`mcpOAuth`)的 `.credentials.json` **不算** Claude 订阅,导入按钮不会出现。
- 不读 CC Switch、不读环境变量里的网关 Key。
### 凭据放哪
导入或登录成功后,插件把 token 写到:
```
%USERPROFILE%\.dsh\.everything-oauth.json
```
源文件只读,不会改 `~\.codex\auth.json`、`~\.grok\auth.json` 或 Claude 的文件。退出登录用设置页「退出」,或:
```powershell
npx @deepseek-ai/dsh plugin --profile web exec dsh-everything-oauth logout codex
```
## 安装
仓库已推到 GitHub 后:
```powershell
npx @deepseek-ai/dsh plugin --profile web add github:4sa1ary9/dsh-everything-oauth
npx @deepseek-ai/dsh web
```
本地开发:
```powershell
npx @deepseek-ai/dsh plugin --profile web add "link:C:\Users\michael.li\lsz\dsh-everything-oauth"
npx @deepseek-ai/dsh web
```
改完前端后要**重启** `dsh web`,再打开浏览器。
打开 **设置 → 订阅**。每张卡是一个供应商:未登录时「登录」或「导入本机登录」;已登录后勾选要出现在模型选择器里的模型。
命令行:
```powershell
npx @deepseek-ai/dsh plugin --profile web exec dsh-everything-oauth status
npx @deepseek-ai/dsh plugin --profile web exec dsh-everything-oauth import codex
npx @deepseek-ai/dsh plugin --profile web exec dsh-everything-oauth import grok
npx @deepseek-ai/dsh plugin --profile web exec dsh-everything-oauth import claude
npx @deepseek-ai/dsh plugin --profile web exec dsh-everything-oauth login grok
```
`status` 只打三行,例如:
```
out Codex import:yes
out Grok import:yes
out Claude import:no
```
`import:yes` 表示本机找到了可导入的登录文件,不等于已经接到 DSH。
## 许可证
[Apache-2.0](LICENSE)。上游版权仍归原作者。本仓库的改动同样按 Apache-2.0 发布。
Install
dsh plugin --profile web add github:4sa1ary9/dsh-everything-oauth
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-everything-oauth from the hub
- This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.