在 DeepSeek Harness (DSH) 的开发环境中,频繁地创建和初始化工作区是常态。如果每次都需要手动在宿主机上执行 git clone,再手动配置路径,流程既繁琐又容易出错。dsh-workspace-git 插件通过扩展 DSH 原生的“添加工作区”流程,直接在 Web 界面中集成了 Git 仓库克隆功能,简化了这一过程。

这个插件由 leonardoxr 维护。它复用了 Harness 的标准工作区添加流程,并在此基础上增加了“克隆 Git 仓库”的选项,允许用户直接输入 URL 进行操作。

核心功能

该插件主要提供以下能力:

  1. 扩展原生流程:直接集成到 DSH 现有的“添加工作区”界面中,无需切换终端或外部工具。
  2. 仓库克隆:支持通过 Git URL 克隆仓库并将其作为工作区创建。
  3. 安全执行:宿主在非 Shell 环境下运行 git clone,并在一个私有的临时目录中进行。这意味着即使克隆失败,也不会覆盖或破坏现有的目标文件夹。
  4. 交互控制:禁用了交互式 Git 提示,防止请求在等待终端输入时挂起。
  5. 凭证支持:保留了 SSH agents 和配置好的 credential helpers 的功能,确保远程仓库访问正常。

安装与启用

安装该插件需要满足环境要求,并使用指定的命令。

环境要求:
* DeepSeek Harness 0.1.1-rc.2 或兼容版本
* Node.js 22+
* Harness 宿主机的 PATH 中包含 git 命令

安装命令:

dsh plugin --profile default add github:YOUR_ORG/dsh-workspace-git#COMMIT_SHA

安装完成后,需要重启 dsh web 服务并刷新 Web UI,客户端包元数据会在启动时扫描。

典型用法

安装插件后,打开工作区管理界面,新增的插件会提供两个选项卡:

  1. Existing folder:选择现有文件夹或输入绝对路径。
  2. Clone Git repository:输入 Git 仓库地址、父级文件夹路径以及新仓库名称。

系统会在后台执行克隆操作,完成后将路径返回给 Harness 的工作区创建流程。

配置与注意事项

pnpm 10 兼容性:
从 pnpm 10 开始,默认会阻止依赖包的构建脚本。如果在安装过程中遇到构建脚本被阻止的情况,需要在 profile 的 pnpm-workspace.yaml 中添加以下配置:

allowBuilds:
  dsh-workspace-git: true

配置持久化:
插件的配置(如超时时间、最大输出字节数)位于 Settings → Plugins → Git workspaces。修改后需要点击“Save”,配置会持久化保存,并需重启 DSH Web 才能生效。

配置项:
可以通过配置 workspace-git 行来调整默认行为。例如在 profile patch 中:

- insert:
    - id: workspace-git
      name: dsh-workspace-git
      config:
        timeoutMs: 600000
        maxOutputBytes: 65536
  • timeoutMs:克隆超时时间,默认 10 分钟。
  • maxOutputBytes:克隆失败时返回的最大输出字节数,默认 64 KiB。

适用场景

  • 需要从 Git 仓库快速拉取代码作为开发环境。
  • 需要在自动化脚本或工作流中动态指定仓库 URL 创建工作区。

安全提示:该插件以 DSH 进程的权限运行,安装前请务必核实源码与许可证。

Wait, I need to translate into English, not leave Chinese. I mistakenly output Chinese. Need final only English. Re-evaluate. Need ensure no Chinese. Let’s produce English translation only. Must not mention. Need maybe better polish.

Final English:

In the DeepSeek Harness (DSH) development environment, frequently creating and initializing workspaces is routine. If every time you have to manually run git clone on the host machine and then manually configure paths, the process is both cumbersome and error-prone. The dsh-workspace-git plugin extends DSH’s native “Add workspace” flow and integrates Git repository cloning directly into the Web interface, simplifying this process.

This plugin is maintained by leonardoxr. It reuses Harness’s standard workspace addition flow and adds a “Clone Git repository” option on top of it, allowing users to enter a URL directly to perform the operation.

Core Features

The plugin mainly provides the following capabilities:

  1. Extending the native flow: Directly integrated into DSH’s existing “Add workspace” interface, without needing to switch terminals or use external tools.
  2. Repository cloning: Supports cloning a repository from a Git URL and creating it as a workspace.
  3. Secure execution: The host runs git clone in a non-shell environment, inside a private temporary directory. This means that even if the clone fails, it will not overwrite or corrupt an existing target folder.
  4. Interactive control: Interactive Git prompts are disabled to prevent requests from hanging while waiting for terminal input.
  5. Credential support: SSH agents and configured credential helpers continue to work, ensuring normal access to remote repositories.

Installation and Enablement

Installing the plugin requires meeting the environment requirements and using the specified command.

Environment requirements:
* DeepSeek Harness 0.1.1-rc.2 or a compatible version
* Node.js 22+
* The git command is available in the PATH of the Harness host machine

Installation command:

dsh plugin --profile default add github:YOUR_ORG/dsh-workspace-git#COMMIT_SHA

After installation, restart the dsh web service and refresh the Web UI. Client package metadata is scanned at startup.

Typical Usage

After installing the plugin, open the workspace management interface. The newly added plugin provides two tabs:

  1. Existing folder: Select an existing folder or enter an absolute path.
  2. Clone Git repository: Enter the Git repository URL, the parent folder path, and the new repository name.

The system performs the clone operation in the background and returns the path to Harness’s workspace creation flow after completion.

Configuration and Caveats

pnpm 10 compatibility:
Starting with pnpm 10, dependency build scripts are blocked by default. If build scripts are blocked during installation, add the following configuration to the profile’s pnpm-workspace.yaml:

allowBuilds:
  dsh-workspace-git: true

Configuration persistence:
The plugin configuration (such as timeout and maximum output bytes) is located in Settings → Plugins → Git workspaces. After making changes, click “Save”. The configuration is persisted, and DSH Web must be restarted for the changes to take effect.

Configuration options:
The default behavior can be adjusted by configuring the workspace-git entry. For example, in a profile patch:

- insert:
    - id: workspace-git
      name: dsh-workspace-git
      config:
        timeoutMs: 600000
        maxOutputBytes: 65536
  • timeoutMs: Clone timeout, default 10 minutes.
  • maxOutputBytes: Maximum number of output bytes returned when cloning fails, default 64 KiB.

Use Cases

  • Quickly pull code from a Git repository as a development environment.
  • Dynamically specify a repository URL in automation scripts or workflows to create workspaces.

Security note: This plugin runs with the permissions of the DSH process. Be sure to verify the source code and license before installing.

Need maybe “Enablement” vs “Enabling”. Fine. Use straight quotes? Chinese had quotes. English with curly? We can use straight quotes or curly. Better consistent: use double quotes. But final can have curly. It’s okay. Need preserve Markdown. Code unchanged. Only output translation. Ensure no Chinese. final.

In the DeepSeek Harness (DSH) development environment, frequently creating and initializing workspaces is routine. If every time you have to manually run git clone on the host machine and then manually configure paths, the process is both cumbersome and error-prone. The dsh-workspace-git plugin extends DSH’s native “Add workspace” flow and integrates Git repository cloning directly into the Web interface, simplifying this process.

This plugin is maintained by leonardoxr. It reuses Harness’s standard workspace addition flow and adds a “Clone Git repository” option on top of it, allowing users to enter a URL directly to perform the operation.

Core Features

The plugin mainly provides the following capabilities:

  1. Extending the native flow: Directly integrated into DSH’s existing “Add workspace” interface, without needing to switch terminals or use external tools.
  2. Repository cloning: Supports cloning a repository from a Git URL and creating it as a workspace.
  3. Secure execution: The host runs git clone in a non-shell environment, inside a private temporary directory. This means that even if the clone fails, it will not overwrite or corrupt an existing target folder.
  4. Interactive control: Interactive Git prompts are disabled to prevent requests from hanging while waiting for terminal input.
  5. Credential support: SSH agents and configured credential helpers continue to work, ensuring normal access to remote repositories.

Installation and Enablement

Installing the plugin requires meeting the environment requirements and using the specified command.

Environment requirements:
* DeepSeek Harness 0.1.1-rc.2 or a compatible version
* Node.js 22+
* The git command is available in the PATH of the Harness host machine

Installation command:

dsh plugin --profile default add github:YOUR_ORG/dsh-workspace-git#COMMIT_SHA

After installation, restart the dsh web service and refresh the Web UI. Client package metadata is scanned at startup.

Typical Usage

After installing the plugin, open the workspace management interface. The newly added plugin provides two tabs:

  1. Existing folder: Select an existing folder or enter an absolute path.
  2. Clone Git repository: Enter the Git repository URL, the parent folder path, and the new repository name.

The system performs the clone operation in the background and returns the path to Harness’s workspace creation flow after completion.

Configuration and Caveats

pnpm 10 compatibility:
Starting with pnpm 10, dependency build scripts are blocked by default. If build scripts are blocked during installation, add the following configuration to the profile’s pnpm-workspace.yaml:

allowBuilds:
  dsh-workspace-git: true

Configuration persistence:
The plugin configuration (such as timeout and maximum output bytes) is located in Settings → Plugins → Git workspaces. After making changes, click “Save”. The configuration is persisted, and DSH Web must be restarted for the changes to take effect.

Configuration options:
The default behavior can be adjusted by configuring the workspace-git entry. For example, in a profile patch:

- insert:
    - id: workspace-git
      name: dsh-workspace-git
      config:
        timeoutMs: 600000
        maxOutputBytes: 65536
  • timeoutMs: Clone timeout, default 10 minutes.
  • maxOutputBytes: Maximum number of output bytes returned when cloning fails, default 64 KiB.

Use Cases

  • Quickly pull code from a Git repository as a development environment.
  • Dynamically specify a repository URL in automation scripts or workflows to create workspaces.

Security note: This plugin runs with the permissions of the DSH process. Be sure to verify the source code and license before installing.