
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
source-code-mgmt
Advanced tools
DSH plugin: source code management. Registers「代码管理」as a dsh-better-sidebar sidebar Tab when installed, otherwise a button in the DSH session header's right-aligned utilities (beside "Session log") opening a right-side integrated panel that pushes the main
English | 中文
版本:v1.10.0 | 更新日志见文末「版本历史」
界面语言跟随 DSH 设置实时切换:面板与 host 端消息自动使用 DSH 的语言(设置 → 通用 → 语言),中文 ↔ 英文即时生效,无需重启。
DSH Web GUI 源代码管理插件:把「环境检查 → SSH 配置 → 代码上传推送」整合进「代码管理」面板,支持 GitHub / Gitee 双平台,一键管理代码仓库。
入口位置自适应:已安装 dsh-better-sidebar 时,「代码管理」作为它侧边栏的一个新 Tab 页面出现(全新侧边栏 Tab);未安装时,「代码管理」按钮出现在 DSH 页面右上角 Session log 旁边(同一右对齐列表、同款胶囊样式、间距 8px 不挤在一起),点击后打开一个 dsh-better-sidebar 外观的右侧集成面板(推挤主内容区)。两种形态都复用同一套面板 UI,且不再占用左栏底部按钮。
集成入口(二选一,自动检测,无需手动切换):
conversation.session.header.utilities 槽位注册,与 Session log 同款胶囊样式、间距 8px 不挤在一起),点击后打开一个 dsh-better-sidebar 外观的右侧集成面板(内容放同一面板),并把主内容区往左推挤。检测只是激活时一次内存读取(
ctx.get('betterSidebar')),零 I/O、零网络,不影响 DSH 启动速度;两种形态间自动切换,不再占用左栏底部的按钮。
面板分三步:
Windows / macOS / Linux,对应底层 Node 平台标识 win32 / darwin / linux)git version 2.55.0、gh version 2.97.0)ssh 即显示「已找到」)~/.ssh/*.pub 中已存在的 ed25519 公钥——优先用 id_ed25519;否则用找到的第一个(支持任意命名的密钥,如 github_ed25519);都没有则默认名 id_ed25519。状态行显示实际检测到的密钥文件名,SSH config 的 IdentityFile 也用它github.com → ssh.github.com:443;Gitee:gitee.com 443 端口;均为 443 端口满足国内网络绕过 22 端口封锁)ssh -T git@github.com(GitHub)或 ssh -T git@gitee.com(Gitee)gh 是否已登录及账号海外用户需要 443 吗?——不需要。 「写 SSH config」是可选的(仅在你点按钮时才会写入
~/.ssh/config)。GitHub 官方标准端点就是git@github.com走 22 端口,海外正常网络开箱即用,直接跳过该按钮:生成密钥 → 把公钥贴到 GitHub → 测试连接 → 推送,全程 22 端口。443 配置(Host github.com → HostName ssh.github.com, Port 443)是 GitHub 官方支持的端口 22 封锁兜底方案,典型场景是国内网络、部分公司/校园网;写了也无害(仅当 443 也被封锁时才反而不通,极少数网络)。Gitee 是国内平台,海外用户基本只会用到 GitHub。
gh CLI,Gitee 走 Gitee OpenAPI)projects 权限)→ 保存在本机 ~/.dsh/storages/source-code-mgmt-gitee.json(0600,不写入插件目录、不回传到浏览器/日志);可一键清除;令牌无效会自动清掉~/.dsh/storages/source-code-mgmt-dirs.json,不写入插件目录,开源不泄漏个人路径),下次打开无需重新选择;手动添加的目录会以自定义目录徽标显示,末端带 ✕ 可一键删除该下拉记录(只删记录,不删实际文件夹)git status 的 XY 状态区分 staged/unstaged),并显示「已暂存 / 未暂存」标记checkoutgh 账号如 Zhucy123 名下,Gitee 平台 = Gitee 令牌账号如 Zhucy2100 名下)。这样:
deepseek-ai/deepseek-harness)不会被当作「用户自己的远程」显示,ahead/behind 也不对它计算;git init(+设默认身份),不拉取不推送,由用户自行决定下一步是拉取还是推送git add + 生成一个初始提交再创建,避免推送时报 "no commits found"
gh repo create --private|--public --source=. --pushPOST /user/repos 建仓,再设置 SSH 远程 git@gitee.com:<owner>/<name>.git 并 git push(走 ② 已配的 SSH 密钥).gitignore 的不重复添加,并显示「未上传原因」DSH 打开时不联网同步仓库,只预取静态的环境/SSH/工作区列表。打开插件、切换工作区、刷新状态、以及推送/拉取/暂存/提交等操作后,都会联网获取对应工作区的最新仓库状态,并显示「⟳ 刷新中…」提示——避免打开/重开/切换时显示可能过期的旧数据(如旧的「无改动」)。关闭面板再打开也会重新同步,不会停留在旧状态。
本插件以 Profile Bundle 形态分发:
package.json声明了dsh.bundle(携带cordis.patch.yml配置层),所以dsh plugin --profile web add一条命令装完即自动激活——无需手动编辑任何配置文件。
最省事的方式——只需一条命令,且不用先进 profile 目录,推荐给普通使用者。
在任意目录执行:
# 用 DSH 自带的插件命令(自动定位/初始化 web profile)
dsh plugin --profile web add source-code-mgmt
该命令在 web profile 目录里执行
pnpm add,成功后对账插件层:检测到本插件声明dsh.bundle,会自动把它追加进dsh.profile.bundles(见~/.dsh/profiles/web/package.json)并注册进 Cordis loader 树,一步装完即用。
装完完全重启 dsh web(不是刷新页面,而是要停掉旧进程后重新启动),然后浏览器 F5 刷新,「代码管理」入口即出现(已装 dsh-better-sidebar 时为侧边栏 Tab,未装时为右上角 Session log 旁的「代码管理」按钮 + 右侧集成面板)。
Windows (PowerShell):
# 用 DSH 插件命令安装本地源码(link: 协议,符号链接,改源码即生效)
dsh plugin --profile web add link:C:/path/to/source-code-mgmt
dsh web
Linux / macOS:
dsh plugin --profile web add link:/home/yourname/path/to/source-code-mgmt
dsh web
Windows / Linux / macOS 通用:
dsh plugin --profile web add git+https://github.com/Zhucy123/source-code-mgmt.git
dsh web
git 安装会把源码实际拷贝到 node_modules,改动源码需重新
dsh plugin --profile web add ...拉取(不像link:是符号链接、改源码即生效)。
安装并重启后,可以核对以下几点:
~/.dsh/profiles/web/package.json 的 dependencies 里应有 source-code-mgmt。~/.dsh/profiles/web/package.json 的 dsh.profile.bundles 列表里应有 source-code-mgmt(dsh plugin add 自动写入,无需手动编辑)。link: 方式):~/.dsh/profiles/web/node_modules/source-code-mgmt 指向源码目录(Windows 显示为 Junction)。| 现象 | 原因 / 处理 |
|---|---|
已 dsh plugin add 并重启,但按钮不出现 | 最常见:装完没有完全重启(不是刷新)。停掉旧 dsh web 进程再启动(旧进程还占着 3080 端口时,新实例起不来)。 |
| 安装时提示「declares no dsh.bundle」 | 装到的版本缺少 bundle 声明(旧版或打包遗漏 cordis.patch.yml)。确认版本 ≥ 1.9.0 后重新安装/更新。 |
| 出现「Failed to load plugins」 | 插件 host 端 index.js 启动报错(多为依赖解析问题)。查看启动日志,确认 node_modules 依赖已装齐。 |
| 路由 | 方法 | 说明 |
|---|---|---|
/api/source-code-mgmt/env | GET | 环境检查(git/gh 版本) |
/api/source-code-mgmt/install-tool | POST | 一键安装缺失工具(body tool: git/gh/ssh,按平台自动选包管理器) |
/api/source-code-mgmt/ssh | GET | SSH 密钥 / config / gh 登录状态 |
/api/source-code-mgmt/gen-key | POST | 生成 ed25519 密钥 |
/api/source-code-mgmt/write-config | POST | 写入 SSH config(body provider: github 默认 / gitee) |
/api/source-code-mgmt/ssh-test | POST | 测试 SSH 连接(body provider: github 默认 / gitee) |
/api/source-code-mgmt/default-dir | GET | 当前工作区目录 |
/api/source-code-mgmt/workspaces | GET | 列出所有工作区目录 + 自定义目录集合(DSH 工作区 + 插件自定义目录) |
/api/source-code-mgmt/pick-dir | POST | 宿主端弹出原生文件夹选择对话框,返回选中的路径 |
/api/source-code-mgmt/add-workspace | POST | 校验目录存在并持久化加入插件自定义目录列表,返回合并后的工作区列表 |
/api/source-code-mgmt/remove-workspace | POST | 仅删除自定义目录的下拉记录(不删实际文件夹),返回更新后的列表 |
/api/source-code-mgmt/align | POST | 强制对齐:git fetch + git reset --hard origin/<branch>,本地完全重置为远程状态 |
/api/source-code-mgmt/init-git | POST | 仅 git init + 设置默认身份,不拉取不推送(由用户决定下一步) |
/api/source-code-mgmt/repo-exists | POST | 检测同名仓库是否存在(body provider: github/gitee) |
/api/source-code-mgmt/repo?dir= | GET | 获取仓库状态(query provider: github/gitee) |
/api/source-code-mgmt/repo-diff?dir=&path= | GET | 按需返回单个改动文件的 unified diff 文本 |
/api/source-code-mgmt/stage | POST | 暂存改动(body dir、path;path 空=全部) |
/api/source-code-mgmt/unstage | POST | 取消暂存(body dir、path;path 空=全部) |
/api/source-code-mgmt/commit | POST | 用自定义信息提交(body dir、message、paths?;沿用 pushFlow 的无身份兜底逻辑) |
/api/source-code-mgmt/branches | POST | 列出分支(当前分支在前) |
/api/source-code-mgmt/checkout | POST | 切换分支(body dir、branch) |
/api/source-code-mgmt/log | POST | 最近提交历史(body dir、count?,返回 hash/subject/author/date) |
/api/source-code-mgmt/revert | POST | revert 某提交(body dir、hash) |
/api/source-code-mgmt/cherrypick | POST | cherry-pick 某提交(body dir、hash) |
/api/source-code-mgmt/commit-diff | POST | 返回某提交的完整 patch(body dir、hash) |
/api/source-code-mgmt/push | POST | 提交并推送(git 操作,平台无关) |
/api/source-code-mgmt/pull | POST | 从远程拉取更新(git pull --ff-only,已最新/成功/冲突反馈) |
/api/source-code-mgmt/merge-push | POST | 拉取并推送(git pull --rebase + git push,本地有更改且远程有更新时合并推送) |
/api/source-code-mgmt/force-push | POST | 强制推送(git push --force,覆盖远程为本地状态) |
/api/source-code-mgmt/force-pull | POST | 强制拉取(git pull --force,拉入远程更新) |
/api/source-code-mgmt/create | POST | 新建仓库并推送(body provider;GitHub 走 gh repo create,Gitee 走 OpenAPI + SSH push) |
/api/source-code-mgmt/set-visibility | POST | 修改仓库可见性(body provider;GitHub 走 gh repo edit,Gitee 走 PATCH /repos/{owner}/{repo}) |
/api/source-code-mgmt/gitee-token | GET/POST | GET:令牌是否已配置 + 账号;POST:保存({token})或清除({clear:true})Gitee 令牌 |
所有路由均为 loopback-only(sec-fetch-site + Origin 校验),仅本机浏览器可访问,LAN/手机来源一律 403——与控制面板同一策略。
process.platform 检测平台~/.ssh 通过 homedir() 定位(Windows: C:\Users\用户名\ .ssh,Linux/macOS: /home/用户名/.ssh 或 /Users/用户名/.ssh).exe)→(仅 Windows)③Git 自带目录(usr\bin / bin)回退,最后兜底用裸命令名。因此只要装了 Git,即使 ssh 不在 PATH 里也能正常工作,换设备无需额外配置。DSH_SCM_GIT / DSH_SCM_GH / DSH_SCM_SSH / DSH_SCM_SSH_KEYGENssh.exe(usr\bin\ssh.exe)在被 detached/agent 进程调用时可能报 couldn't create signal pipe, Win32 error 5,导致 git push/git pull 失败。插件执行 git 远程命令时会自动注入 GIT_SSH 指向解析到的可用 ssh(通常为系统 OpenSSH C:\Windows\System32\OpenSSH\ssh.exe),避免该问题。sudo -n;已是 root 则省略)。SSH 密钥探测、本地 Git 工作流、并排 diff 等在三个平台行为一致;「浏览目录」的原生选择器仅 Windows 可用,macOS/Linux 上请在输入框直接填路径(可手动输入粘贴)。git clone https://github.com/Zhucy123/source-code-mgmt.git
cd source-code-mgmt
# 在本地 DSH 测试(安装到 web profile,自动激活)
dsh plugin --profile web add link:$(pwd)
lib/client.js(浏览器端)→ 刷新页面即生效lib/index.js(host/Node 端)→ 需重启 dsh web本次更新:
ctx.locale 订阅实时重渲染,Tab 标题随动),无需刷新/重启;host 端按请求的 ?lang= 经 AsyncLocalStorage 按请求返回对应语言,并发不串扰。中文界面与 v1.9.0 完全一致,英文界面为完整翻译(含 >100MB 忽略原因、Gitee 令牌提示、git 命令失败回退等全部消息)。新增 tools/ 下的 i18n 提取/应用/测试脚本便于后续维护本次更新:
package.json 的 dsh.bundle 从裸字符串 "./lib/index.js" 改为对象形态 { "patch": "./cordis.patch.yml" },并新增 cordis.patch.yml(insert source-code-mgmt 行)。现在 dsh plugin --profile web add source-code-mgmt 一步装完即被自动加入 dsh.profile.bundles 并注册进 Cordis loader 树,不再需要手动编辑 cordis.patch.yml 激活;README 中「安装 ≠ 激活」说明与 PowerShell 激活脚本已删除。功能行为零变化(仍是同一份 lib/index.js host 端 + lib/client.js 浏览器端)本次更新:
chore: update <文件夹名>)提交,然后推送到远程;不会像「推送更改」那样自动暂存所有未暂存的改动。推送成功后自动刷新状态并显示「⟳ 刷新中…」,界面显示本次提交的信息与 hash。host 端新增 POST /push-staged 路由(pushStagedFlow,沿用本插件 run()/GIT_SSH)本次更新:
syncAllRepos 与「命中缓存秒显」分支本次更新:
conversation.session.header.utilities 槽位注册,出现在右上角 Session log 旁边的右对齐列表里(与 Session log 同款胶囊样式、间距 8px 不挤在一起);点击后在右侧展开一个 dsh-better-sidebar 外观的集成面板(复用原话术:环境检查 / SSH / 代码管理三步),并把主内容区 #root 往左推挤(margin-right + width calc)。slots 服务不可用时降级为右上角浮动按钮 + 右侧面板。改动仅限 lib/client.js(浏览器端),刷新页面即生效,host 端 /api 路由未动本次更新:
POST /install-tool 路由(best-effort,回传执行命令与输出)sudo -n(已是 root 则省略,避免权限失败挂起);decodeSessionDir 按平台区分 Windows 盘符路径与 POSIX 绝对路径,macOS / Linux 下也能正确从 session 目录还原工作区本次更新:
~/.ssh/*.pub 中的 ed25519 公钥——优先用 id_ed25519,否则用找到的第一个(支持任意命名密钥);都没有才用默认名 id_ed25519 新建。② 状态行显示实际检测到的密钥名,SSH config 的 IdentityFile 也用它,有自定义命名密钥也能正确识别、配置并推送本次更新(补齐本地 Git 工作流,未改动远程同步逻辑):
② SSH 默认折叠 + 标题行切平台:② SSH 部分默认折叠,标题行内嵌「平台」下拉(折叠时也能切),切换后自动展开该部分以继续配置,③ 跟随平台
选择性暂存 + 自定义提交信息:「改动」弹窗每个文件行新增暂存 / 取消暂存按钮(按 git status --porcelain 的 XY 状态区分 staged/unstaged),并显示「已暂存 / 未暂存」;③ 面板仓库名上方新增提交信息输入框 + 「提交」按钮,提交不再用固定 chore: update workspace via DSH...(留空则自动生成基于文件夹名的信息);沿用 pushFlow 的无身份兜底逻辑
分支切换 + 提交历史 + revert / cherry-pick:「分支」行旁新增「切换」(弹窗列出分支,点选 checkout)与「历史」(弹窗列出提交,每条可「查看」「revert」「cherry-pick」——后两者带确认框)
真·并排 diff:把 unified diff 解析成(旧行/新行)配对,左右两栏渲染(删除行红底、新增行绿底);改动文件展开与历史点某提交(/commit-diff)都用并排视图;保留纯文本 renderDiff 作降级(二进制/无法解析时)
「查看改动」秒出:加载仓库状态时后台并发预取所有改动文件的 diff(并发≤3、纯本地 git 读取)并缓存,点开文件行立即显示,不再等「加载中…」
提交历史右键菜单:「历史」弹窗每条提交可点**「⋯」或右键**打开菜单——查看提交差异、复制短哈希、复制完整哈希、复制提交信息、还原此提交(revert)、拾取此提交(cherry-pick,后两者带确认框)
本地 Git 功能按 better-sidebar 自适应隐藏:已安装并激活 dsh-better-sidebar 时,③ 面板隐藏本插件自带的本地 Git 工作流(暂存/取消暂存、自定义提交、分支「切换」、提交「历史」+ revert/cherry-pick、并排 diff),因为这些能力 better-sidebar 的 Git 面板已覆盖,避免重复;此情况下「查看改动」弹窗只列改动文件,并提示具体改动内容请到 dsh-better-sidebar 的「源代码管理 / Git 面板」查看;未安装时则展示完整本地 Git 功能
host 端新增 /stage /unstage /commit /branches /checkout /log /revert /cherrypick /commit-diff 路由(全部走 isLoopbackRequest 校验 + run()/GIT_SSH)
本次更新:
ctx.betterSidebar.registerTab 把「代码管理」注册为该侧边栏的一个新 Tab 页面;未安装时,在 DSH 页面右上角显示一个浮动按钮,点击展开右侧栏抽屉(形态类似 dsh-better-sidebar 的右栏),内容为同一面板ctx.get('betterSidebar')),零 I/O、零网络,毫秒级,不影响 DSH 启动;并对激活顺序做了兜底延迟重试,保证最终落在正确的形态sidebar.footer.action 插槽注册触发按钮;ScmPanel 支持 variant(tab / drawer)以分别适配侧边栏 Tab 与右侧抽屉布局,面板 UI 与 host 端 /api 路由完全复用、未改动本次更新:
-、新增行绿色带 +、上下文灰色;untracked 新文件无 diff 只列名称(后端对每个改动文件追加 git diff/git diff --cached 内容)本次更新:
git@github.com:...」的问题;本地没有对应平台远程时显示「(无)」且不计算同步github.com/gitee.com 域名匹配远程,导致 deepseek-ai/deepseek-harness 这类别人的远程被当成用户自己的远程显示、还能点「推送更改」。现在校验远程 owner 必须等于当前登录账号(GitHub=gh 账号、Gitee=令牌账号),不属于自己的远程一律不算,界面回到「同名仓库检测 + 新建仓库」形态;同时无远程时「同步」行显示「(无)」,不再误显示「与远程一致」git pull --ff-only,而是复用「强制对齐」的 git fetch + git reset --hard origin/<branch> 逻辑——本地干净没有可丢失的改动,reset 等同快速前进到远程最新,且不弹确认框直接执行,结果更可靠(可绕过 rebase/merge 常见失败场景)git fetch + git reset --hard,本地完全重置为远程),与用户实际想要的「一键对齐」一致setErr 再刷新仓库状态,随后 loadRepo 把错误提示无条件清空,导致失败时结果被立即抹掉、界面像什么都没发生;现在错误/结果会保留显示(切换目录 / 切换平台 / 手动刷新状态仍会清空旧提示),对齐失败等也能看到真实原因本次更新:
github.com → ssh.github.com:443;Gitee:gitee.com 443)ssh -T git@github.com / ssh -T git@gitee.comcurl 调用),令牌在 ③ 输入并保存到本机 ~/.dsh/storages/source-code-mgmt-gitee.json(0600),可清除GET /repos/{owner}/{name};可见性读取/修改:Gitee GET/PATCH /repos/{owner}/{name}POST /user/repos 建仓 + SSH 远程 git@gitee.com:<owner>/<name>.git 推送本次更新:
Windows / macOS / Linux(对应底层 win32 / darwin / linux)首发版本,包含以下功能与修复:
git / gh / ssh / ssh-keygen 按 ①环境变量覆盖 → ②PATH 查找 → ③(仅 Windows)Git 自带目录回退 自动定位,换设备无需额外配置,即使 ssh 不在 PATH 也能工作gh 报 "no commits found"100MB 文件自动忽略(整目录或单文件)并显示未上传原因
MIT
FAQs
DSH plugin: source code management. Registers「代码管理」as a card in DSH's OWN right sidebar (the official guide page, beside 工作区文件 / 新建终端 / 浏览器) and as a tab page in that column — there is no separate button. Older hosts degrade gracefully: dsh-better-sidebar
The npm package source-code-mgmt receives a total of 7 weekly downloads. As such, source-code-mgmt popularity was classified as not popular.
We found that source-code-mgmt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.