Introduction¶
DeepSeek Harness (DSH) has limited ways to exit the desktop client: either finding the window’s close button or looking for the process in Task Manager. If you are accustomed to working in the terminal and want to say “close the client” directly in a script, shortcut, or terminal window, the native functionality cannot do this.
dsh-command-quit is a third-party plugin that solves this problem. It adds two exit channels for the client: the slash command /quit-dsh in the dialog box, and quit-dsh in any terminal window. Both channels follow the same native application exit flow and do not forcibly kill the process.
Below is an introduction to this plugin.
What is this¶
dsh-command-quit is a DSH client plugin, maintained by Noobboi-22401, current version 1.4.0, repository address is https://github.com/Noobboi-22401/dsh-command-quit . It does one focused thing: makes the DSH desktop client commandable.
There are a few points that need to be clarified first, from the original README disclaimer:
- Not an official DeepSeek plugin, and has no relation to DeepSeek. The settings in the configuration panel merely borrowed the plugin settings entry provided by DSH itself; the controls are DSH-provided public controls, sorted in the same group, and that’s it.
- Code written by Deepseek V4.1 Flash. The uploader only performed basic functional testing and did not review the code line-by-line; there may be unknown bugs.
- License is MIT.
The classification of this plugin on community directory sites is “Client”, with 0 stars (subject to current display on the directory page).
Core Functions¶
The plugin provides two ways to exit, both following the same native application exit flow.
I. Dialog Command. In the DSH dialog box, type /quit-dsh and press Enter to close the client. Typing /q will show /quit-dsh as a candidate; pressing Tab will complete it and execute immediately—currently, completion and execution are done in one step. You can also select quit-dsh in the Command Palette, with the description “Close DeepSeek Harness client (Exit program)”.
II. Terminal Command. In any terminal window (PowerShell, cmd, Windows Terminal, Git Bash are all fine), type quit-dsh and press Enter to close the client. By default, it will first ask “Confirm exit [y/N]”. Only entering y, yes, or 是 will proceed; pressing Enter directly is equivalent to not exiting.
Neither method can bypass the client’s own confirmation box: if there are still tasks running, a confirmation box will pop up instead of directly killing the process. When multiple clients are open simultaneously, this command will close them all at once.
Runs without consuming Tokens. The command is processed entirely locally; it simply uses IPC to tell the application shell to exit. It does not initiate any model calls and is not counted in token usage.
Installation and Usage¶
Installing the Plugin¶
Install from GitHub using install_bundle:
install_bundle github:Noobboi-22401/dsh-command-quit
You can also clone it down and install via a local path. First, clone:
git clone https://github.com/Noobboi-22401/dsh-command-quit.git
Then:
install_bundle link:<absolute path to cloned directory>/dsh-command-quit
Installation is handled by DSH’s built-in plugin_manager. It executes pnpm add, writes dsh-command-quit into the profile’s dsh.profile.bundles, establishes symbolic links, and updates the lockfile.
Effective Method: Must Apply the Quit Patch¶
Starting from version 1.4.0, /quit-dsh requires a “quit patch” to be applied to the client once. The reason is that the desktop client only recognizes a fixed few message types from subprocesses; anything else is treated as an exception: it will report dsh desktop host sent an invalid IPC event, kill the worker process, and then pop up a window saying “The application failed to start or has stopped unexpectedly”. Therefore, before sending the message, the plugin first checks if the patch is applied. If not, it only responds with a sentence and does not send a message, preventing a crash.
The easiest way to apply the patch is to double-click install-dsh-quit.cmd in the plugin directory. It was originally for installing the terminal command, but now it will also find the client, apply the patch, and remember the client’s location. If you don’t want to install the terminal command but just want /quit-dsh to work, run once in the plugin directory:
node tools\patch-asar.mjs
The patch only changes two statements in the client’s app.asar. The file size does not change by even a single byte, it does not destroy the client’s own integrity check, and can be precisely reverted with a single command. The patch takes effect only after restarting the client—the profile’s bundle list is read when the client starts, and newly installed plugins must be restarted before use.
Patch status can be checked at any time:
node tools\patch-asar.mjs --check # patched / unpatched / unknown
node tools\patch-asar.mjs --revert # revert to factory bytes
After Client Upgrade¶
Upgrading the client replaces app.asar, and the patch disappears along with it. /quit-dsh will respond with “This client has not yet been patched with the quit patch” and will not crash. Double-click install-dsh-quit.cmd once or run node tools\patch-asar.mjs once, then restart the client.
In addition, the startup file for the terminal command is written in DSH’s installation directory, and upgrading the client may clear it. If quit-dsh is missing after upgrading, double-click install-dsh-quit.cmd once; the status line in the configuration page will display “Not installed yet”.
Typical Usage¶
Exit in Dialog¶
Type /q in the input box; /quit-dsh will appear as a candidate below. Pressing Tab will complete and execute immediately. If there are still tasks running, a confirmation box will pop up first. You can also find quit-dsh in the Command Palette.
Exit in Terminal¶
The terminal command needs to be installed once first; after that, it can be used in any terminal window.
Installation steps (do only once):
- Open the plugin folder and double-click
install-dsh-quit.cmd. - Close the window after seeing “Installation complete”.
- Re-open a terminal (an already open terminal will not recognize the new command), and type
quit-dshand press Enter.
Installation does two things: writes two small files of a few lines each into DSH’s own command directory (the directory holding dsh.cmd), and incidentally finds the client, applies the patch, and remembers the location. Neither requires administrator privileges and can be done while the client is running.
What it looks like in action:
> quit-dsh
Closing DeepSeek Harness client.
(If there are still tasks running in the client, it will pop up another confirmation box when closing.)
Confirm exit? [y/N] y
Requesting close of DeepSeek Harness client…
Exit request sent, client is closing.
Parameters:
| Command | Effect |
|---|---|
quit-dsh |
Asks first, only exits if you answer y (default behavior) |
quit-dsh --yes |
No prompt, exit directly (use for scripts or shortcuts) |
quit-dsh --list |
Only list running clients, do not exit |
quit-dsh --help |
Show help |
Renaming Commands¶
Both command names can be renamed yourself. Open the plugin page in the left sidebar of the DSH interface, find “Exit Command” in the Official group, and click to open for editing.
The four presets for the dialog command are /quit, /quit-dsh, /quitdsh, and /qd. You can also type the part after / directly in the “Command Name” input box. Only one is active at a time. It takes effect immediately upon saving and does not require a restart; the old name becomes invalid at the same time.
Two checks will be performed before saving; if they fail, saving is rejected (input box turns red, save button cannot be clicked):
- Format. Must start with a lowercase English letter and can only contain lowercase letters, numbers, underscores, and hyphens.
- Name Conflict. Cannot share a name with DSH built-in commands or commands registered by other plugins. There is a pitfall here: DSH stores commands in two layers;
compact,goal,planare registered in session/preset scopes, whileexport,feedbackare global. If only the global layer is checked,compactwill be treated as unused, resulting in the exit command being registered successfully but being obscured by a built-in command with the same name, making it impossible to exit by typing it. The plugin’s current check traverses all known scopes in the registry, rejecting the save if any layer is occupied.
If a name conflict has already been saved, and the plugin detects during startup that this name is unavailable, it will automatically revert to the default command name /quit-dsh and log it. There is another scenario where the conflict cannot be detected during save—another plugin registers a command with the same name after the plugin is running in a session—the plugin will listen to DSH’s command table change notifications and automatically revert to /quit-dsh if it detects being covered, displaying red text in the plugin configuration page and a banner at the bottom of the application interface. You can click × to close this. Closing only closes this single item; if you change the name and collide again, or if it is the same conflict after restarting, it will pop up again.
Configuration is held by DSH itself, written into the current profile’s cordis.patch.yml. No independent configuration file will be generated in the plugin directory. Conflict reminders are written into the same configuration item as the notice field and only appear when a conflict actually occurs; they are automatically cleared after switching back to a usable name.
The terminal command name can be changed in the “Terminal Command” section of the same configuration page. Default is quit-dsh, with presets quit-dsh, dsh-quit, dshq, dsq. After saving the change, the installed startup files will be renamed automatically, no need to reinstall. However, already open terminals need to be re-opened to recognize the new name, as terminals cache commands in PATH.
The terminal command section also has two switches:
| Control | Default | Description |
|---|---|---|
| Enable Terminal Exit Function | On | When turned off, quit-dsh will not exit the client, only prompts that the function is disabled; already installed startup files will be retained |
| Ask for confirmation before execution (y/N) | On | When turned off, quit-dsh exits directly without asking. This becomes grayed out when the previous item is turned off |
The terminal command name is also checked for name conflicts when saving: if the name is already occupied by another file in PATH, saving will be rejected directly and the occupied file will be listed, because the terminal parses commands by looking at the entire PATH, and a name conflict would turn your command into another program. Windows reserved names (con, nul, com1, etc.) are also rejected.
How the Terminal Command Closes the Client¶
quit-dsh in the terminal and the plugin are two different processes. The “please exit” dedicated channel inside the client is reachable by the plugin’s subprocess, but the terminal cannot reach it. Therefore, when the plugin runs inside the client, it opens a small interface that only allows local connections: prioritizing Windows Named Pipes, falling back to the 127.0.0.1 loopback port if the environment does not support it, and rejecting any connection from non-local sources. The interface address is not a secret; a separate 64-bit hexadecimal random password is provided, stored in ~/.dsh-command-quit/. The terminal command reads the address and password, connects, and says “please exit”. Once the plugin receives this, it does exactly the same thing as /quit-dsh. Connections with incorrect passwords are explicitly rejected.
Use Cases and Precautions¶
Suitable for these types of people:
- People accustomed to working in the terminal who want the client to be normally closed in scripts or shortcuts.
- People who want to exit the client using slash commands rather than finding the window close button.
- People who need to safely exit even when tasks are running and do not want to forcibly kill the process.
Things to note before use:
- The plugin runs with DSH process permissions. The functionality it provides is to patch the client and register commands; you should check the source code and license before installing. The license is MIT, and the source code is publicly available on GitHub.
- Version 1.3.0 is deprecated. Version 1.3.0 claimed “No longer need to patch the client, use the official exit message built into the client directly”—the README explicitly states this judgment is wrong, and doing so will cause the client to pop up a crash window. Version 1.4.0 has reverted to the patching method. If you have version 1.3.0 installed, remove it and install 1.4.0:
remove_bundle dsh-command-quit
install_bundle github:Noobboi-22401/dsh-command-quit
Those who have already installed the terminal command (e.g., used a beta version) do not need to manually delete it first; the plugin identifies itself by “generation” and writes startup files, automatically switching to the new version if an old version is found. Remember to restart the client after upgrading.
3. The patch must be reverted when uninstalling. Uninstalling consists of a few steps: first use remove_bundle dsh-command-quit to remove the plugin, then restart the client; if you installed the terminal command, double-click uninstall-dsh-quit.cmd. It only deletes the two files marked with this plugin; your own created files with the same name will not be affected, and the client’s /quit-dsh is not affected. During normal uninstallation, uninstall-dsh-quit.cmd will automatically revert the patch; if the plugin directory has already been deleted, you need to manually execute node tools\patch-asar.mjs --revert in the directory where a copy of the plugin still remains to restore.
Conclusion¶
The value of dsh-command-quit lies in standardizing the exit action into a command: /quit-dsh in the dialog box, quit-dsh in the terminal; both channels follow the client’s native exit flow, do not forcibly kill, do not lose data, and do not consume Tokens. Command names and confirmation methods can be configured yourself, and there are on-site prompts for name conflicts.
It is not an official plugin; the code was generated by the model and only basic functional testing was done. It is recommended to review the source code before installing.
Directory Page: https://www.skillhub.cn/plugins/Noobboi-22401/dsh-command-quit
GitHub: https://github.com/Noobboi-22401/dsh-command-quit