Per-workspace closet for temporary scripts and their run logs, kept in a .dsh-fix directory inside each project. Registers a script with its language and purpose, scans a project for leftover scratch scripts, backups and log files, runs registered scripts with a timeout and writes each run to a timestamped log, and sweeps chosen files into a reversible trash with per-batch restore. Scanning only lists and never deletes; cleanup moves files instead of deleting them; files already tracked by git are refused unless forced. Ships 7 agent tools and a settings panel.
Install
# from npm (prebuilt)
dsh plugin --profile web add yuezhiye-dsh-closet
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:yuezhiye/dsh-closet
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
Temporary script & log manager for DSH (DeepSeek Harness): register scripts per workspace, scan leftovers read-only, sweep them into a restorable trash.
中文 | English
DSH sessions leave a trail of one-off scripts and logs — fix-xxx.ps1, upgrade-xxx.ps1, restart-dsh.log, *.bak. Nobody remembers which ones still matter. Closet gives them one drawer: registered entries are on the ledger, unregistered ones get scanned and reported, and anything swept goes to trash first — always restorable.
Three rules
- Per workspace — data lives in
<workspace>/.dsh-fix/, never in your home directory. - Scan never deletes —
closet_scanonly reports, with reasons. - Clean only moves — swept files go to
.dsh-fix/trash/<batch>/with amanifest.jsonholding their original paths. Real deletion has exactly one entry point: expiry, default 30 days, dry-run by default.
Layout
<workspace>/
└── .dsh-fix/
├── registry.json # path / language / purpose / status / run count
├── logs/<script-name>/ # full output per run, one file per timestamp
└── trash/<batch>/ # manifest.json + the moved files
Tools
| Tool | What it does | Writes? |
|---|---|---|
closet_workspaces |
List the workspaces DSH already knows about (id, path, title, session count), so the AI can pick one instead of guessing a path | no |
closet_register |
Register a script: path, purpose, language, status | ledger only |
closet_list |
List the ledger, flag entries whose file is gone | no |
closet_scan |
Scan the workspace for leftovers with reasons; skipTracked: true hides git-tracked files entirely |
no |
closet_run |
Execute a registered script, capture output to a log | log only |
closet_clean |
Move listed files into trash (restorable); git-tracked files are rejected unless force: true |
moves |
closet_trash |
Inspect batches; expire: true prunes old ones (dry-run first) |
only on expiry |
closet_logs |
List a script's logs, or tail one | no |
There is also a GUI panel under Settings → Scripts & Logs. The scan table's header checkbox selects all sweepable files at once (git-tracked files are excluded, since they cannot be swept) and shows an indeterminate state when only some rows are checked.
Languages
powershell (.ps1 .psm1 .psd1), node (.js .mjs .cjs .ts), python (.py), batch (.bat .cmd), shell (.sh .bash .zsh). Interpreters are configurable.
Configuration
dsh-closet:
enabled: true
dataDir: .dsh-fix
trashRetentionDays: 30
ignore: [] # extra names or globs, e.g. ['*.bak', 'build']
maxScanFiles: 5000
maxScanDepth: 64
runTimeoutMs: 120000
maxLogBytes: 2097152
maxCleanBatch: 200
maxCleanBytes: 209715200
interpreters: {} # { python: ['C:\\Python312\\python.exe'] }
An ignore entry that cannot be parsed is dropped rather than treated as "ignore everything", so a bad config can only make scans noisier, never silently empty.
Safety
- No accidental deletion — clean only moves; the single deletion path is expiry, which defaults to dry-run.
- No escapes — only files inside the workspace are touched;
..traversal, case variants and symlink/junction indirection are all rejected (literal and real-path checks). - No runaway scans —
node_modules/.gitare skipped, symlinks are not followed, depth and file counts are capped. - No corrupt ledger —
registry.jsonis written atomically; a damaged file is renamed aside before rebuilding. - No hung scripts — timeouts kill the whole process tree (
taskkill /Ton Windows, process group on POSIX). - No shell injection when opening files —
/openspawnscommandwith an argv array, never a shell string; the path must pass three gates (literal inside the workspace → real path still inside → file exists). The default action is reveal (select in Explorer), not execute.
Development
npm test # 129 unit cases + 21 end-to-end smoke checks + docs consistency; zero dependencies
npm run test:unit
npm run lint:syntax
store / scan / run / trash do not depend on DSH and can be used and tested standalone. lib/client.js is a hand-written window.__ModuleLoader__ CJS factory — no bundler needed, and edits hot-reload. Changes to lib/index.js, package.json or cordis.patch.yml require a DSH restart.
License
MIT
Links
More in this category
Tencent/WeKnora#dsh-weknora★ 38796
Four read-only tools over a WeKnora knowledge base: list knowledge bases, hybrid passage search, reassemble one document's chunks in order, and WeKnora's own cited RAG or ReAct-agent answer with a resumable session id.
DayuanJiang/next-ai-draw-io#dsh-plugin★ 37348
Draws draw.io diagrams in DeepSeek Harness through the next-ai-drawio MCP server: the link in the reply opens a live preview in the right sidebar, you can edit the diagram by hand, and each AI change is a version you can restore. Node.js 18+; npx downloads the MCP server on first use.
yikart/AiToEarn#dsh-plugin-aitoearn★ 29024
Generate copy, images and short videos, and publish with one click to Douyin, Kuaishou, Xiaohongshu, WeChat Official, Bilibili, Facebook, TikTok and more, covering the full content lifecycle from creation to publishing and monetization.
superdesigndev/treg★ 10192
Tool catalog for agents: search ~2,600 external endpoints (SEO and SERP, backlinks, social, people and company enrichment, ad libraries, scraping) by the task you want done, read each one's parameters and per-call price, then call it with the credential injected server-side. Ships the skill plus an MCP row that stays disabled until TREG_TOKEN is set.
T-Auto/dsh-ops★ 6129
Provides bash, PowerShell 7, and high-performance Rust tools for DSH on Windows to reduce token usage.
Hithink-Tech-Org/Financial-API#hithink-finance★ 4796
Query Hithink Finance data in DeepSeek Harness, view charts in chat, and save refreshable dashboards.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.