lingdong0128-sys/dsh-plugin-oauth-subs ↗★ 0

dsh-plugin-oauth-subs

ChatGPT Codex, xAI Grok, Zhipu GLM, AWS Kiro, Google Antigravity, Cursor, Ollama Cloud, Kimi, and GitHub Copilot subscription OAuth for DeepSeek Harness — PKCE / device-code / Google login, local Responses proxy, llm-pi-ai sync. 适合拥有ChatGPT、Grok、Copilot等订阅并想在DSH中使用的用户。

패키지
dsh-plugin-oauth-subs
호환성
미검증
Cordis peer 범위
^4.0.1
버전
0.0.110
라이선스
MIT
최근 업데이트
2026. 10. 21.

같은 패키지 이름의 다른 저장소

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:lingdong0128-sys/dsh-plugin-oauth-subs

dsh-plugin-oauth-subs

简体中文 | English

[!NOTE] This is a backup mirror of xxww0098/dsh-plugin-oauth-subs (v0.0.110, MIT). The original repository has gone offline (404). All credit and copyright belong to xxww0098. This copy is preserved unchanged — the plugin's functionality is identical to the original v0.0.110.

Use a ChatGPT / Codex, xAI Grok, Zhipu GLM, AWS Kiro, Google Antigravity, Cursor, Ollama Cloud, Kimi Code Plan, GitHub Copilot, Devin Agent, Cline, or Claude subscription—or an OpenCode Go API key—inside DeepSeek Harness. The subscription families use a loopback proxy; OpenCode Go routes directly to its API. Model routes use the DSH api values openai-responses, openai-completions, and anthropic-messages.

Provenance

  • This mirror was created on 2026-10-21 from the locally installed copy of dsh-plugin-oauth-subs@0.0.110 — the package is not on the public npm registry, and the upstream repository (xxww0098/dsh-plugin-oauth-subs) is offline (404), making this the only surviving copy of the artifact.
  • All shipped files (lib/, scripts/, assets/, cordis.patch.yml, package.json, LICENSE, AGENTS.md) are byte-identical to that artifact. The only documentation-level changes: the attribution note above, this section, and de-linking docs/ references (those files never shipped with the package, so the links were dead).

Install

dsh plugin --profile web add https://github.com/xxww0098/dsh-plugin-oauth-subs
dsh web

Open 订阅 / Subscriptions — the host home sidebar entry under 插件 Plugins. The workbench pins three top tabs — 额度 Quota, 模型 Models, 版本 Version — with a provider rail on the left and a scrollable pane on the right. One card per account (quota on every card; Ollama Cloud has no quota bars). The Version card's Installed shows the version captured when this process loaded the plugin; after a self-install it stays on the old running version until restart. The plugin is desktop-first: it never spawns dsh/npm and never restarts the host — the Version card compares the running version with the GitHub latest tag, and 安装更新 self-installs the tag tarball into the profile's node_modules (a 15-minute auto-update switch lives in the same card; on a local-directory link the switch stays, but its note says npm run build hot-reloads the plugin and drops the release-tag result). If profile node_modules is newer than the running process, the card lists On disk and flags the stale process. Or pnpm dsh web --patch ./cordis.patch.yml (id: oauth-subs).

Desktop

The desktop profile is managed exclusively by the Electron app — dsh plugin --profile desktop is rejected. Install through the UI instead:

  1. DeepSeek Harness → 插件 (Plugins) → 添加插件
  2. Paste https://github.com/xxww0098/dsh-plugin-oauth-subs → 安装
  3. Toggle the plugin on; the component row should read 运行中

Data lives under ~/.dsh/profiles/desktop/data/dsh-plugin-oauth-subs/ — logins are not shared with the web profile. To migrate existing accounts, quit the app, then copy auth.json (and models.json for picker state) from ~/.dsh/profiles/web/data/dsh-plugin-oauth-subs/ into that directory and relaunch. Copy while the app is stopped: the plugin holds tokens in memory and may overwrite a hot edit.

The proxy port (8318 by default) is a global loopback bind — web and desktop profiles cannot run simultaneously (EADDRINUSE). Kill the other profile or set a different config.port under id: oauth-subs in the profile's cordis.patch.yml.

This plugin is specialized for Desktop: the host-lifecycle surface (DSH-CLI/npm update, restart-host) has been removed, not hidden — the Electron app owns the profile and process. Updates are self-installed: 检查更新 → 安装更新 downloads the release tarball and swaps the plugin dirs in place (or turn on Auto-update for 15-minute checks); restart the app to load the new copy. Your data/ directory survives either way. Manual fallback: 插件 → 卸载 → 添加插件 → reinstall the repo URL.

If the app exits instantly on launch, check launchctl getenv ELECTRON_RUN_AS_NODE — that variable in the user launchd environment forces every Electron app into plain Node mode; launchctl unsetenv ELECTRON_RUN_AS_NODE fixes it.

Families

ProviderAuthDSH apiUpstream hop
ChatGPT CodexPKCE localhost:1455 (1457 fallback); paste-callback; app_EMoamEEZ73f0CkXaXp7hrannopenai-responseschatgpt.com/backend-api/codex/responses
xAI GrokDevice-code (default); PKCE 127.0.0.1:56121; b1a00492-073a-47ea-816f-4c329264a828openai-responsesapi.x.ai/v1/responses
GLM · Z.ai (global)ZCode CLI poll provider: zai; mint id.secret; client_P8X5CMWmlaRO9gyO-KSqtganthropic-messagesapi.z.ai/api/anthropic (Completions leftover …/coding/paas/v4)
GLM · BigModel (China)Same CLI poll, provider: bigmodel; poll JWT is the bearer; client zcodeanthropic-messagesopen.bigmodel.cn/api/anthropic (Completions leftover …/coding/paas/v4)
AWS KiroSocial PKCE app.kiro.dev (3128…53153) / Builder ID / IdC / Entra / ksk_openai-completionsq..amazonaws.com GenerateAssistantResponse
Google AntigravityGoogle OAuth localhost:51121; paste-callback; 1071006060591-…apps.googleusercontent.comopenai-completionsdaily-cloudcode-pa.googleapis.com/v1internal:streamGenerateContent
CursorPKCE poll cursor.com/loginDeepControl; or Import local Cursoropenai-completionsConnect agentn.us.api5.cursor.sh AgentService/Run
Ollama CloudPaste API key / import OLLAMA_API_KEYopenai-completionshttps://ollama.com/v1/chat/completions
Kimi Code PlanDevice-code (no PKCE); import ~/.kimi-code/credentials/kimi-code.json; optional KIMI_API_KEYopenai-completionshttps://api.kimi.com/coding/v1/chat/completions
GitHub CopilotDevice-code (no PKCE); import ~/.config/github-copilot/hosts.json; optional GITHUB_TOKENopenai-completionshttps://api.githubcopilot.com/chat/completions (tid= session)
Devin AgentPKCE 127.0.0.1:59653; import ~/.local/share/devin/credentials.toml; paste devin-session-token$…openai-completionsConnect server.codeium.com ApiServerService/GetChatMessage
ClineWorkOS device-code (no PKCE); import ~/.cline/data/settings/providers.jsonopenai-completionshttps://api.cline.bot/api/v1/chat/completions
Claude (Anthropic)PKCE Claude.ai claude.com/cai or Console platform.claude.com (loopback /callback); read-only import of the local Claude Code loginanthropic-messagesapi.anthropic.com/v1/messages (claude-code-20250219 + oauth-2025-04-20 beta identity)
OpenCode GoPaste API key; optional Console cookie and workspace for quotaopenai-completions / openai-responsesDirect https://opencode.ai/zen/go/v1

Import existing credentials

PathFamily
~/.codex/auth.jsonCodex
~/.grok/auth.json, ~/.hermes/auth.jsonGrok
~/.zcode/v2/config.json (also older cli/config.json / config.json)GLM
~/.kiro/credentials.json; credentials.json (kiro.rs CWD); ~/.aws/sso/cache/kiro-auth-token.jsonKiro
Panel paste: kami / JSON / CSV / Social refresh / ksk_…Kiro
~/.gemini/antigravity-cli/antigravity-oauth-token; ~/.cli-proxy-api/antigravity-*.jsonAntigravity
macOS Keychain cursor-access-token / cursor-refresh-token; IDE state.vscdb (current OS user only); CURSOR_ACCESS_TOKENCursor
OLLAMA_API_KEY env (not ~/.ollama/id_ed25519.pub)Ollama Cloud
~/.kimi-code/credentials/kimi-code.json; read-only ~/.kimi/credentials/kimi-code.json; KIMI_API_KEYKimi
~/.config/github-copilot/hosts.json; OpenCode ~/.local/share/opencode/auth.json; COPILOT_GITHUB_TOKEN / GITHUB_TOKEN / GH_TOKENCopilot
~/.local/share/devin/credentials.toml ($XDG_DATA_HOME/devin/; Windows %LOCALAPPDATA%\devin\); DEVIN_API_KEY / WINDSURF_API_KEYDevin
~/.cline/data/settings/providers.jsonCline
macOS Keychain Claude Code-credentials, then ~/.claude/.credentials.json (read-only)Claude
Panel paste: OpenCode Go API key; optional Console cookie / workspaceOpenCode Go

Subscription tokens: /data/dsh-plugin-oauth-subs/auth.json (0600). OpenCode Go accounts: opencode-go.json in the same directory. Model selections: models.json.

How it works

PlaneRole
Subscriptions panelLogin / import / logout, then model sync
llm-pi-aiDSH call plane; routes subscription families to the loopback proxy and OpenCode Go directly to its API
Loopbackhttp://127.0.0.1:8318/{codex,grok}/v1/responses, /glm/v1/messages (Completions leftover /glm/v1/chat/completions until the next sync), /{kiro,antigravity,cursor,ollama,kimi,copilot,devin,cline}/v1/chat/completions
UpstreamRefreshed subscription bearer or the active OpenCode Go API key

After the panel closes, DSH continues using the configured routes. The proxy binds only to loopback and uses DSH_OAUTH_SUBS_API_KEY; OpenCode Go bypasses it. Stack and module tree: AGENTS.md. Upstream references: docs/oauth.md.

Cache

Acceptance on the full session-772f7f3a-… SkillStar turn (oauth-codex / gpt-5.6-terra-fast, 211 calls, 71 min):

2026-08-26 incidentAfter 0.0.14 affinity headers
Weighted cache hit27.4%95.6%
Prefix reuse (median)—99.6%
Affinity misses47 / 90 zero-cache0
Prefix rewrites—1 adapter rebuild + 9 compaction
TRANSPORT faults290

Remaining uncached tokens are almost all new tool output (delta) plus expected prefix rewrites: leaving plan mode (step 55, 169k) and DSH compaction (330k); the next call after each rewrite reused ~99%. Healthy: weighted hit ≥ 80%, zero affinity misses, no TRANSPORT. Compaction / request/header rebuild zeros do not fail the session. Details: docs/error.md.

Diagnose

npm run analyze -- path/to/session.jsonl
node --experimental-strip-types scripts/analyze-session.ts --json path/to/session.jsonl
node --experimental-strip-types scripts/analyze-session.ts --fail-below 80 path/to/session.jsonl
npm run analyze -- --dir ~/.dsh/sessions --since 30d [--until ISO] [--json] [--compare base.json]

Directory mode aggregates every session (plain or zstd, one copy per session id) per provider and model: hit rate by call index, host retries, 300s idle timeouts, TTFB, stream silence, and pool idle; --compare prints per-1k-call deltas against a saved --json report.

The analyzer labels each call cold_start / delta / compaction / rebuild / affinity_miss so a compacted session is not flagged as a shard regression. Import as dsh-plugin-oauth-subs/analyze-session.

Fast / models / reasoning

Login and chat use official client identity; UA / fingerprint live in each src/oauth//README.md. The repos those fingerprints were copied from are listed in docs/oauth.md. The panel's Models tab: per-family checkboxes (default all on except 900K). Reasoning is set in the Harness session menu, not the Models tab. Fast and 900K spend quota faster.

