gaolei-mark43/dsh-github-bridge0

dsh-github-bridge

DSH plugin: connect DSH/dwsh to GitHub — OAuth device-flow login plus github_* tools (repos, issues, PRs, files, search) and a config-page auth card. / 连接 DSH 与 GitHub 的插件:OAuth 登录认证 + github_* 工具(仓库、issues、PR、文件、搜索)与配置页认证卡片。

包名
dsh-github-bridge
版本
0.1.1
许可证
MIT
最近更新
2026年8月17日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:gaolei-mark43/dsh-github-bridge

如何配置

插件的所有配置都放在插件自身、手动配置,有两个入口:profile 的 cordis.patch.yml(或 --patch 覆盖层),以及配置页面(设置 → 插件 → dsh-github-bridge 卡片,OAuth 相关项可直接在页面上填,无需重启):

方式一:配置文件(cordis.patch.yml)

- id: github-bridge
  config:
    # GitHub OAuth App 的 Client ID。登录认证(设备码流程)必需。
    # 在 https://github.com/settings/applications/new 创建,勾选
    # "Enable Device Flow"。设备码流程不需要 client_secret。
    # 也可以直接在配置页面上填写,二选一。
    clientId: Iv1.xxxxxxxxxxxxxxxx
    # OAuth 权限范围(空格分隔),默认 "repo"。
    #   repo        —— 完全控制私有+公开仓库(默认,权限最大)
    #   public_repo —— 只读写公开仓库(最小权限,更安全)
    #   workflow    —— 修改 GitHub Actions 工作流文件(repo 不含它)
    #   例:repo read:user workflow
    scopes: repo
    # OAuth 主机,默认 https://github.com(GitHub Enterprise 时改)。
    oauthBaseUrl: https://github.com
    # 令牌存储用的 DSH 凭据引用 / 环境变量名。
    tokenEnv: GITHUB_TOKEN
    baseUrl: https://api.github.com
    # 可选:不给 owner/repo 参数时的默认值。
    defaultOwner: my-org
    defaultRepo: my-repo

方式二:配置页面(设置 → 插件 → dsh-github-bridge)

  1. 卡片上的 OAuth 客户端(Client ID) 输入框填入你的 Client ID(如 Ov23li...),点 保存——立即生效,无需改文件、无需重启;
  2. 权限范围(scopes)同理,在旁边的输入框里填(如 public_repo)后保存;
  3. 卡片上的"手动粘贴令牌"框只接受访问令牌ghp_… / github_pat_…), Client ID(Iv1.… / Ov23li…)不是令牌,粘进去会被明确拒绝。

配置页面填入的值存放在 DSH settings 命名空间中,优先级高于 patch 层配置; 清空某字段则回退到 patch 层的值。

defaultOwner / defaultRepo 是可选便利项;不填时工具要求显式给出 owner / repo 参数。

方式一:配置文件(cordis.patch.yml)

- id: github-bridge
  config:
    # GitHub OAuth App 的 Client ID。登录认证(设备码流程)必需。
    # 在 https://github.com/settings/applications/new 创建,勾选
    # "Enable Device Flow"。设备码流程不需要 client_secret。
    # 也可以直接在配置页面上填写,二选一。
    clientId: Iv1.xxxxxxxxxxxxxxxx
    # OAuth 权限范围(空格分隔),默认 "repo"。
    #   repo        —— 完全控制私有+公开仓库(默认,权限最大)
    #   public_repo —— 只读写公开仓库(最小权限,更安全)
    #   workflow    —— 修改 GitHub Actions 工作流文件(repo 不含它)
    #   例:repo read:user workflow
    scopes: repo
    # OAuth 主机,默认 https://github.com(GitHub Enterprise 时改)。
    oauthBaseUrl: https://github.com
    # 令牌存储用的 DSH 凭据引用 / 环境变量名。
    tokenEnv: GITHUB_TOKEN
    baseUrl: https://api.github.com
    # 可选:不给 owner/repo 参数时的默认值。
    defaultOwner: my-org
    defaultRepo: my-repo

方式二:配置页面(设置 → 插件 → dsh-github-bridge)

  1. 卡片上的 OAuth 客户端(Client ID) 输入框填入你的 Client ID(如 Ov23li...),点 保存——立即生效,无需改文件、无需重启;
  2. 权限范围(scopes)同理,在旁边的输入框里填(如 public_repo)后保存;
  3. 卡片上的"手动粘贴令牌"框只接受访问令牌ghp_… / github_pat_…), Client ID(Iv1.… / Ov23li…)不是令牌,粘进去会被明确拒绝。

配置页面填入的值存放在 DSH settings 命名空间中,优先级高于 patch 层配置; 清空某字段则回退到 patch 层的值。

defaultOwner / defaultRepo 是可选便利项;不填时工具要求显式给出 owner / repo 参数。

在配置页面登录(设置 → 插件 → dsh-github-bridge)

  1. 确认 clientId 已配置(见上);
  2. 打开 设置 → 插件,展开 dsh-github-bridge 卡片;
  3. Login with GitHub:卡片显示验证 URL 和一次性代码,并自动轮询;
  4. 打开 URL、登录、输入代码。授权后卡片显示已登录用户;点 "Sign out" 清除令牌。

也可以在同一个卡片上手动粘贴令牌("保存令牌")。