DeepSeek Harness’s web GUI provides plugin extensibility, but fine-tuning or debugging for specific interfaces often requires writing dedicated plugins. The dsh-snippets plugin addresses the need to manage these CSS and JavaScript snippets, allowing quick, reusable interface adjustments without modifying the Harness source code.
Core Features¶
This plugin provides the web GUI with a centralized snippet management panel, with the following capabilities:
- Snippet Management: Manage code via CSS and JS tabs, supporting search (title or code), add, edit, copy, delete, and drag-and-drop reordering.
- Code Editing: Integrates the CodeMirror 6 editor, with line numbers, syntax highlighting, bracket matching, code folding, and search/replace. Real-time preview is available when editing CSS.
- File Watching: Supports watching
.cssand.jsfiles in local folders and automatically syncing them into the plugin library. - Library Import/Export: Supports exporting/importing the entire snippet library as JSON files, and automatically creates a backup before importing.
- GitHub Gist Sync: Supports syncing snippets via the GitHub Gist API, with three modes: merge/update, mirror/overwrite, or add-only.
- Instant Application: The UI includes a “Reload Interface” button for applying CSS changes immediately.
Installation and Activation¶
Before installing, ensure the DeepSeek Harness version is 0.1.7-rc.1 or later (0.1.7 rewrote the settings row, and older versions are not supported).
dsh plugin --profile web add github:zhang24xiao/dsh-snippets
After installation, restart the web GUI. For local development, you can also install it via a link:
git clone git@github.com:zhang24xiao/dsh-snippets.git
dsh plugin --profile web add link:$PWD/dsh-snippets
Usage¶
After installation and restart, the </> icon at the bottom of the sidebar, above the “Settings” row, opens the management panel. In the official “Plugins” management page, the plugin also displays a collapsible settings card.
After editing snippets, click the “Reload Interface” button in the UI to apply CSS changes. For local development, run the following in the plugin directory:
pnpm install
pnpm run watch
Notes¶
- JS Execution Model: JS snippets execute after the page loads. They do not run in a sandbox and behave the same as code pasted into the browser console. This is a trust-as-ownership model; enable only trusted code.
- Security Limits: API endpoints provided by the plugin only accept loopback requests and cannot be accessed over the network.
- Token Storage: GitHub Gist access tokens are stored in the local file
$DSH_HOME/dsh-snippets/gist-token.jsonwith permissions 0600. They are not exposed to the browser or sent into settings documents. - Uninstallation Behavior: Uninstalling the plugin removes all injected
<style>elements, but already executed JS code cannot be undone.