dsh-cmdk: The ⌘K Command Palette for DeepSeek Harness

Introduction

In agent development, sessions, files, plugins, and configurations are scattered across multiple entry points. Frequently switching context, locating a single message in long conversations, or quickly executing actions from files or plugins all interrupt the workflow. DeepSeek Harness (DSH) plugin ecosystem already exposes these capabilities, but lacks a unified entry point. dsh-cmdk provides that entry: through a single command palette, you can open sessions, search messages, execute plugin commands, and manage configuration—all with the keyboard.

What It Is

dsh-cmdk is the command palette plugin for DeepSeek Harness. It aggregates sessions, workspaces, plugins, actions, and appearance into a single panel. Full-text search can pinpoint specific messages, and it supports plugin extensions. The panel opens by default with ⌘K / Ctrl+K, and you can also find the entry at the bottom of the sidebar.

Zero dependencies, ready to use out of the box.

Core Features

Input Result
⌘K / Ctrl+K Open / close the panel
Session title Fuzzy-match all sessions (prefix > substring > pinyin initials > subsequence); press Enter to navigate directly
Pinyin initials cj → “Plugins…”, cjgc → “Plugin Marketplace”
Message content Full-text search shows a snippet and highlights which message number it is; → to view context
Workspace name Switch workspace directly
Starts with / Search files: recent files, root directory browsing, recursive path matching; ↵ inserts @relative/path into the draft, → previews content
Dark / Light / Follow System Switch theme
中文 / English Switch UI language

Default View

When the query is empty, the panel prioritizes showing “what you’re about to go to”:

  1. Recently used items (up to 8, ranked by usage frequency × time decay)
  2. All sessions (right side of each row shows relative time + working directory)
  3. New Session / Session List
  4. Switch Workspace
  5. More commands (Settings, Theme, Language, Plugin commands)

Once you start typing, all items participate in the full search. The ? help page includes usage statistics, listing your top 12 most-used items by actual usage count (read from local data only).

Mode Prefixes

The first character determines the search type:

Prefix Searches only
> Commands & plugins
@ Sessions
# Workspaces
/ Files & paths
= Calculator
? Help (key bindings, modes, connected providers, usage statistics)

Pressing Enter on a = result copies it to the clipboard. In ?, you can see how many commands each provider has contributed.

File Preview

With an empty query, press Space to preview the current row: files show their content, plugins show their README. File preview defaults to the first 40 lines; adjustable in settings (10–200 lines).

Host-side file reading uses the /cmdk/file?root=&rel=&lines= endpoint. Paths are restricted to within the root directory. Files exceeding 256 KB only report their size. NUL bytes or invalid UTF-8 are treated as binary.

Message Context

Full-text match rows can be expanded with → (or the … at the end of the row) to view context:

  • Each message displays its role and timestamp, preserves original line breaks, and code/error stacks are not collapsed into a single line
  • The matched message is highlighted with a dot on the left
  • #seq shows the message sequence number
  • ← → adjust the context window (2 / 5 / 10 messages before and after)
  • ↵ copies the full message text (excluding the role prefix)

The → at the end of a row also allows Forking from this message, asking a follow-up question with it as context, copying, or opening the containing session.

Plugin Management

The panel lists all installed plugins in the current profile, showing version and enabled status:

  • Enter toggles enable / disable (via pluginManager.setBundleEnabled, with automatic rollback on failure)
  • → opens the plugin directory

Pressing → on a plugin row displays its README (prefers README.md, case-insensitive).

Actions on Sessions & Workspaces

Press → (or … at the end of the row) on a session to:

  • Open / Rename / Fork into a new session
  • Archive / Copy session ID / Copy working directory path
  • Open working directory in Finder
  • Export as Markdown (including image turns and tool calls, saved to the downloads directory)

Press → on a workspace to:

  • Switch to it
  • Create a new session in it
  • Open in Finder

System Operations

The panel supports opening the profile directory, sessions directory, and logs directory; refreshing the page; adjusting font size (zoom in / zoom out / reset); adjusting search depth and the calculator toggle; and toggling “Recently Used.”

