前言¶
DSH 的理念是“一切皆插件”,能力可以按插件方式加入。社区目录是独立站点,与 DeepSeek / 幻方无官方从属关系,不应理解为官方应用商店。
对使用 DSH 的开发者来说,一个具体需求是:已经有 GitHub Copilot 订阅,希望把订阅里的模型放进 DSH 的模型选择器中用于聊天与推理,但不想额外安装 Copilot CLI,也不想让 Copilot 的工具在本地执行。
下面介绍 dsh-copilot-sdk。它桥接 GitHub Copilot 订阅到 DeepSeek Harness,注册一个 copilot provider,并保留上游 @github/copilot-sdk 的 SDK 库、文档、样例和测试套件。
这是什么¶
dsh-copilot-sdk 是由 GongYuanCaiJi 维护的 DSH 插件。它是 @github/copilot-sdk 的 DSH 移植,用于把 GitHub Copilot 订阅作为模型池接入 DSH。
插件与上游版本信息如下:
plugin: dsh-copilot-sdk
upstream: @github/copilot-sdk
pinned version: 1.0.11
commit: 18002a81
许可证方面,dsh-copilot-sdk 为 MIT,上游 github/copilot-sdk 亦为 MIT。
核心功能¶
下面列出的能力均来自已核实事实。
- 注册
copilotprovider,把 GitHub Copilot 订阅作为模型池。 - 在模型选择器中可使用以下订阅模型:
copilot / gpt-5copilot / claude-sonnet-4.5copilot / deepseek-r1- SDK 自带 Copilot CLI runtime,无需单独安装 CLI。
- 认证可使用已有 GitHub 登录、token 或 BYOK。
- 纯聊天桥接:桥接层拒绝 Copilot 工具执行请求。
- 支持 assistant 文本与 reasoning 流式输出。
- 提供以下 DSH 侧命令:
/copilot status/copilot models/copilot stop- SDK 库、docs、samples、测试套件 100% 逐字移植自上游。
安装与启用¶
dsh-copilot-sdk 尚未发布到 npm,需要从 GitHub 或本地目录安装。
如果从 GitHub 安装,先执行下面命令:
dsh plugin --profile <你的-profile> add github:GongYuanCaiJi/dsh-copilot-sdk
如果从本地目录安装,先准备好插件目录,再执行下面命令:
dsh plugin --profile <你的-profile> add /path/to/dsh-copilot-sdk
安装后重启 dsh。插件按需拉起 Copilot CLI;首次模型调用或执行 /copilot status 时会启动。
如果环境使用 pnpm,并且安装时报 allowBuilds 错误,通常是 pnpm 默认阻止 git 安装的 prepare 构建脚本。处理方式是:把 pnpm 打印的精确 key 加进 profile 的 pnpm-workspace.yaml 的 allowBuilds,再重试。可以按下面形式写入,具体 key 以 pnpm 输出为准:
# pnpm-workspace.yaml
allowBuilds:
- <pnpm 打印的精确 key>
典型用法¶
安装并重启后,有两种常见用法。
- 在 DSH 会话的模型选择器中选择
copilotprovider,然后选择其中的订阅模型。 - 在 agent 配置里指定
provider: copilot和具体模型 id。具体模型 id 取决于你的 Copilot 订阅可用模型,可先使用/copilot models查看。
DSH 侧可用命令如下:
/copilot status
/copilot models
/copilot stop
说明:/copilot status 用于查看连接状态;/copilot models 用于列出可用模型;/copilot stop 用于停止 Copilot CLI runtime。
如果暂时没有 Copilot 订阅,也可以按 BYOK 方式使用,在 session/agent 配置里指定自己的 API key。
适用场景与注意¶
适合的场景:
- 已有 GitHub Copilot 订阅,包括免费额度档,希望把订阅模型接入 DSH。
- 希望 DSH 中可以直接调用
copilot / gpt-5、copilot / claude-sonnet-4.5、copilot / deepseek-r1等模型。 - 只需要聊天与 reasoning 输出,不需要 Copilot 的工具执行。
需要注意:
- 需要 GitHub Copilot 订阅,除非使用 BYOK。
- 每次模型调用对应一次性 Copilot 会话;每次 prompt 计入 Copilot 用量。
- 桥接层拒绝所有权限请求,Copilot 只作为聊天模型回答,不执行工具。
- 遥测代码逐字保留,但桥接层默认不发送;若自行构造
CopilotClient并启用,则以上游行为为准。 - 插件会在当前
dsh进程权限下运行,安装前应检查源码、依赖和许可证。
结尾¶
dsh-copilot-sdk 的价值在于把已有的 GitHub Copilot 订阅作为 DSH 的聊天模型池接入,同时保持纯聊天桥接和明确的命令入口。
GitHub 仓库地址:
https://github.com/GongYuanCaiJi/dsh-copilot-sdk
也可以在 DSH 插件目录中按插件名 dsh-copilot-sdk 查找。