Introduction¶
In DeepSeek Harness (DSH), registering commands via hard-coded code is cumbersome. The dsh-commands plugin provides a filesystem-based solution that simplifies the command management process by automatically registering slash commands by scanning Markdown files.
Plugin Overview¶
- Name:
dsh-commands - Owner: EtbyStudio
- Core Value: Directly map Markdown files to executable slash commands, supporting YAML frontmatter descriptions and hot reloading.
Installation and Activation¶
This plugin requires DSH version 0.2.0-rc.2. The installation command is as follows:
dsh plugin add @etby-studio/dsh-commands
After installation, the plugin scans Markdown files in the configuration directory at startup and registers them as commands.
Configuration and File Format¶
The plugin scans Markdown files in the <dshHome>/commands directory. The structure of the file determines the behavior of the command:
- Command Name: The filename (excluding the
.mdsuffix) serves as the command name. Naming rules require lowercase ASCII letters, numbers, underscores, or hyphens. - Description: A
descriptionfield must be included in the YAML frontmatter for display in the command discovery UI. - Body: The main content of the file serves as instructions and is submitted to the model when the command is executed.
Example file content:
---
description: Execute the plan
---
## Steps
1. Review the plan
2. Create a task list
Execution and Hot Reloading¶
- Execution Mechanism: The plugin does not implicitly submit to the model. When a command is triggered (e.g.,
/name), it reads the current file body and appends the instructions and arguments to the user message based on argument configuration. - Argument Support:
- Typed arguments are appended after the body content (e.g.,
/name <description>). - If the body contains a
$ARGUMENTSplaceholder, the arguments will replace it.
- Typed arguments are appended after the body content (e.g.,
- Hot Reloading: The plugin uses Chokidar to watch for directory changes. Adding, modifying, or deleting command files will automatically update the registry without requiring a DSH restart.
Notes¶
- Priority: File commands have lower priority. If an existing plugin registers a command with the same name programmatically, the file command will be skipped and a warning will be issued.
- File Validity: Files containing any of the following conditions will be skipped and a warning will be logged: missing frontmatter, empty description, invalid command name, or empty body.
- Watcher Configuration: Supports configuring watcher behavior, including polling mode, stability threshold (
watchStabilityThresholdMs), and symlink following (watchFollowSymlinks).