FamilyFastWindowThinking
Codex GPT-6 Astra / Sol / Luna and GPT-5.6 Sol / Terra / LunaYes. -fast → Priority (service_tier: "priority" + x-codex-routing-hint; store: false)258K default; -900k (872K)low / medium / high / xhigh / max
Other CodexGPT-5.5 only: Yes, -fast → Priority. GPT-5.4 / 5.4-mini / Spark retired (not supported when using Codex with a ChatGPT account)258K (no -900k)low–xhigh (no minimal)
GrokNo. 2026-08-30: 83.34 vs 82.80 tok/s (0.994). Older ids reject the field—4.6: low / medium / high / xhigh (unset = high); 4.5: no xhigh
GLM——5.3 / Flash: low / high / max (default max; no medium; disabled 400s). Turbo: on, no depth. Flash is the only GLM image row
Kiro——GPT-5.6: off / low / medium / high / xhigh / max (off → wire none). Opus 5 / 4.8 / 4.7 and Sonnet 5 add xhigh; 4.6 family to max; Haiku / OSS: none. Catalog: kiro.dev/docs/models (no Auto)
AntigravityNoCloud Code catalog; see family model notesPer-model upstream support
CursorPer-model -fast variantLive GetUsableModels + AvailableModels; 15-row offline fallbackPer-family registry parameters; see family model notes
Ollama CloudNoLive GET /api/tags (17-row Cloud snapshot fallback). Context from POST /api/show model_info..context_length. No quota barsoff / low / medium / high / max (off → wire none)
KimiNoLive GET /coding/v1/models (static kimi-for-coding / highspeed / k3 / k3-256k, 256k/32k). Prefix-hash cacheoff / minimal / low / medium / high / xhigh / max → thinking.effort
CopilotNoLive GET {api}/models (static floor refreshed from GitHub's official docs tables + models.dev github-copilot, 2026-09-23). Prefix-hash + X-Interaction-Idlive reasoning_effort when the catalog advertises it
DevinYes. -fast is a real backend variant (not Codex Priority), never through applyFastModeLive GetCliModelConfigs (2026-09-23: 49 families / 81 picker rows; the static fallback mirrors them)Mapped to backend chat_model_uid per family (defaultUid); thinking / fast / 1m become picker rows
ClineNoLive GET /ai/cline/recommended-models (static feed snapshot fallback)minimal / low / medium / high / xhigh / max → reasoning_effort (max→xhigh)
ClaudeNoStatic catalog pinned to pi-ai's anthropic.json (Claude Code set; cross-checked against Kiro rows)Host-native mapping: adaptive ids (Opus 5 / 4.8 / 4.7, Sonnet 5 / 4.6, Fable) → output_config.effort (4.6 family to max); classic ids keep budget thinking
OpenCode GoNo28 Completions + 6 Responses rows; see model audit docs/model-audit-2026-09-26.mdDepends on the model; DSH closed effort keys

Codex Priority echo created=auto / completed=default is not a confirmation (openai/codex#14204). 2026-08-26 Luna: 88.3 vs 57.5 tok/s (1.54×); 2026-08-30 interleaved mean 1.33× (1.90 then 0.93). Throughput-only; TTFT and cache unchanged.

Quota

SubscriptionEndpointDisplay
ChatGPT Codexchatgpt.com/backend-api/wham/usagePlan badge (Plus / Pro / Team …) plus 5-hour + weekly windows, remaining percent and reset time
ChatGPT Codex reset…/wham/rate-limit-reset-credits + /consumeBanked weekly-window reset credits and expiry; one confirm button per credit on the Codex card
xAI Grokcli-chat-proxy.grok.com/v1/billing?format=credits plus /v1/user?include=subscription + grok.com GetGrokCreditsConfig (gRPC-web)Plan badge (SuperGrok / X Premium+ …), Grok Code access tag, period usage with cycle date range, product split; {val} cent fields become USD rows (included pool, pay-as-you-go cap, prepaid) when billed
Zhipu GLMapi.z.ai or open.bigmodel.cn monitor/usage/quota/limitPlan badge (Lite / Pro / Max) plus Coding Plan credit windows; host follows the active account
AWS Kiroq..amazonaws.com/getUsageLimitsCurrent cycle usage, limit, and any trial or bonus allowance
Google Antigravitydaily-cloudcode-pa loadCodeAssist + fetchAvailableModels (prod only on 5xx / transport)Plan badge (Pro / Ultra / Free / Standard) plus SkillStar model-group r