chumoe/dsh-file-manager: Replace the DSH sidebar with an editable workspace file manager

Introduction

When coding with DSH, the “Workspace Files” panel on the right sidebar usually only lists directories, allowing you to peek inside. To see the actual rendered effect of a Markdown file, you have to paste the content into the chat; to edit a file, you have to paste the whole segment out and ask the agent to write it back; to compress, decompress, or pack for upload, you basically have to switch back to the terminal. With deep directories, you have to click up in the path repeatedly.

This plugin targets these specific steps.

What is this

chumoe/dsh-file-manager is a DSH client plugin, maintained by chumoe, categorized as “Client”. It replaces the body and title of the Workspace Files panel in the DSH right sidebar, providing browse, preview, edit, create, rename, copy, move, delete, compress, decompress, upload, and download, and hands files to the chat as real composer chips.

Its approach is not a patch: the built-in @deepseek-ai/dsh-client-ui-sidebar-files panel is a read-only list, and this bundle registers a replacement on the same batch of slot keys with priority: -10. When the plugin is enabled, it wins; when disabled, the original panel returns, and no files are modified or deleted.

Basic prerequisites: Node ≥ 22. Additionally, compression, decompression, and directory packaging/download rely on the system’s zip, unzip, and tar. The plugin has no configuration items—no settings to fill out.

Core Features

Directory Browsing

It only shows one level of directory at a time; the list is always items of the current folder, and breadcrumbs and the list won’t conflict. Entering a folder can be done by double-clicking, pressing Enter, clicking the row start arrow, or clicking breadcrumbs; ArrowLeft goes back up. Single-clicking only selects, it doesn’t swap the list under the pointer. Ctrl/Cmd and Shift allow multi-select; the action bar that appears after selection is placed below the list, and selecting a row doesn’t move the row.

Search is the only cross-directory mode: it filters across all loaded directories, preserving the ancestor levels of hits and presenting them as an indented tree. The jump menu in the toolbar can switch the panel’s root directory; session workspace, home directory, Desktop/Downloads/Documents, /tmp, and / are all in the list, and any absolute path works, so the panel won’t be stuck in a single workspace.

Preview and Edit

Images, PDFs, videos, audio, and text are previewed inline in the panel; other binaries fall back to metadata with a download button.

Markdown uses the host’s built-in renderer—the same component as the chat body. Headings, lists, tables, task lists, blockquotes, and highlighted code fences are consistent with the message, and the toolbar switch can toggle a single file back to highlighted source code. Images with relative paths are resolved based on the directory containing the file; documents over 200 KB stop directly at the source view to avoid freezing the panel.

HTML rendering happens in a sandbox="" frame: styles and images display, while scripts, forms, and redirects are rejected by the browser itself; relative src/href/poster are rewritten to an authenticated download route, and root absolute paths remain unchanged.

Both preview and editor have line numbers; syntax highlighting doesn’t rely on third-party libraries. The built-in tokenizer covers C-family languages, Python/Ruby/Shell/Lua, YAML/TOML/INI, SQL, CSS/SCSS/Less, JSON, HTML/XML/Vue/Svelte, and Markdown. Colors use theme aliases to follow light/dark themes; files over 80 KB fall back to plain text. Editing happens on the highlight layer using a transparent textarea for synchronized scrolling; Ctrl+S saves, Tab inserts two spaces. When a file is changed externally, a conflict prompt pops up instead of silent overwriting, and files with a text limit exceeding 2 MB are opened as read-only.

File Operations and Context Menu

New file, new folder, rename (F2), delete (Del), and copy/cut/paste (Ctrl+C / X / V) are all available. Upload supports files and whole folders, and drag-and-drop works too. Download gets the blob via fetch and saves it via a same-origin anchor; it works the same when the Web UI is mounted behind the gateway prefix. You can download single files, whole folders (packed as zip), or multi-select (packed as one zip). Compression supports ZIP and tar.gz, and decompression of ZIP/tar/tar.gz happens next to the archive.

