dsh-llm-local-token

DSH PLUGIN浏览器与联网

仓库 tianxia--/dsh-llm-local-token · npm dsh-llm-local-token

浏览器与联网 L5 · 运行验证通过 安全审查:低风险 可信度:金 可安装插件
安装这个插件

DSH plugin 复用本地 Codex CLI 与 Claude Code 已持有的 OAuth 令牌作为模型路由,免去单独 API key,并内置订阅用量徽章。

验证等级 L5 L5 · 运行验证通过
GitHub 星标 2 复刻 1 · 未关闭 issue 0
最近更新 2026-10-06 创建于 2026-08-17
README 11.1 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
dsh plugin --profile web add dsh-llm-local-token
兼容 DSH 版本0.2.0-rc.2 等 11 个版本版本不匹配时安装会报错
Node.js 要求>=22.13.0来自仓库 package.json 的 engines 字段
前置依赖@deepseek-ai/cordis@^4.0.1、@deepseek-ai/dsh-llm@^0.1.0-rc.6 || ^0.1.5-rc.0 || ^0.2.0-rc.2 等 5 个需要同时安装的同级依赖
npm 包名dsh-llm-local-token可用 npm view 查看包信息

能做什么

4 项功能
字段来自项目仓库与公开索引,中文说明由本站标注

dsh-llm-local-token:让 DeepSeek Harness 直接使用本地 CLI 的 OAuth 令牌

  • 复用本地 OAuth 令牌
  • 免 API key 登录
  • 订阅用量徽章
  • 缺失凭据自动跳过

适用场景

终端命令

上游标签

anthropicclaude-codecodexcodex-clicordisdeepseek-harnessdshdsh-pluginllmoauthopenai

验证等级与安全审查

L5 · 运行验证通过
自动化流程结论,不是人工审核
验证等级L5 · 运行验证通过在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来
安全审查低风险静态分析结论,未标注不代表已通过审查
仓库健康度活跃按仓库活跃度与最近更新时间给出
可信度金综合仓库活跃度与验证结果

上面的结论来自上游最近一次自动化验证(2026-10-08): 同一套检查会在插件发新版后重跑,页面显示的是最新一次的逐项结果。

逐项检查结果

L1 · 已找到 ✓ 通过
  • L1.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L2 · 结构化 ✓ 通过
  • L2.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L3 · 安装规范 ✓ 通过
  • L3.1_INSTALL_COMMAND_PARSED 安装命令已解析 方式:安装规范解析
  • L3.2_DSH_VERSION_DECLARED DSH 版本已声明 方式:DSH 版本声明
L4 · 安装已测 ✓ 通过
  • L4.1_INSTALL_EXECUTED_CONFINED 受限沙盒内执行安装 方式:沙盒安装执行
  • L4.2_INSTALL_SUCCESS 沙盒安装成功 方式:沙盒安装执行
  • L4.3_ARTIFACT_CONFIRMED 安装产物已确认 方式:沙盒安装执行
L5 · 运行已测 ✓ 通过
  • L5.1_INSTALL_PASSED_SANDBOXED 沙盒安装通过 方式:沙盒安装执行
  • L5.2_WEB_BOOT_READY Web 启动就绪 方式:Web 启动
  • L5.3_HTTP_SERVED HTTP 服务响应 方式:HTTP 请求
  • L5.4_PLUGIN_INVENTORY_ACTIVE 插件清单中已激活 方式:插件清单查询

风险详情

  • 审查结论 通过
  • 结论说明 vet 静态分析未发现可疑行为,判定为干净(clean)。
  • 风险计数 严重 0 / 高 0 / 中 0
  • 风险详情 未发现严重或警告级问题。

仓库档案

浏览器与联网
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方tianxia--仓库 dsh-llm-local-token · 默认分支 main
分类浏览器与联网network
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言JavaScript仓库主语言
许可证MIT商用或二次分发前请确认条款原文
星标 / 复刻 / issue2 / 1 / 0收录时的数值,非实时
创建 / 更新2026-08-17 · 2026-10-06最后推送 2026-10-06
本站收录2026-08-18首次进入本站目录的时间

README 全文

11.1 KB
作者原文,中文版优先;只做安全转义,不改内容

