dsh-open-in-codebuddy: One-click open workspace with CodeBuddy in DSH Session Header

Introduction

When running agents with DSH, a recurring action is “opening the current workspace folder in another client”. DSH natively has an “Open In…” widget, but it hardcodes applications in a compile-time directory table, making it impossible for third parties to add CodeBuddy. If CodeBuddy is your daily driver, you have to manually switch to the file manager or terminal to type the startup command and specify the directory every time.

The plugin introduced below solves this problem: dsh-open-in-codebuddy maintained by gokucai. It adds a CodeBuddy button to the Session header. When clicked, it launches CodeBuddy using the current Session’s workspace directory. Categorized as a client, starred 0, license MIT. Note: The community directory is an independent site with no official affiliation with DeepSeek / Huafan, and this plugin is not an official product.

What Is It

One sentence: This is a DSH client plugin maintained by gokucai, which inserts a </> CodeBuddy button next to the native DSH “Open In…” widget in the Session header. Clicking it launches CodeBuddy in the current Session’s workspace directory.

It does not add CodeBuddy to the native dropdown menu, but places a side-by-side button in a separate slot next to it, without modifying the native DSH widget. The current workspace directory is passed to the backend by DSH upon invocation; the plugin does not guess the directory.

Core Features

Changes after installation:

  1. A </> CodeBuddy button appears in the Session header, side-by-side with the native DSH [ ⧉ | ▾ ] widget, with consistent geometric dimensions.
  2. Upon clicking, CodeBuddy is launched targeting the current Session’s workspace folder.
  3. The button shows a busy state during launch; if it fails, an error message appears next to the button and disappears automatically after six seconds.
  4. When CodeBuddy is not detected, the button does not render at all, preventing the appearance of a non-responsive control.

Behavior on different platforms:

Platform Launch Method
macOS Prioritizes calling CodeBuddy’s built-in CLI Contents/Resources/app/bin/code -n <dir>, opening the directory as a workspace in a new window; falls back to open -a if that CLI does not exist
Windows / Linux Looks for codebuddy, cbc, or codebuddy-code in PATH and runs with that directory as the working directory

On macOS, it also verifies that the bundle ID must be com.tencent.codebuddycn. The purpose of this is to ensure normal launch even if the installation is renamed, while avoiding accidental launch when an unrelated application is placed at a path with the same name.

Installation and Enabling

Install from GitHub source:

dsh plugin --profile <your-profile> add github:gokucai/dsh-open-in-codebuddy

Or use the npm pre-built package, no build approval needed:

dsh plugin --profile <your-profile> add dsh-open-in-codebuddy

Replace <your-profile> with the actual profile name you are using. This package declares dsh.bundle, so DSH will accept it as a profile bundle layer during installation, without needing manual modification of cordis.patch.yml or package.json.

Before installing, confirm one thing: the plugin runs with the permissions of the current DSH process; it will read the application installation location and launch a local process. The README states that it does not make network requests, does not read workspace files, and does not touch credentials. However, you should still review the source code and license yourself before installing a third-party plugin. MIT only constrains the terms of use and does not guarantee that the code content meets your expectations.

Typical Usage

After installation, just restart DSH; there are no extra configuration steps.

  1. CodeBuddy is installed in a standard local location (macOS: CodeBuddy CN.app or CodeBuddy.app in /Applications or ~/Applications, Windows / Linux: in PATH). After restarting DSH, a button appears in the Session header; clicking it launches CodeBuddy with the current workspace.
  2. If CodeBuddy is not in a standard location, export the environment variable and restart DSH:
export CODEBUDDY_APP_PATH="/path/to/CodeBuddy CN.app"
  1. Uninstall when no longer needed:
dsh plugin --profile <your-profile> remove dsh-open-in-codebuddy

Use Cases and Notes

Suitable for users whose primary editor is CodeBuddy, who run sessions with DSH, and want to go directly into the IDE with the current session context rather than exiting first and manually opening the directory. It is also suitable for those who want to study “how a client plugin can safely occupy a position in the DSH slot system”—the README in this repository clarifies why it uses a separate cell ID instead of reusing the native control’s cell ID.

Limitations and notes:

  • The button relies on the backend detecting that CodeBuddy is installed locally to render; no button if not installed, which is expected behavior.
  • On macOS, use CODEBUDDY_APP_PATH for non-standard paths, otherwise it will not be detected.
  • Plugin request body limit is 64 KiB, must be application/json, and the passed path must be a real absolute directory; parameters are passed as argv, detached, not via shell, and without stdio pipes.
  • The two host-side routes GET /open-in-codebuddy/status and POST /open-in-codebuddy/open are placed after DSH’s connection trust fence; unauthenticated and cross-origin calls will be rejected before probing and launching.
  • The plugin runs with the current dsh process permissions; check source code and license before installation.

Conclusion

The value of this plugin lies in that it does not try to modify DSH’s native dropdown menu, but places a side-by-side button in a separate slot next to it. It works out of the box, cleanly reverts upon uninstallation, and does not affect native controls. If your daily workflow involves alternating between DSH sessions and CodeBuddy editing, it is worth trying.

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

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

Xiaoye