dsh-prompt-switcher: Local Prompt Template Sync via WebDAV

Overview

DeepSeek Harness (DSH) natively supports plugin extension, but there is a gap in managing local Markdown prompt templates and syncing them across devices. dsh-prompt-switcher is a Web plugin designed to address these issues. It allows users to quickly select local .md templates via the / shortcut command, and supports global prompts, environment variable replacement, and WebDAV synchronization.

Core Features

  • Local Template Selection: Select .md files in a local directory through the / menu. Once selected, the template remains effective for the entire conversation, with constraints equivalent to those in AGENTS.md.
  • Global Prompt: Configure a prompt that applies to all new conversations. When a template is selected using /, it is appended after the global prompt, and both take effect simultaneously.
  • Environment Variables: Templates support the {{env:variable_name}} syntax, which is replaced with the corresponding value before being sent to the model.
  • WebDAV Sync: Templates and environment variables can be synced to a WebDAV server for cross-device management.
  • Conversation Deletion: Supports deleting conversations completely (requires DSH 0.2.0-rc.1 or later).

Installation and Activation

  1. Ensure the environment meets the requirements: DSH >= 0.1.7-alpha.1, Node >= 22.19.
  2. Run the installation command:
dsh plugin --profile web add github:mikulo/dsh-prompt-switcher
  1. After installation, restart dsh web and refresh the page.

Typical Usage

1. Configure the Template Directory

Open Settings → Prompt Templates, then click “Select Folder” to choose the directory containing .md templates. The plugin reads .md files from the first level of that directory. Templates in a new directory are disabled by default and must be enabled manually.

2. Select a Template

When starting a new conversation, enter / in the input box. Activated templates will appear in the menu. After selecting a template and sending the first message, the template takes effect for every subsequent turn of the conversation.

3. Use Environment Variables

Reference an environment variable in a template using {{env:variable_name}}. For example, if the variable name is api_key and the value is 123456, write {{env:api_key}} in the template; when sent, it becomes 123456.

4. WebDAV Sync

Switch to the “WebDAV Cloud Sync” tab under Settings → Prompt Templates. Configure the server address, username, and password (the password is stored only on the local machine), then click “Test Connection” to validate the configuration. After saving, you can perform “Sync to Local” or “Sync to Cloud”.

Use Cases and Notes

  • Permission Requirements: The plugin runs with the permissions of the current DSH process. Ensure the process has read/write access to the ~/.dsh/ directory.
  • Data Security: Environment variable values appear in plaintext in the content sent to the model and in conversation logs. Do not store sensitive information in variables.
  • Version Dependency: The conversation deletion feature depends on the conversation storage structure introduced in DSH 0.2.0-rc.1.
  • Hot Update Limitations: After changing the Host-side code, dsh web must be restarted for the changes to take effect. The Browser side supports hot updates.

Conclusion

This plugin is implemented using the standard DSH bundle. Both Host and Browser use pure ESM and have no runtime dependencies. It is suitable for users who need to manage local Prompt templates centrally in DSH and want cloud synchronization.

羽毛球分组比赛记分
小程序二维码

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

Xiaoye