dsh-llm-local-token

A DeepSeek Harness plugin that serves LLM
calls with the OAuth tokens your local CLIs already hold — no separate API key, no extra
login. If you are signed in to the Codex CLI or to Claude Code, those subscriptions become
usable model routes inside DSH.

Provider route Credential source Endpoint
openai-codex ~/.codex/auth.json (ChatGPT OAuth, shared with the codex CLI) https://chatgpt.com/backend-api
anthropic ~/.claude/.credentials.json, else the macOS Keychain item Claude Code-credentials https://api.anthropic.com

Both routes appear in the model picker as soon as the plugin loads. A route whose credential is
missing is skipped instead of failing the boot.

The usage badge additionally reports a GLM Coding Plan subscription, which DSH already serves
through pi-ai's own zai-coding-cn route — the plugin adds the quota, not a second route, so the
model picker gains no duplicate. See Subscription usage badge.

Both subscriptions as routes in the model picker
Subscription usage for every subscription the plugin can see

Why it exists

DSH resolves a provider's key through its credential seam, which expects an API key. Personal
Codex / Claude subscriptions are OAuth-only, so the keys simply do not exist. This plugin
resolves the token per request from the file the CLI maintains, refreshes it when it is close to
expiry, and hands it to the pi-ai engine that DSH already ships.

Install

dsh plugin --profile web add dsh-llm-local-token

# or straight from git
dsh plugin --profile web add https://github.com/tianxia--/dsh-llm-local-token.git

Then restart dsh — that is the whole install. The package declares a profile
bundle (dsh.bundle.patch → cordis.patch.yml), so DSH
inserts the loader row for you; you do not have to hand-edit the profile's
own cordis.patch.yml.

Enabling it by hand instead

If you vendored the plugin, or you want to pin its config in your own patch
layer, append the row yourself to ~/.dsh/profiles/web/cordis.patch.yml. Your
profile's layer is applied after every bundle layer, so restating the id here
also lets you override the bundle's defaults:

- insert:
- id: llm-local-token
name: dsh-llm-local-token

To make it the default model:

# ~/.dsh/settings.yaml
agent-default-model:
provider: openai-codex
model: gpt-5.6-terra
reasoningEffort: medium

Configuration

All keys are optional; the defaults match a stock CLI install.

Key Default Meaning
codexAuthPath $CODEX_HOME/auth.json, else ~/.codex/auth.json Codex credential file
claudeAuthPath ~/.claude/.credentials.json Legacy Claude Code credential file
claudeKeychainService Claude Code-credentials macOS Keychain service holding the Claude OAuth payload
requireClaude false Fail activation when no Claude credential is found, instead of skipping the route
codexTransport "sse" Streaming transport for the Codex route: sse / websocket / websocket-cached / auto. The quota badge depends on sse: pi-ai's default auto streams over WebSocket, and the x-codex-* quota headers exist only on the SSE response, so the badge stays empty under WS. Set auto to prefer WebSocket and accept no Codex quota data.
usageProbe true Refresh quota on a schedule with one bare minimal request per provider. Set false to keep the panel purely passive.
usageProbeIntervalHours 4 Hours between probes. Tracks the 5-hour window, which resets about five times a day; 24 is once per day.
usageProbeAtHour — Local hour 0–23 for a once-daily probe at a fixed clock time. Overrides usageProbeIntervalHours.
usageProbeStartupDelayMs 20000 Delay before the probe that runs at boot. A clock schedule only fires while dsh happens to be running, so boot is its own trigger.
usageProbeCodexModel gpt-5.6-terra Model the Codex probe names; only a vehicle for the headers.
usageHistoryDays 7 How many days of snapshots to keep per provider and serve to the panel's trend strip. Snapshots live in ~/.dsh/usage-history/.jsonl.
usageProbeAnthropicModel claude-haiku-4-5-20251001 Model the Anthropic probe names; only a vehicle for the headers.
glmQuota true Report GLM Coding Plan quota. No route is registered either way — DSH already serves GLM.
glmApiKey — GLM token, overriding every discovered source.
glmApiKeyEnv ZAI_CODING_CN_API_KEY Environment variable and $DSH_HOME/.credentials.yaml ref consulted for the GLM token.
glmBaseDomain https://open.bigmodel.cn Monitor host. https://api.z.ai is the international front; both answer the same body for the same account.
requestImageMaxEdge 1568 Long-edge cap, in pixels, for every image sent upstream. Images above it are scaled down proportionally (never cropped, never enlarged); smaller images are untouched. Values above 2000 are capped, because Anthropic rejects a request carrying more than 20 images when any edge exceeds 2000px.

Subscription usage badge

Codex and Claude state their quota in response headers, so reading it off a real request costs
nothing. A route you never call has nothing to report, though — so the plugin also refreshes on a
schedule, with one deliberately tiny request per provider (16 input tokens for Codex, 9 for
Anthropic) that carries no prompt, skills, tools or history and is never stored. A badge appears in
the composer bar next to the context ring; click it for the breakdown.

Provider Source Shown
openai-codex x-codex-primary-*, x-codex-secondary-*, x-codex-plan-type, x-codex-credits-balance plan, used % per window, reset countdown, credit balance
anthropic anthropic-ratelimit-unified-{5h,7d}-{utilization,reset,status} used % for the 5-hour and 7-day windows, reset countdown
zai-coding-cn GET /api/monitor/usage/quota/limit plan level, used % for the 5-hour and weekly token windows, and the MCP tool-call quota

GLM is the odd one out and deliberately so. DSH already serves it through pi-ai's built-in
zai-coding-cn route, so this plugin contributes the quota half only — registering a route would
put a duplicate GLM in the model picker. Its numbers come from the subscription's own monitor
endpoint rather than response headers, so there is no probe request to pay for. modlens re-exposes
every pi-ai route under a modlens- prefix as a separate picker entry, and the badge treats
modlens-zai-coding-cn as the same subscription.

GLM's credential is resolved in the order that keeps the number honest — the badge has to report
the subscription the calls are actually billed to:

  1. glmApiKey in this plugin's config
  2. the ZAI_CODING_CN_API_KEY environment variable
  3. the same-named ref in $DSH_HOME/.credentials.yaml — what DSH itself calls with
  4. ~/.zcode/v2/credentials.json → oauth:bigmodel:access_token, for a local zcode sign-in

With none of those present the GLM row is skipped, exactly like a missing Codex or Claude
credential. Set glmQuota: false to switch it off outright.

The badge is green under 60%, amber under 85%, red above. Any reading older than a minute carries
its age, because a 5-hour window resets about five times a day and a stale number that looks live
is worse than none.
The browser half polls GET /llm-local-token/usage every 15s; that route only reads the
in-memory snapshot.

The badge shows only the provider serving the currently selected model: pick Codex and you see
Codex's windows, switch to Claude and it swaps — the two are never mixed into one number. When the
selected model belongs to another adapter (a plain API key, another plugin) the badge hides itself,
because that quota is not this plugin's to report. The popover still lists every route, with the
active one first, marked "current" and expanded; the rest are collapsed to a header carrying their
first two windows, and open on click. Switching model re-applies that default. The selection comes from
ctx.modelDirectories; a composition without that service (non-Web) falls back to the previous
union-of-all-routes view.

Requirements

  • Node.js 22.13+ (DSH's own floor; --use-system-ca needs it too)
  • dsh-base in the profile — it already provides @deepseek-ai/dsh-llm-pi-ai and @earendil-works/pi-ai
  • A signed-in CLI: codex login for the Codex route; Claude Code for the Anthropic route
  • The Claude Keychain lookup is macOS-only. On Linux/Windows only the file store is consulted.

Token handling

  • Read per request, never cached in memory beyond the call
  • Refreshed when less than 5 minutes of life remain, then written back to the same file the
    CLI reads, so the CLI stays logged in (single-flight: concurrent requests trigger one refresh)
  • Written atomically with 0600 permissions
  • Never logged, never sent anywhere except the provider endpoint

Troubleshooting

UNABLE_TO_GET_ISSUER_CERT_LOCALLY

Your traffic goes through a TLS-inspecting proxy (Zscaler, Netskope, corporate MITM). Node does
not trust its root CA even when the OS does. Start DSH with either:

node --use-system-ca …                          # trust the OS store (Node 22.13+)
NODE_EXTRA_CA_CERTS=/path/to/root-ca.pem dsh …  # or point at the proxy's root cert

Provider is not configured: openai-codex

Means the pi-ai provider refused an API-key override. This plugin already attaches an api-key
auth method to the OAuth-only Codex provider; seeing this error again implies a pi-ai version
whose resolveProviderAuth changed — open an issue with your @earendil-works/pi-ai version.

The model list shows no Codex/Claude entries

Check the boot log for llm-local-token: registered …. If it names only openai-codex, no
Claude credential was found (expected when Claude Code was never used on this machine).

Caveats

  • Uses your personal subscription quota (ChatGPT Plus/Pro, Claude Pro/Max). Respect the
    provider's terms; this is not a way to share one seat across a team.
  • chatgpt.com/backend-api is the Codex client's own endpoint, not a documented public API. It
    can change without notice; pin the pi-ai version if you need stability.

License

MIT

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
dsh-llm-local-token 怎么安装?

在 DSH 里执行 `dsh plugin --profile web add dsh-llm-local-token` 即可。对应的 npm 包名是 `dsh-llm-local-token`。

dsh-llm-local-token 的验证等级是什么意思?

L5 · 运行验证通过。在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来

dsh-llm-local-token 安全吗?

低风险。vet 静态分析未发现可疑行为,判定为干净(clean)。

dsh-llm-local-token 支持哪些 DSH 版本?

上游记录的兼容版本包括 0.2.0-rc.2、0.1.7-rc.2、0.1.7-rc.1、0.1.6-alpha.2、0.1.6-alpha.1、0.1.5-rc.2、0.1.3-alpha.2、0.1.3-alpha.1。版本较多,只列出前 8 个。

dsh-llm-local-token 需要什么运行环境?

Node.js >=22.13.0;需要同时安装 @deepseek-ai/cordis@^4.0.1、@deepseek-ai/dsh-llm@^0.1.0-rc.6 || ^0.1.5-rc.0 || ^0.2.0-rc.2、@deepseek-ai/dsh-llm-pi-ai@^0.1.0-rc.6 || ^0.1.5-rc.0 || ^0.2.0-rc.2、@deepseek-ai/schemastery@^3.18.1、@earendil-works/pi-ai@>=0.82.1 <1.0.0。环境不满足时安装会失败,建议先确认本机版本。

dsh-llm-local-token 用的是什么许可证?

上游标注为 MIT。商用或二次分发前请到仓库确认许可证原文。

dsh-llm-local-token 有哪些功能?

复用本地 OAuth 令牌、免 API key 登录、订阅用量徽章、缺失凭据自动跳过。

这条记录的数据可靠吗?

本站按仓库名去重后合并整理,字段以作者仓库与 npm 元数据为准;安装命令、仓库地址与 README 保持原文,带 L4 / L5 标记的安装命令已在隔离沙盒里真实跑通。

浏览器与联网
按星标排序,可作替代方案

dsh-our-free-model

dsh-our-free-model

在 DeepSeek Harness 中装上这个 DSH plugin,无需登录、注册或填 API Key,即可直接调用 DeepSeek

L3 · 安装规范通过 8,796 星

dsh-web

dsh-web

侧边栏多列任务看板:卡片交给真实 DSH 智能体会话执行,支持 cron 定时(Host 侧到点执行,关浏览器也生效)。

L3 · 安装规范通过 8,549 星

BrowserSkill

BrowserSkill

BrowserSkill 的 DeepSeek Harness 浏览器自动化桥接插件,通过原生浏览器工具控制可见的 Chrome 和 Edg

L4 · 沙盒安装通过 8,456 星

dsh-pocket

dsh-pocket

DSH Pocket 让 DeepSeek Harness 装进口袋:电脑跑 dsh web,手机扫码即实时同步访问(局域网+公网),人在外

L5 · 运行验证通过 1,656 星

Browser4

Browser4

L4 · 沙盒安装通过 1,152 星

agentrq

agentrq

L4 · 沙盒安装通过 1,140 星

tianxia-- 的其它插件

1 个

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 2026-10-08。