Introduction¶
The DSH sidebar plugin turns each workspace folder row into a one-click shortcut. Hover to reveal Finder / Zed / Ghostty icons, and click to open that directory in the corresponding local application.
Core Features¶
- Inline hover buttons: Three 16px icon buttons are automatically appended to the right of each
workspace:<id>sidebar row, sitting side by side with the native···menu without obscuring existing operations. - Availability awareness: Requests
/statuson startup and only renders buttons for applications that actually exist on the local machine and are enabled by configuration (the Zed button won’t show if Zed isn’t installed). - Chinese/English bilingual: Follows the DSH locale — displays “在访达中打开” in Chinese or “Open in Finder” in English (including
titleandaria-labelaccessibility tags). - Operation feedback: Success/failure triggers a toast notification in the bottom-right corner (
已在 Finder 中打开/打开失败:…); buttons are greyed out with a pulse animation during the request to prevent repeated clicks. - Server-side path resolution: The browser only sends
workspaceId + app; the real directory is resolved by the server-sideworkspaceRegistry, so the client cannot forge a path to open arbitrary directories. - No shell, no PATH search: Uses
execFile('open', [...fixed parameters])uniformly, eliminating any command injection surface.
Installation and Configuration¶
Installation¶
dsh plugin --profile web add "github:johnsonspirit/open-with-finder-ide"
After installation, restart DSH (dsh web) for the changes to take effect.
Configuration¶
Plugin configuration (Config["~standard"] standard schema, optional — if all fields are omitted, all three options are enabled by default):
| Field | Type | Default | Description |
|---|---|---|---|
finder |
boolean | true |
Whether to enable “Open in Finder” |
zed |
boolean | true |
Whether to enable “Open in Zed” |
ghostty |
boolean | true |
Whether to enable “Open in Ghostty Terminal” |
Example — keep only Finder and Zed:
config:
finder: true
zed: true
ghostty: false
Usage¶
- Start DSH and open any sidebar view containing workspace folders.
- Hover over a workspace row (e.g.,
open-folder ~/src/Misc/open-folder). - Three icons appear on the right side of the row: smiley face (Finder) / square Z (Zed) / little ghost (Ghostty), with a Chinese tooltip on hover.
- Click an icon → the corresponding application opens that directory → a toast in the bottom-right corner confirms the action.
- If an application is not installed, its icon is automatically hidden — no configuration needed.
API Calls¶
Base URL: /api/dsh-folder-open. All endpoints are loopback-only (127.0.0.1 / ::1 / localhost).
Status¶
curl http://127.0.0.1:PORT/api/dsh-folder-open/status
Response example:
{
"ok": true,
"mac": true,
"apps": { "finder": true, "zed": true, "ghostty": true },
"enabled": { "finder": true, "zed": true, "ghostty": true }
}
Open Directory¶
curl -X POST http://127.0.0.1:PORT/api/dsh-folder-open/open \
-H 'content-type: application/json' \
-d '{"workspaceId":"abc123","app":"finder"}'
| Field | Constraint |
|---|---|
workspaceId |
Non-empty string, length ≤ 80, must be resolvable to a path in workspaceRegistry |
app |
Limited to finder / zed / ghostty |
| Body limit | 16 KiB; exceeding is treated as invalid request |
Runtime Requirements and Security¶
Runtime Requirements¶
| Dependency | Version / Description |
|---|---|
| Node.js | ≥ 18 |
| OS | macOS (darwin) — directory opening uses the system open command; on non-macOS systems the API returns mac: false and buttons are not rendered |
| DSH host | Provides webServer (route registration) and workspaceRegistry (get(id) → { path }) injection |
Security Design¶
- Never trust paths from the client —
workspaceId → pathonly goes through server-sideworkspaceRegistry.get(); the POST body has no path field available for forgery. - Strict Loopback validation — Quadruple check of
remoteAddress+Host+Origin+Sec-Fetch-Site; other machines on the LAN and cross-site pages cannot invoke the endpoints. - Fixed argv — All invocations use
execFile('open', [...]); the directory is passed as a single argv element without going through a shell. - Input limits — Body capped at 16 KiB;
workspaceIdlimited to 80 characters. - Capability detection bypasses PATH — Only checks fixed
*.appunder/Applicationsand~/Applications, avoiding false positives from PATH hijacking.
Conclusion¶
This plugin ensures the security of local invocation through server-side path resolution and Loopback validation. It is suitable for developers who need to frequently switch workspace directories in DeepSeek Harness. For more details, refer to the project homepage or the GitHub repository.