Settings

The first item under an empty query is “Settings,” or type > Settings to open. All configuration options can be adjusted through the panel:

  • Search: Full-text search toggle, scan depth, snippet preview toggle, result count
  • Behavior: “Recently Used” sorting, calculator, plugin command injection
  • Appearance: Font size, theme, language
  • Shortcuts: Key combination to open the panel
  • Maintenance: Clear “Recently Used”, restore default settings

Changes take effect immediately and are persisted to disk. Hold ⇧ to accelerate numeric adjustments; ← → decrease / increase by one step.

Two Plugin Integration Methods

A single provider can contribute both “static commands” and “dynamic results”:

window.__DSH_CMDK__?.registerProvider({
  id: 'git-tools',
  title: { zh: 'Git 工具', en: 'Git tools' },
  icon: 'plugin',
  prefix: 'git',
  commands: [
    { id: 'git-tools.status', title: '查看 Git 状态', run: (ctx) => ({ status: '已执行' }) },
  ],
  search: async (query, { signal, limit }) => [
    {
      id: 'git-tools.branch',
      title: `切到 ${query}`,
      subtitle: '当前仓库',
      keywords: ['branch', 'fenzhi'],
      score: 0.9,
      run: (ctx) => ({ status: '已切换' }),
      actions: () => [{ id: 'more', title: '更多', run: () => undefined }],
    },
  ],
  dispose: () => { /* cleanup */ },
});

run return value conventions:

Return Panel behavior
{ status: '…' } Shows a toast at the bottom, panel stays open
{ input: { title, value, submit } } Enters a secondary input prompt
{ push: { title, items } } Stacks a sub-list
{ query: '…' } Rewrites the search box content
Empty / undefined Closes the panel

If search does not return within 150 ms, the current result is discarded. A later-registered id with the same name overrides the earlier one.

v1 Single Command (compatible)

window.__DSH_CMDK__?.register({
  id: 'my-plugin.open-docs',
  title: '打开插件文档',
  sub: 'my-plugin 说明书',
  run: (ctx) => ({ status: '已打开' }),
});

You can also register via events (suitable for modules that load before this plugin):

window.dispatchEvent(new CustomEvent('dsh-cmdk:command', { detail: { id, title, run } }));
new CustomEvent('dsh-cmdk:provider', { detail: providerSpec });

Extension Panel (provider marketplace)

> Extensions opens a management page listing all currently registered providers:

  • Name + prefix
  • A pill badge on the right shows the number of commands contributed; after disabling it shows “Disabled”
  • A dot on the left indicates whether it participates in search and command injection
  • A “Integration Guide” at the bottom provides copy-paste ready examples

Clicking into any provider shows each command it has registered (Enter to execute directly), one-click disable / enable, and a copyable integration example.

In-panel search: Panels such as Settings and Extensions support in-panel search—typing only narrows the rows within the current panel (pinyin initials supported).

Installation & Activation

Install command:

dsh plugin add github:hseons/dsh-cmdk

After installation, press ⌘K / Ctrl+K to open the command palette.

Typical Usage

  1. Open the panel: ⌘K
  2. Search a session: Type the session title, press Enter to open
  3. Locate a message: Type the message content, → to view context
  4. Fork a session: Press → on a session and select “Fork from this message”
  5. File preview: Type /, select a file, press Space to preview content
  6. Manage plugins: > Extensions to view and toggle plugin enabled status
  7. Shortcuts: Modify the key combination to open the panel in Settings

Use Cases & Notes

Ideal for developers who need to frequently switch between sessions, locate messages in long conversations, or quickly execute actions from files.

The plugin runs with the permissions of the current DSH process. Review the source code and license before installing.

Closing

dsh-cmdk uses a unified panel to connect sessions, messages, files, plugins, and configuration, allowing most operations to be completed with the keyboard alone. It is zero-dependency and exposes extension interfaces through two methods, making it well-suited for scenarios requiring deep customization.

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

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

Xiaoye