dsh-commands: DeepSeek Harness Filesystem Slash Command Discovery

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:

  1. Command Name: The filename (excluding the .md suffix) serves as the command name. Naming rules require lowercase ASCII letters, numbers, underscores, or hyphens.
  2. Description: A description field must be included in the YAML frontmatter for display in the command discovery UI.
  3. 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 $ARGUMENTS placeholder, the arguments will replace it.
  • 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).
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye