V1ki/dsh-plugin-subscriptions338

dsh-plugin-subscriptions

Use ChatGPT (Codex), Claude, Grok (X Premium), and GitHub Copilot subscriptions as DeepSeek Harness LLM providers, with OAuth login from the web Settings page

AI 분석

适合拥有 ChatGPT、Claude 或 Copilot 等订阅并希望在 DSH 中免 API Key 使用的用户。

패키지
dsh-plugin-subscriptions
버전
0.9.0
라이선스
MIT
최근 업데이트
2026. 9. 12.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:V1ki/dsh-plugin-subscriptions

dsh-plugin-subscriptions Awesome DSH Plugin

English | 中文

Use your ChatGPT (Codex), Claude, Grok (X Premium), and GitHub Copilot subscriptions as LLM providers in DeepSeek Harness — no API keys. Codex and Grok log in via OAuth in the dsh web UI (Settings → Subscriptions), while Copilot uses the GitHub OAuth device flow; Claude imports credentials from an existing Claude Code session when there is one (macOS Keychain or ~/.claude/.credentials.json) and otherwise falls back to the same browser OAuth flow, so the Claude Code CLI is not required. Tokens live at ~/.dsh/plugins/subscriptions/auth.json (mode 0600) and refresh automatically.

Demo

Settings → Subscriptions: per-provider login/logout, no API keys. Claude imports credentials from Claude Code when available and otherwise uses OAuth, as Codex and Grok always do (settings screenshots use demo accounts and catalog data):

Subscriptions settings page

Configure visibility, default reasoning effort, and context together in Edit model list, with shared Save and Cancel actions:

Model settings

Configure image generation, video generation, and X search per provider. Tool switches apply only to sessions created after saving:

Provider tools

Logged-in providers join the session model picker with their live model catalogs:

Model picker with subscription models

Models that advertise reasoning levels get an Effort selector in the same menu — Codex models, Grok 4.6 / 4.5, and Copilot's reasoning models (levels and defaults come from each provider's live catalog, not a hardcoded list; Copilot's capabilities.supports.reasoning_effort array is sent as reasoning_effort on chat completions and reasoning.effort on the Responses wire). Models listing both Copilot endpoints (gpt-5.4, gpt-5-mini) normally speak chat completions but reroute to /responses when a request combines function tools with an effort — Copilot rejects that combination on the chat wire:

Reasoning effort selector

Codex models whose catalog advertises the fast tier (the codex CLI's fast mode) get a Speed toggle in the composer's tool row, next to the model selector — Standard or Fast (service_tier: priority), per session. The /fast slash command offers the same choice as a popup; it errors with an explanation when the current model has no fast tier.

Speed toggle with the Standard/Fast menu open

The composer's stats row gains a subscription usage pill showing the remaining rate-limit window for the provider of the session's current model (Codex when a GPT model is selected, Grok for a Grok model, and so on). Click it to expand every logged-in provider and account — the default account is starred, and the current provider is listed first:

Subscription usage pill expanded to show every provider and account

The image_generate tool renders its result inline in the conversation:

image_generate renders the image inline

Its provider parameter picks the image backend — the same prompt through GPT (gpt-image-2, top) and Grok (grok-imagine-image-2.0, bottom):

image_generate with provider gpt vs grok

The video_generate tool plays the generated clip inline:

video_generate plays the clip inline

Providers

RouteSubscriptionModels
codexChatGPT Plus/Prolive catalog from chatgpt.com/backend-api/codex/models
claudeClaude Pro/Maxall models available in your subscription (Opus, Sonnet, Haiku, Fable — static catalog, updated with the plugin)
grokX Premium (xAI)live catalog from api.x.ai/v1/models (chat models only); reasoning efforts from the Grok CLI catalog (cli-chat-proxy.grok.com/v1/models)
copilotGitHub Copilotlive catalog from api.githubcopilot.com/models (chat models on both wires, with per-model vision flags and reasoning efforts); login uses the OAuth device flow (enter the shown code at github.com/login/device)

Only logged-in providers appear in the session model picker; the lists above refresh on login/logout. Vision-capable models declare ['text', 'image'] input modalities, and image content is translated to each provider's wire format.

Logged-in cards also show subscription usage — per rate-limit window (5-hour session, weekly, and per-model weekly where the plan has one) with the used percentage, a progress bar, and the reset time, plus a Refresh button. Codex usage comes from chatgpt.com/backend-api/wham/usage (also reports the plan), Claude usage from api.anthropic.com/api/oauth/usage, and Grok usage from the Grok Build CLI proxy's cli-chat-proxy.grok.com/v1/billing (the source of the CLI's /usage panel; reports the shared weekly pool and the subscription tier). Copilot exposes no usage endpoint, so its card shows no usage section.

Also included, registered when the matching provider is enabled:

  • x_search tool (Grok) — xAI's hosted X search, returning { answer, citations }.
  • image_generate tool (ChatGPT or Grok) — gpt-image-2 via the Codex backend, or grok-imagine-image-2.0 via api.x.ai/v1/images/generations. The provider argument picks the preferred provider (gpt, the default, or grok); when the preferred one is logged out the other serves as fallback. Images are saved under ~/.dsh/plugins/subscriptions/images/ and the paths returned. The size/quality arguments map onto Grok's aspect_ratio/quality on the Grok path.
  • video_generate tool (Grok) — grok-imagine-video-1.5 via api.x.ai/v1/videos (async submit + poll); MP4s are saved under ~/.dsh/plugins/subscriptions/videos/, the path returned, and the clip plays inline in the conversation. Supports duration (1–15 s), aspect ratio, resolution, and image-to-video via image_url.

image_generate also supports editing: the model passes optional referenceImages (1–5 complete DSH attachment references) to edit or use existing images as sources; omitting it keeps text-to-image generation. References can come from uploads, read_image, or previous generated images. Read local files with read_image first; paths are not attachment references. Copy references from the image reference text or structured tool results. Their order matches the prompt's image order. Edits save new files and return reusable references, including for subsequent edits with another provider.

Codex edits use /backend-api/codex/images/edits; Grok edits use /v1/images/edits. Existing provider preference, logged-out fallback, and session tool policy still apply. Empty arrays, duplicate or invalid references, and attachment-limit violations fail explicitly instead of generating a new image. Editing requires the DSH attachment service.

Image generation and editing share same-provider account scheduling: try the default account first, then prefer the successful account in that session. Explicit quota, authentication, or image-entitlement rejection tries the remaining accounts; a 401 gets at most one credential refresh and retry first. Image-only cooldowns honor provider reset times and clear on login/logout. Transport failures, timeouts, 5xx responses, and invalid requests do not automatically resend, avoiding duplicate images. Set pool.enabled: false or pool.autoAccounts: false (legacy autoFamilies is accepted) to use only the default account. Image scheduling does not use chat catalogs, chat quota scoring, families, or tiers.

Install

Refreshing model lists

In Settings → Subscriptions → provider → Edit model list, use Refresh to bypass the five-minute catalog cache and refresh the conversation model picker too. This is separate from refreshing subscription usage. If models. is explicitly configured with a non-empty list, that list still overrides discovery.

Codex catalog visibility depends on the client_version request parameter. By default the plugin reads the stable version from the official npm @openai/codex package's public metadata (no CLI installation or subscription credentials sent to npm). Successful lookups are cached in memory for six hours; failures retry after five minutes and retain the last successful version, or the verified 0.153.4 fallback on first use. The lookup has a 1.5-second deadline, shares in-flight work across accounts, and ignores prerelease or regressed versions. Manual model-list refresh also rechecks the version. An explicit plugin configuration field, codexClientVersion: '0.153.4', takes precedence and disables automatic lookup; restart DSH after changing it. Model availability remains account-dependent; see verification notes.

Installation commands

With the dsh CLI available, install from npm (prebuilt artifacts, no build permission needed):

dsh plugin --profile web add dsh-plugin-subscriptions

Or install the sources from GitHub:

dsh plugin --profile web add github:V1ki/dsh-plugin-subscriptions

pnpm will ask you to allow this package's build script on first install (git installs fetch sources, not built artifacts); add the printed key to the profile's pnpm-workspace.yaml:

allowBuilds:
  dsh-plugin-subscriptions: true

and re-run the add. Only grant this to packages you trust — it runs the package's code at install time.

From a local checkout instead:

git clone https://github.com/V1ki/dsh-plugin-subscriptions.git
cd dsh-plugin-subscriptions && pnpm install && pnpm build
dsh plugin --profile web add ./dsh-plugin-subscriptions

Headless-only usage without installing into a profile (log in via the web UI first — the token file is shared):

cp overlay.example.yml overlay.yml   # then edit the name: to this checkout's absolute lib/index.js path
dsh --profile headless --patch /overlay.yml "your task"

Update

Installed from npm:

dsh plugin --profile web update --latest dsh-plugin-subscriptions

Installed from GitHub: re-run the same add github:V1ki/dsh-plugin-subscriptions command — it re-fetches the sources and rebuilds. A linked local checkout just needs git pull && pnpm build in the checkout.

Either way, restart dsh web afterwards so the new version loads.

Use

  1. dsh web, open the printed URL.
  2. Settings → Subscriptions: click Connect on a provider. For Claude, credentials are imported instantly if you have run claude and logged in at least once; without them, Claude authorizes in the browser like the others. For Codex and Grok, authorize in the opened browser tab; Copilot shows a GitHub device code to enter at github.com/login/device; if a browser flow can't complete (headless host), expand the manual fallback and paste the callback URL or code.
  3. In any session, open the model picker (/model) and choose a model under ChatGPT (Codex) / Claude (Subscription) / Grok (Subscription) / GitHub Copilot.

Not logged in? The provider stays out of the picker, and requests fail with MISSING_CREDENTIAL pointing at the Settings page; nothing else breaks.

Multiple accounts

Every provider accepts several accounts: once one is connected, the card grows an Add account button (Claude offers Browser authorization and Import Claude Code separately). Accounts are keyed by their identity (email / login) — re-logging the same account updates it in place, a different account appends. Browser authorization signs in whichever account the browser currently uses, so switch accounts there first (or use an incognito window with the manual code) to add a different one. The ★ default account serves the direct provider routes; pool routes use every account. A Claude account imported from Claude Code stays synced with the CLI's credential store; OAuth-added Claude accounts refresh standalone so several accounts never fight over the Keychain entry.

Edit visible models, context windows, and tools

Open Settings → Subscriptions → provider → Edit model list, search and select models, then Save changes. All discovered models are shown automatically by default. Selecting individual models, selecting all, or clearing the selection saves an explicit list; newly discovered models then stay hidden until selected. Enable automatic display again to restore discovery-driven visibility. Hidden models remain usable by existing sessions, and the editor retains the full catalog so they can be restored. Refreshing discovery preserves preferences; Cancel discards unsaved edits.

Codex models also accept a context budget in tokens; leave it blank to follow the provider. The plugin reads each account's context_window and max_context_window, caps the requested budget at that account's maximum, and uses the advertised default as the conservative ceiling when no maximum is provided. Account pools resolve each member separately and use the smallest window. This changes DSH's local history budget and compaction timing, without sending an API capacity override. Longer contexts can increase response latency.

The same editor controls Codex image generation and Grok image generation, video generation, and X search. Changes apply only to sessions created after saving; existing sessions retain their creation-time policy, including after restart. Image generation is shared: it disappears only when neither configured provider enables it, and execution never falls back to a provider disabled for that session. Claude and Copilot currently have no standalone subscription tools to configure.

Preferences and tool-policy history live in ~/.dsh/plugins/subscriptions/provider-settings.json (mode 0600), independently of the five-minute discovery cache. Existing non-empty models. configuration still defines the base catalog; visibility selections filter that catalog.

Reasoning defaults in the model editor

Default reasoning effort now lives in Edit model list, beside each model's visibility and context settings. Apply edits with Save changes, or discard unsaved edits with Cancel. Hidden models remain editable. Models without reasoning levels have no selector; Follow provider clears an override. Choices come from live capabilities, intersected across account-pool members. Custom pool aliases do not offer ineffective effort overrides.

Existing defaults continue to load from and save to ~/.dsh/plugins/subscriptions/model-defaults.json (mode 0600). If a save fails partway through, unfinished edits remain in the draft; the UI reports any defaults already saved and lets you retry.

Config

- id: llm-subscriptions
  name: dsh-plugin-subscriptions
  config:
    providers: [codex, claude]        # subset; default all four
    streamIdleTimeoutMs: 300000
    rateLimit: