npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-cmdgo-provider

v0.3.0

Published

CommandCode Go 套餐供应商:/alpha/generate CLI 网关(官方 CLI 指纹伪装)接入 DSH 模型列表 + OAuth 登录(多账号池轮询/故障转移)

Readme

dsh-cmdgo-provider

CommandCode Go 套餐($1/mo)供应商插件:把只能用 cmd CLI 的 Go 订阅接入 DSH 模型列表,并把 cmd login 的 OAuth 登录提取成设置页里的专用登录选项。

背景

Command Code 的订阅分两种:

  1. Provider API:标准 OpenAI/Anthropic 兼容端点,任何 harness 可直连。
  2. Go / GOAT / Pro 套餐:调 Provider API 返回 403 upgrade_required,只能走 CLI 私有网关 POST /alpha/generate(自定义信封)。

本插件针对第二种情况。

安装

# npm(推荐)
dsh plugin --profile web add dsh-cmdgo-provider

# 或从 GitHub 安装
dsh plugin --profile web add github:Ajwyunsx/dsh-cmdgo-provider

安装写入 profile 的依赖与 bundles 列表,重启 harness 后由 bundles 正常装配。装完:

  1. 「Models」页选择 Command Code Go 供应商及模型;
  2. 「设置 → CommandCode Go」生成登录地址,浏览器授权后回调自动写入凭据。

功能

  • 供应商注册:启动后自动从 /provider/v1/models 拉取模型目录并按 Go 套餐规则筛选(开源模型 + 少量 premium 例外),定时刷新;reasoning effort 从官方 CLI catalog 合并。装完即可在 Web「Models」页选择 Command Code Go 供应商。
  • OAuth 登录:设置页新增「CommandCode Go」分区:
    1. 第一个选项是登录地址——点击「生成登录地址」,host 在 127.0.0.1:5959..5968 起本机回调服务器,拼出 https://commandcode.ai/studio/auth/cli?callback=…&state=…
    2. 「打开登录页」→ 浏览器完成授权;
    3. Studio 页面 POST {apiKey, state, userId, userName, keyName} 回本机 /callback,state 校验通过后 API Key 自动写入凭据存储(默认 COMMANDCODE_API_KEY),面板显示等待回调 → 已登录。
  • HTTP APIGET /api/cmdgo/statusPOST /api/cmdgo/login|cancel|logout

多账号池(0.2.0+)

反代支持池化多个 Command Code 账号,摊薄单账号额度:

  • 入池:设置页每完成一次 OAuth 登录,新 key 自动成为池中一个独立账号(凭据存储按账号分 ref,清单在 ~/.dsh/cmdgo-accounts.json);重复登录同一 key 只刷新标签。升级无缝:既有单 key 自动收编为 default 账号。
  • 调度:请求级 round-robin;某账号失败(401/403/429/5xx/传输错误)按指数冷却(30s 起,封顶 15min)并当次请求内自动切换下一账号(首字节前才允许换号,绝不重放半截回答)。网关接受即清除该账号失败计数。
  • 管理:状态接口新增 accounts / activeAccountsPOST /api/cmdgo/account/toggle|remove 启停与移除单个账号,/logout 改为清空整个账号池。

协议实现

请求信封与流式解析对齐官方 CLI(x-command-code-version、NDJSON 事件流 text-delta / reasoning-delta / tool-call / finish-step)。请求指纹完整复刻官方 cmd CLI(v1.31.0 实测还原):User-Agent: commandcode/<version> + x-command-code-version / x-cli-environment: production / x-taste-learning / x-session-id / x-project-slug,反代流量与 CLI 本体在网关上不可区分,参考了 MAXeaglet/commandcode-proxysynthetic-coworkers/cmdcode2apijiesou/dsh-commandcode-go-provider

配置

| 配置项 | 默认 | 说明 | | --- | --- | --- | | apiKeyEnv | COMMANDCODE_API_KEY | 凭据引用(登录成功后自动写入) | | baseURL | https://api.commandcode.ai | 网关 base URL | | maxTokens | 64000 | 单次输出上限 | | defaultContextWindow | 1000000 | 模型无精确上下文时的兜底 |

排错

  • 装完不显示dsh plugin add 只写 profile 清单,运行中的 loader 需要重启(或热装配工具)才会加载;另外检查 ~/.dsh/profiles/web/cordis.patch.yml 是否残留同 id 的 disabled: true 条目——卸载器会写它阻断自装配,重装前应删除。
  • 模型列表为空:目录来自 https://api.commandcode.ai/provider/v1/models(免鉴权),检查宿主网络;首次扫描失败会在日志告警并每 15 分钟重试。
  • 对话报 MISSING_CREDENTIAL:先到「设置 → CommandCode Go」完成登录,或手动向 ~/.dsh/.credentials.yaml 写入 COMMANDCODE_API_KEY: user_xxxx
  • 回调收不到:回调服务器绑定在宿主 127.0.0.1:5959..5968;若浏览器与宿主不同机,需保证 localhost:<port> 能回到宿主(端口转发/SSH 隧道)。

非官方插件,仅限个人使用;请遵守 Command Code 服务条款。