Back to home

Eleven-is-cool

dsh-worktree

Git worktree plugin for DeepSeek Harness web: browse/create worktrees from the workspace panel

Stars
0
Language
TypeScript
Created
Aug 14, 2026
Updated
Aug 14, 2026

Introduction

dsh-worktree

Git worktree management for DeepSeek Harness Web.

Browse all worktrees in a repository, open any worktree as a DSH workspace, and create new worktrees from existing or new branches — directly from the DSH Web interface.

English | 简体中文

Features

  • Browse repository worktrees — view the primary worktree, branch, path, lock state, and detached HEAD state.
  • Open a worktree as a DSH workspace — register a worktree directory and jump directly into it.
  • Create worktrees from existing branches — select a local branch and create a linked worktree for it.
  • Create new branches and worktrees together — enter a new branch name and create both in one step.
  • Automatic target paths — when no target directory is specified, worktrees are created next to the repository as <repo>-<branch>.
  • Repository discovery — if the current workspace is not itself a Git repository, direct child directories are scanned for repositories.
  • No shell execution — Git commands are executed with execFile() and explicit argument lists rather than through a shell.
  • Works with stock DSH — a sidebar footer action provides the worktree panel without modifying DeepSeek Harness.
  • Optional workspace menu integration — an upstream UI patch adds a per-workspace Git worktree entry to the workspace ... menu.

Packages

PackagePurpose
packages/worktree (@eleven-is-cool/dsh-worktree)Host-side worktree Remote service for resolve, list, branches, and create, plus the client assembly that mounts the worktree namespace.
packages/client-ui-worktree (@eleven-is-cool/dsh-client-ui-worktree)Web UI for browsing, opening, and creating worktrees.

Requirements

  • DeepSeek Harness Web profile (dsh web)
  • DeepSeek Harness >= 0.1.0-rc.5
  • Git available on the host machine
  • Node.js and pnpm when building from source

Installation

The repository ships prebuilt lib/ and remote/ artifacts, so a local link: installation does not require a build step.

git clone https://github.com/Eleven-is-cool/dsh-worktree.git
cd dsh-worktree
dsh plugin --profile web add link:"$PWD"/packages/worktree
dsh plugin --profile web add link:"$PWD"/packages/client-ui-worktree

Restart dsh web and refresh the browser after installation.

UI Entry Points

Sidebar footer

On stock DeepSeek Harness, a Git branch icon appears next to Settings in the sidebar footer. It opens the worktree panel for the current workspace and requires no changes to the upstream DSH source.

Workspace ... menu

The preferred entry point is Workspace ... menu → Git worktree. This requires an extension slot that is not currently available in stock DeepSeek Harness.

The repository includes an optional patch at patches/ui-workspace-workspaceMenu.patch. See the next section to enable this integration.

Optional ui-workspace Patch

Apply the included patch to a DeepSeek Harness source checkout:

cd <path-to-deepseek-harness>
git apply <path-to-dsh-worktree>/patches/ui-workspace-workspaceMenu.patch
pnpm install
pnpm --filter @deepseek-ai/dsh-client-ui-workspace exec tsc -b
cd packages/client/ui-workspace
pnpm exec tsdown
dsh plugin --profile web add link:"$PWD"

Restart dsh web. Each workspace row should now expose a Git worktree item in its ... menu. The footer entry remains available as a fallback.

Usage

Browse worktrees

Open the worktree panel from either UI entry point. The panel lists all worktrees associated with the repository, including:

  • branch name or detached HEAD
  • filesystem path
  • primary worktree state
  • lock state

Select Open to register that directory as a DSH workspace and open it.

Create a worktree

Enter a branch name in the creation form.

  • If the branch already exists, the plugin checks it out into the new worktree.
  • If the branch does not exist, Create a new branch from HEAD is selected automatically.
  • You may provide an explicit target directory. If left empty, the plugin uses <parent-directory>/<repository-name>-<branch-name>.

After creation, the new worktree is automatically opened as a DSH workspace.

Workspaces containing multiple repositories

If the current DSH workspace is not itself a Git repository, dsh-worktree scans its direct child directories for repositories and lets you choose which one to manage.

How It Works

DeepSeek Harness Web
        │
        ▼
@eleven-is-cool/dsh-client-ui-worktree
        │ worktree Remote namespace
        ▼
@eleven-is-cool/dsh-worktree
        │ execFile("git", argv)
        ▼
Git
  ├── rev-parse
  ├── worktree list
  ├── for-each-ref
  └── worktree add

The Host service is stateless. Each request operates on the repository supplied by the client and delegates repository operations to the local Git executable.

Development

Install dependencies and build both packages:

pnpm install
pnpm build

pnpm build runs TypeScript compilation and tsdown for both packages, including the browser bundle.

After changing client-side code, run pnpm build and refresh the browser. Changes to the Host-side service also require restarting dsh web.

Compatibility Notes

The browser bundle uses a vendored and adapted DSH client-bundle build preset to remain compatible with the current DeepSeek Harness Web plugin loading model. The optional workspace-menu integration also patches an upstream UI extension point.

Because both surfaces depend on evolving DSH internals, they may need updates when DeepSeek Harness changes its Web plugin architecture.

Security Notes

dsh-worktree executes Git through execFile() with explicit arguments and does not invoke a command shell.

The plugin works with local filesystem paths and exposes worktree paths to the DSH Web client. It is intended for trusted DSH environments where users already have access to the corresponding local workspaces.

Current Limitations

  • Removing, pruning, and moving worktrees are not implemented.
  • Custom target path validation currently assumes POSIX-style absolute paths.
  • The workspace-row ... menu integration requires the optional upstream patch.
  • Generated Typert artifacts (remote/remote-client.js and lib/typert.host.js) must currently be kept in sync manually when Remote methods are added or removed.

License

MIT.

This project is an independent community plugin for DeepSeek Harness. Portions of the client build integration are adapted from DeepSeek Harness and remain subject to the upstream MIT license.