dsh-phrase: DeepSeek Harness Catchphrase Plugin

Introduction

When developing agents with DeepSeek Harness (DSH), you often need to input fixed opening messages, prompt templates, or instruction snippets. Repeatedly typing the same text every time is both time-consuming and error-prone. DSH itself has no built-in phrase library, so users can only rely on browser local storage or manual copy-paste. This disrupts the workflow and makes maintenance and reuse difficult.

The dsh-phrase plugin described below implements a local phrase manager on the DSH client side. It stores commonly used text snippets and inserts them directly at the cursor position via a chip in the input line, without breaking any in-progress input.

What It Is

dsh-phrase is a client-side plugin for DeepSeek Harness, maintained by wayblink, designed to save frequently used text lines and quickly insert them during a session.

The core problem it solves: how to insert fixed text at the cursor position with the minimum number of clicks in DSH’s conversation editor, while maintaining data persistence consistent with the DSH process.

Key Features

  • Right-panel management: A “Phrases” tab appears in DSH’s right sidebar, where you can view, add, edit, and delete saved phrases.
  • Input-line chip: In the conversation editor’s toolbar, a “Phrases” chip appears to the right of the permission control. Clicking it opens a dropdown list.
  • Insert at cursor: Click a phrase in the dropdown list or click the “Insert” button, and the text is inserted at the current cursor position; any other characters being typed remain intact.
  • CRUD with confirmation: Add, edit, and delete phrases in the panel; deletion requires a secondary confirmation.
  • Data persistence: The phrase list is stored as a JSON file in DSH’s Host directory, at the default path <DSH_HOME>/dsh-phrase.json. Data persists across DSH restarts, and the file can also be edited manually.
  • Bilingual UI: The plugin interface supports English and Chinese, following DSH’s language setting (Settings → General → Language).

Installation & Enablement

Run the following command in DSH’s command line:

dsh plugin add dsh-phrase

Or enter dsh-phrase in DSH’s “Plugins → Add Plugin” interface. If installing from a local checkout, you can also provide the absolute path to the directory directly.

After installation, refresh the page (or restart DSH) to activate the client-side loading. This plugin requires DSH version >= 0.2.2-rc.1.

Typical Usage

  1. In the conversation editor’s toolbar, locate the “Phrases” chip to the right of the permission control and click it to open the dropdown list.
  2. Click a phrase in the dropdown list or click the “Insert” button; the text will be inserted at the cursor position.
  3. Click the “Manage” button in the dropdown list to open the right panel for adding, editing, or deleting.
  4. Type a frequently used text snippet in the panel and click “Save” to store it; a success notification appears at the top of the panel.
  5. In the right panel, click an existing phrase to insert it at the current cursor position; click “Edit” to modify the text; click “Delete” and confirm to remove it.
  6. Up to 100 phrases can be saved, each up to 300 characters long. Duplicate content will be rejected.

Storage & API

The plugin exposes a single data endpoint on the DSH Host side, located at <DSH_HOME>/dsh-phrase.json:

  • GET /api/dsh-phrase: Returns the current phrase list in the format { phrases: [{ id, text, createdAt }] }.
  • POST /api/dsh-phrase: Updates the phrase list. Request body format: { action: "add" | "update" | "delete", id?, text? }. Returns the updated list.

Write operations require the following conditions:
- The request header must include Content-Type: application/json.
- The request header must include x-dsh-phrase-write: 1.
- The request Origin must be DSH’s own origin.

File writes are implemented via serialization and atomic operations (write to a temporary file first, then rename to the target file). If the JSON file is corrupted, the plugin reports the file path directly rather than treating it as an empty list.

Use Cases & Notes

dsh-phrase is well suited for developers and agent maintainers who frequently need to input the same text, such as fixed prompt templates, system instruction snippets, or Q&A opening messages.

Please note the following when using the plugin:
- The plugin runs with the DSH process’s permissions. Ensure the source and license are acceptable before installing.
- The phrase list is stored in a local file. Regular backups or version control are recommended.
- It depends on DSH version >= 0.2.2-rc.1. Please verify your local version before installing.

Conclusion

dsh-phrase makes inserting commonly used text lightweight and reliable through a simple chip and panel, making it a handy utility for everyday DSH development.

  • Directory page: https://www.skillhub.cn/plugins/wayblink/dsh-phrase
  • GitHub: https://github.com/wayblink/dsh-phrase
羽毛球分组比赛记分
小程序二维码

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

Xiaoye