dsh 数据目录磁盘占用审计:总大小、按目录拆分、最大文件、超大文件告警(会话日志可达数百 MB)与清理建议——CLI + agent 可调用 disk_audit 工具,dsh-disk-audit/v1 报告,零运行时依赖、只读。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:zoahdev/dsh-disk-audit
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
Disk-usage audit for DeepSeek Harness (dsh) data directories: total size, per-directory breakdown, largest directories, oversized files and cleanup suggestions.
Session logs can grow to hundreds of megabytes (the ecosystem has even seen the ~512 MB stringify cap). This plugin tells you where the space went before it becomes a problem. Zero runtime dependencies, read-only.
Install
dsh plugin add dsh-disk-audit
Or run standalone:
npx dsh-disk-audit ~/.dsh
CLI
dsh-disk-audit [dir] [options]
--json print the machine-readable dsh-disk-audit/v1 report
--large-file <bytes> warn threshold per file (default 104857600 = 100 MB)
--skip-node-modules do not descend into node_modules trees
--help show this help
Exit codes: 0 clean, 1 warnings (oversized files / total above threshold), 2 usage/IO error.
npx dsh-disk-audit ~/.dsh
npx dsh-disk-audit ~/.dsh --json --large-file 52428800
In-harness usage (agent-callable)
Ask your dsh agent:
看看我的 dsh 数据目录占了多少磁盘,最大的文件是哪些。 Audit disk usage of my dsh data directory:
disk_audit.
The tool returns a dsh-disk-audit/v1 report:
{
"schema": "dsh-disk-audit/v1",
"target": "~/.dsh",
"ok": false,
"totalBytes": 157286400,
"totalFiles": 1842,
"dirs": [ { "dir": "~/.dsh/sessions", "sizeBytes": 146800640, "files": 42 } ],
"largestFiles": [ { "path": "~/.dsh/sessions/big.jsonl", "sizeBytes": 134217728 } ],
"warnings": ["1 file(s) at or above 100 MB"],
"suggestions": ["Export/compress the largest session logs before they hit the stringify cap"]
}
Why it exists
- Session logs are append-only and can silently eat gigabytes; no other plugin reports disk usage by directory.
- Catching a 500 MB session log before it hits the stringify cap is a lot cheaper than recovering after.
- Zero runtime dependencies, read-only by construction — it never deletes or moves anything.
Development
pnpm install
pnpm typecheck
pnpm build
pnpm test
pnpm test:integration
CI runs the dsh-plugin-doctor preflight, unit tests, packed-artifact integration (real disk_audit invocation), and a fresh-profile dsh web boot smoke on Windows.
License
MIT © 2026 zoahdev
dsh-disk-audit(中文)
DeepSeek Harness(dsh)数据目录的磁盘占用审计:总大小、按目录拆分、最大目录、超大文件与清理建议。
会话日志是追加式的,能悄悄涨到几百 MB(社区甚至见过 ~512 MB 的 stringify 上限)。本插件在你遇到问题前先告诉你空间去哪了。零运行时依赖、只读。
安装
dsh plugin add dsh-disk-audit
独立使用:
npx dsh-disk-audit ~/.dsh
CLI
dsh-disk-audit [dir] [options]
--json 输出机器可读 dsh-disk-audit/v1 报告
--large-file <bytes> 单文件告警阈值(默认 104857600 = 100 MB)
--skip-node-modules 不进入 node_modules 树
--help 帮助
退出码:0 干净,1 有警告(超大文件 / 总量超阈值),2 用法/IO 错误。
npx dsh-disk-audit ~/.dsh
npx dsh-disk-audit ~/.dsh --json --large-file 52428800
在 harness 内使用(agent 可调用)
对 agent 说:
看看我的 dsh 数据目录占了多少磁盘,最大的文件是哪些。
工具返回 dsh-disk-audit/v1 报告(结构见英文版 JSON 示例)。
为什么需要它
- 会话日志追加式增长,能悄悄吃掉几个 GB;没有其他插件按目录报告磁盘占用。
- 在 500 MB 会话日志撞上 stringify 上限之前发现它,比事后恢复便宜得多。
- 零运行时依赖、天然只读——永不删除或移动任何东西。
开发
pnpm install
pnpm typecheck
pnpm build
pnpm test
pnpm test:integration
CI 跑 dsh-plugin-doctor 预检、单元测试、打包集成(真实 disk_audit 调用)、Windows 全新 profile 的 dsh web 启动冒烟。
许可证
MIT © 2026 zoahdev
Related ecosystem tools
- dsh-dep-audit - dependency supply-chain hygiene
- dsh-quality-score - plugin quality scorecard + full-registry leaderboard
- dsh-ecosystem - health scan, impact, trend, live dashboard
- dsh-tutorials - bilingual plugin pipeline tutorials
FAQ
- How do I install? dsh plugin add dsh-disk-audit or run the CLI directly (see README).
- Does it need an API key? No.
- Is it read-only? Yes by default; any write/apply is an explicit flag.
Examples
See the README for full CLI usage. Quick start:
npx dsh-disk-audit --help
链接
同类插件
yjh051108/dsh-routing-suite★ 7001
一个仓库三件套:DSH 插件包的运行时注入器(注入、热重载、卸载、开发侧挂区一键转正、路由自愈,外带设置页插件管理:列出、卸载、拖入文件夹内化)、任务感知的思维模式路由 agent 预设(router-standard / router-spec / router-react)、以及分级两级任务协议(commit_star / lock_stage / revise_do / edit_plan / mark_task / redteam_verdict 六个工具,任务状态落盘)。注入器实现直接在库内,安装的是它自己的行为而不是一份依赖清单。
strukto-ai/mirage#dsh★ 3677
把文件系统与 bash 提供者换成 mirage 虚拟工作区:文件工具与 shell 命令作用于挂载的资源(RAM、S3、Redis、Slack、Gmail、Notion、Postgres)而非宿主磁盘,支持按挂载点设置读/写/执行模式、按命令选择沙箱(进程内 monty、pyodide、quickjs;远程 docker、e2b、daytona),并可在虚拟终端中安装 CLI(git、gh、slack、linear、ntn、gws,或自行注册的程序树)作为命令头词。
hust-open-atom-club/oh-dsh★ 325
社区发行版:TUI、桌面端与 Web UI 统一体验,分层安装、一步到位。
weijiafu14/pi2dsh★ 212
Pi Host ABI 兼容引擎:装一次之后,npm 上的 Pi 扩展原包经 `dsh plugin add <pi-package>` 直接作为 DSH 原生插件挂载。已在官方 DSH 上端到端验证 pi-mcp-adapter(完整 MCP 管理面:OAuth、resources、prompts、MCP Apps、elicitation、sampling)、@tintinweb/pi-subagents、pi-code、pi-hermes-memory、pi-background-tasks;`pi2dsh inspect` 在安装前报告一个包的兼容情况。
Fishquito7/dsh-skill-mcp-panel★ 174
在 DSH Web 设置中管理技能与 MCP 服务器:技能卡片热启停、工作区作用域、分组、批量迁移与拖拽导入,以及 stdio/HTTP MCP 增删改查、连接测试、密钥脱敏,并附带统一 dsh-panel 命令行。
lire1131/dsh-undo-savepoint★ 171
DSH 撤销/回退系统:配置变更自动存档,一键撤销/恢复/回退到任意版本,支持 WebUI 与离线 CLI/GUI 工具(DSH 启动失败也能救)。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。