The right-click menu covers three areas: directory tree, preview, and editor. Inapplicable items are simply not shown instead of being grayed out—no copy without selection, and no paste if the clipboard is unavailable. The menu provides Copy Relative Path, Copy Absolute Path, and Copy Filename; when multi-selecting, one path is listed per line.

Joining Chat with a Chip

“Join Chat” generates a composer chip the same as selecting a file with @. The whole draft is rewritten via a draft snapshot {text, references}, which is the only way to make the composer rebuild chip nodes; existing chips shift as a whole during editing, so previously added files won’t disappear. The cursor range does coordinate conversion before concatenation, and if the result is still rejected by the composer, the entire edit is replanned, so the second addition won’t be inserted inside the first chip. Below the directory tree is a row of chip-style markers mirroring each file currently attached to the chat; the composer treats clicking a chip as “Open File” instead of “Remove,” so this is where the removal entry is.

Installation and Enabling

The plugin isn’t published to the registry; the install path is the local directory or the checked-out clone. --profile is required and must come before add; use web for the browser interface.

To install from a local directory:

dsh plugin --profile web add /absolute/path/to/dsh-file-manager

Or use the plugin management tool, which has the same effect and registers the bundle in the profile:

plugin_manager  action: install_bundle  target: /absolute/path/to/dsh-file-manager

To install from GitHub, first clone then add the checkout:

git clone https://github.com/chumoe/dsh-file-manager.git
dsh plugin --profile web add "$PWD/dsh-file-manager"

Both ways add dependencies and register the bundle to dsh.profile.bundles; the rest is just restarting. Restart the Web UI (or let HMR catch up), open the right sidebar → Workspace Files to see the replaced panel; removing or disabling dsh-file-manager in the plugin list restores the built-in panel.

Typical Usage

The panel opens in the session’s workspace directory, and you can also rename the root directory from “More Actions → Jump To” in the toolbar. After selecting a few photos in the directory and clicking “Join Chat,” they appear as chips in the input box; after sending, the agent gets file references rather than a segment of path text.

To edit a config file in the panel: open .yaml or .toml, the source view has highlighting and line numbers, and save with Ctrl+S after editing; if the same file was edited in the terminal simultaneously, the panel will show a conflict prompt instead of overwriting. To restore the original panel, just disable this bundle in the plugin list.

Applicable Scenarios and Notes

It is suitable for those who run DSH themselves and want to perform viewing and modification operations directly in the browser interface, especially in scenarios requiring frequent switching between multiple workspaces, download directories, and log directories.

A few points to note:

  • The plugin runs with the permissions of the current DSH process. Routes are registered via ctx.connection.fetch.register and inherit the Host’s login Cookie, Origin, and Host validation. It can open any existing absolute directory as the root, which is a design choice favoring local resources and also means it is not a security boundary.
  • Restrictions still apply below the root: relative paths are normalized (empty, . and .. segments are rejected, backslashes are unified, leading / is stripped), symbolic link targets are checked with realpath, and the result must still be within the root. Upload automatically takes unique filenames, writing is a temporary file plus atomic rename, and text/HTML/JS downloads force text/plain + nosniff and add CSP: sandbox.
  • Server-side limits are only to prevent accidental freezing of the panel: JSON request body 32 MB, editable text in panel 32 MB, 20000 items returned per directory (returns truncated if exceeded), upload 8 GB.
  • It is recommended to check the source code and license (MIT) before installing. Compression and decompression rely on the system’s zip, unzip, and tar; these operations are unavailable if missing.

Summary

The value of this plugin lies in keeping file operations like “peek, tweak, pack and go” in the sidebar instead of going to the terminal or repeatedly pasting content into the chat. It doesn’t modify host files; uninstalling restores the original panel. There are no configuration items, and the maintainer’s README provides a complete explanation of the security model and routing.

Directory page: https://www.skillhub.cn/plugins/chumoe/dsh-file-manager
GitHub: https://github.com/chumoe/dsh-file-manager

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye