Preface¶
When developing agents or projects in DSH, workspaces are often bound to local directories. If you have to manually select a path, create, or switch workspaces in the Desktop or Web interface every time, there will be an extra repetitive step in scenarios where you’ve already cd‘d to the target directory in the terminal. The community plugin dsh-open-dir (maintainer azazo1) provides the dsh-open command: it creates or reuses a workspace on the specified directory and returns success after the interface completes navigation. It is a client type plugin in the DSH ecosystem and depends on DSH >=0.2.0-rc.2 <0.3.0.
What is this¶
dsh-open-dir creates or reuses a workspace in DSH Desktop via dsh-open <directory> and opens the corresponding session; the CLI reports success only after the interface completes navigation. The Web side requires installing and enabling the same plugin in the locally running Web interface with the page already loaded. The npm package version is 0.1.0, licensed under MIT.
Core Features¶
The following introduces the capabilities documented in the README, not exceeding the scope of the materials.
- Open directory in Desktop: After installing and enabling the plugin, use
dsh-opento point to a local directory; macOS and Windows can invoke or bring the Desktop to the foreground through the registereddsh://openprotocol (Desktop needs to be launched once before first use to register the protocol). - Web mode: Parameters like
--target webare aimed at the local Web interface; this requires the plugin to be similarly installed and enabled in the Web-side profile, and the page has been loaded. - Path handling: Supports relative paths and
~; resolves symbolic links and validates the directory; uses--as a separator when the directory name starts with-. - Instances and timeout: Waits 30 seconds by default;
--timeoutcan be set to 1..300 seconds; when there are multiple instances on the same Host, the CLI outputs the instance ID, which can be specified with--instance; only one page on the same Host will claim the request. - Communication model: The Host requests a random port on the loopback address and writes discovery information (including a random authentication token, with permissions
0600) to$DSH_HOME/runtime/dsh-open-dir; the Client claims the request via the DSH authentication API, callingctx.workspaces.create({ path })andctx.uiWorkspace.openWorkspace(workspaceId). The CLI and host must use the sameDSH_HOME.
Installation and Activation¶
The installation path in the materials is the plugin managers of Desktop / Web respectively, rather than a unified dsh plugin add command string.
- Install and enable
dsh-open-dirin the plugin manager of DSH Desktop. - If using Web, install and enable again in the corresponding profile of the local Web interface (Desktop and Web use independent profiles and need to be installed separately).
- When packaging from source, execute in the repository root directory:
just install
just verify
just pack
Then install the generated compressed package via the plugin manager.
If you want to use dsh-open globally in a regular terminal (optional), the README provides:
pnpm add -g dsh-open-dir
Or first just pack, then:
pnpm add -g (realpath dsh-open-dir*.tgz)
Runtime environment requirements: Node ^22.19.0 || >=24.0.0 (see package.json engines).
Typical Usage¶
Can be run directly within the repository, without needing to install the global command first:
just open .
just open ~/projects/my-project
just open --no-launch .
After installing the plugin package or global CLI:
dsh-open .
When the protocol is unavailable or you only need to submit a request without invoking Desktop:
just open --no-launch .
When using Web and the page is ready, without launching via the protocol:
just open --target web --no-launch .
just open --timeout 60 --verbose .
Diagnostics: --verbose or NODE_DEBUG=dsh-open can output CLI phase information.
Applicable Scenarios and Notes¶
Suitable for: Developers who are used to locating project directories in the terminal and want to open (or create) the corresponding workspace in DSH Desktop or local Web with one click.
Notes:
- The plugin runs under the current DSH process permissions; before installing, you should read the GitHub source code and the MIT license, and evaluate on your own whether it meets the environment requirements.
- If navigation is cancelled by other operations, the directory is unavailable, the plugin is uninstalled, or the interface is not ready, it will end with a non-zero exit code; timeout indicates no success confirmation was received, and cannot guarantee that the interface has not changed.
- The request is delivered only once; navigation will not be automatically replayed after disconnection.
- The community directory skillhub.cn has no official affiliation with DeepSeek / 幻方; it belongs to the community ecosystem and is not an official app store.
Links¶
- Directory page: https://www.skillhub.cn/plugins/azazo1/dsh-open-dir
- Repository: https://github.com/azazo1/dsh-open-dir
Through the above steps, you can use dsh-open (or just open within the repository) in the terminal to connect local directories to DSH workspaces, reducing the repeated path selection operations in the interface.