askdkc / @askdkc/dsh-auth
Provider authentication and model routes for DeepSeek Harness — no dsh source patch, bundled with dsh-cli
About this plugin
Written by the registry from verified metadata, not from the README.
@askdkc/dsh-auth is a DSH plugin published from the dsh-auth package in the askdkc/dsh-cli repository.
Capabilities and topics
@askdkc/dsh-auth
English | 日本語
Provider authentication for dsh-cli and DeepSeek Harness
Use ChatGPT, Claude, SuperGrok, OpenCode Zen/Go, OpenRouter, Nous Portal, and Infron as model providers with OAuth, device code, or an API key according to the provider. No dsh source patch is needed. This plugin is developed alongside (and bundled into) dsh-cli, the terminal front door for DeepSeek Harness; it also installs standalone into any dsh profile.
dsh-cli → /provider → Provider authentication → sign in
/auth login openai-codex ← the plugin command
/model → OpenAI Codex → gpt-5.6-sol ← routes & models
Status: experimental. Catalog OAuth flows are
pi-ai's shipped
implementations (device-code and loopback callback included); this plugin
adds the hosting: credential storage, automatic token refresh, adapter
registration, and a login surface over the userQuestions seam that works in
the TUI, the web client, and refuses cleanly on headless hosts.
Install
With dsh-cli — nothing to do: dsh-auth ships inside the dsh-cli package
(bundled dependency). Update dsh-cli and the /provider wizard gains its
provider authentication branch automatically.
Standalone, into any dsh profile:
dsh plugin --profile <name> add @askdkc/dsh-auth
Then restart the host; / lists auth, and every model picker gains the
signed-in providers' catalogs (credential-gated — see below).
What it does
- Mounts pi-ai catalog providers as
llmregistry routes:openai-codex,anthropic,xai, andopenrouter. OpenCode Zen/Go use an owned DSH adapter with bundled Messages, Responses, Chat Completions and Google transports. Models appear in a picker only after that provider is signed in (credential-gated listing) — sign in and the catalog appears, sign out and it disappears. Verified current models stay resolvable after logout; retired models fail explicitly and never trigger an automatic switch. - Loads those Provider objects from the exact pi-ai dependency owned by the
installed
dsh-llm-pi-ai. rc and alpha hosts therefore keep their supported pi-ai versions without passing Provider objects across package instances. /auth login [provider]runs the selected authentication method interactively. The waiting panel behaves the way pi's host does: the authorization URL is opened in your browser automatically (never hand-copied — the URL is hundreds of characters and wrap artifacts corrupt itsredirect_uri), and the panel offers Copy authorization link / Open browser again / Cancel sign-in. Device-code flows open the verification page and make the short code the copy target. OpenAI Codex also offers a device-code login method — the most robust path on headless or locked-down machines (no localhost:1455 callback needed).- OpenCode Zen/Go accept API keys. OpenRouter offers pi-ai's OAuth PKCE flow
or a manual API key.
nousandinfronuse Chat Completions; their/modelslistings must provide capacity and pricing metadata before a model is selectable.nousoffers device-code OAuth and an explicitly selected manual Bearer token compatibility path. The latter has not been validated against a real Nous account. - Stored access tokens refresh automatically before each request, serialized per provider under the credential store's lock — concurrent requests never double-refresh a rotated token.
/auth status//auth logout <provider>; thectx.dshAuthservice exposes the same api for UIs (the dsh-cli/providerwizard and/loginride it).
Usage
/auth # status: which providers are signed in
/auth login # pick a provider interactively
/auth login openai-codex # ChatGPT (Plus/Pro)
/auth login anthropic # Claude (Pro/Max)
/auth login xai # SuperGrok / X Premium
/auth login opencode # OpenCode Zen API key
/auth login opencode-go # OpenCode Go API key
/auth login openrouter # OAuth PKCE or API key
/auth login nous # device code or manual Bearer
/auth login infron # Infron API key
/auth logout anthropic
/auth models opencode # source, last success, excluded models
/auth refresh opencode # immediate catalog refresh
Model requests against a provider you have not signed in to fail loudly with
the /auth login <provider> hint — never silently.
Configuration
- id: dsh-auth
name: '@askdkc/dsh-auth'
config:
providers: [openai-codex, anthropic, xai, opencode, opencode-go, openrouter, nous, infron]
nous:
clientId: hermes-cli
# infron:
# serviceTier: flex # standard or flex; omit for gateway defaults
# credentialsFile: /secure/path/credentials.json
credentialsFiledefaults to$DSH_HOME/dsh-auth/credentials.json(~/.dsh/dsh-auth/credentials.json), overridable with theDSH_AUTH_CREDENTIALSenvironment variable. The directory is created0700, the file0600(best-effort on Windows), and every write is atomic (temp file + rename).- Aliases
opencode-zen,hermes, andinfron.airesolve toopencode,nous, andinfron. Credentials are stored under canonical IDs. - The Nous client ID defaults to
hermes-cli; third-party reuse of this ID is not guaranteed by Nous. Setnous.clientIdif your deployment has its own. - Set
infron.serviceTiertostandardorflexto select the routing tier for all Infron models, includingz-ai/glm-5.3. Requests send{"provider":{"service_tier":"flex"}}at the body root; there is noextra_bodywrapper on the wire. Omit the setting to keep gateway defaults. Flex may fall back to Standard when unavailable; see the Infron API reference. - A route another adapter family already owns — an
llm-pi-aisettings profile naming the same provider — is refused by the registry; the plugin logs the refusal and mounts the remaining routes. Keep one provider on one adapter. - OpenCode Zen/Go own their catalog and transports independently of the host's
pi version. Each startup fetches the official
/modelslisting and its model metadata; subsequent updates run hourly. The verified cache or bundled snapshot remains available while the request runs and if it fails./auth models [provider]shows freshness and excluded model reasons;/auth refresh [provider]requests an update. Failed updates keep the last verified catalog. Unsupported or incomplete models are excluded individually; no sibling metadata or another route's prices are guessed. - Public catalog caches live at
$DSH_HOME/dsh-auth/catalog-v1/and contain no credentials. Existing provider IDs, API keys and capacity overrides are retained. A new wire protocol requires a package update; new IDs on supported protocols do not require a pi update. - In auth 0.2, pi-specific construction helpers are internal to
pi-routes; consumers should useDshAuthApiand the DSH adapter contract.
Security notes
- The credential file holds API keys and long-lived refresh tokens. It is never
logged, never echoed through status surfaces (
/auth statusshows expiry metadata only), and a corrupt file fails loudly instead of being overwritten. - dsh-cli masks API-key input and redacts it from questionnaire summaries.
- Login refuses to run where no interactive surface is registered (no browser/GUI assumptions — remote and headless hosts get a clear error, per the ecosystem spec's remote-determinism rule, TUI-RUN-001).
- Subscription authentication and API-key access are different products: ChatGPT Codex and Claude Pro/Max use their subscription backends; the new API-key routes use each service's API backend.
Development
pnpm install
pnpm verify # build + headless smoke (credential store, refresh
# serialization, prompt bridging, gating, service api)
The smoke suite runs without cordis or a harness: the pure modules are
exercised directly. Real end-to-end login needs an interactive host
(dsh-cli) and is verified manually per release. The plugin is developed in
the dsh-cli repository in the tracked
dsh-auth/ directory. Auth and CLI changes can be committed together.
The initial in-repository snapshot came from
dsh-auth-fork commit
a48e59ec502fa0a3238c78955ffcffdfa8ae5abb.
Development and releases of this copy are now managed in dsh-cli.
Roadmap
- M2 (landed) — dsh-cli integration:
/providerOAuth branch,/loginaccount section, two-level/modelpicker with a pinned recently-used group. - M3 —
dsh-ecosystem-specconformance (manifest validation, admission fixtures) plus the remaining pi-ai OAuth providers (GitHub Copilot, Kimi); community list entry. - M4 — Gemini: a custom Google device-code flow (pi-ai ships none; this is the one wheel this project plans to build itself).
License
MIT. The original ccch1mneyyy copyright notice is retained; dkc is listed for the fork's independent development.
Badge
Listed here? Link back with this badge — paste the snippet into your repository README.
[](https://dsh-plugin.com/plugins/askdkc/dsh-cli/dsh-auth)