In DeepSeek Harness, developers often need to manage repositories directly within the session context. The dsh-git-flow plugin provides a branch chip in the Composer toolbar. Opening it allows you to browse and switch branches, create new branches, and commit a selected subset of files — commit messages are automatically generated by the session model based on the diff.

Installation

The plugin depends on Node ^22.19.0 || >=24.0.0 and pnpm 10.

Use the official installation command:

dsh plugin --profile gitflow-web add https://github.com/hunan36/dsh-git-flow

After installation, enable the plugin on the plugin page.

Feature Overview

The plugin provides the following core features:

  1. Browse branches
  2. Switch branches
  3. Create branches
  4. Commit a selected subset of files
  5. Automatically generate commit messages using the session model based on the diff
  6. Push

Usage

In the Composer toolbar, click the branch chip (for example [⑂ feature/login 3]) to open the menu. The menu supports the following actions:

  • Search branches
  • View local branches
  • Create a new branch
  • Commit (enabled only when there are changes in the working directory)
  • Refresh status

Security Boundaries and Behavioral Details

The plugin enforces the following security and behavioral restrictions in its implementation:

  • Session isolation: The browser only sends the sessionId, and the host resolves the repository path based on that session. The page cannot specify the directory in which Git commands are executed.
  • Command execution security: Arguments are always passed as arrays, not shell strings. stdin: 'ignore' and GIT_TERMINAL_PROMPT=0 are configured to ensure credential prompts do not hang the invocation.
  • Push behavior: The push command never passes --force or --force-with-lease. It only pushes the current branch to its upstream branch, setting the upstream automatically if it does not exist.
  • Commit scope: The commit panel only stages the files checked in the panel. If no files are selected, it returns git/no-files-selected and does not fall back to an implicit git add -A.
  • Branch switching: When there are uncommitted changes in the working directory, branch switching is refused by default and returns git/dirty-worktree. A --force forced switch is sent only when the user clicks a second time in the confirmation dialog.
  • Discarding changes: This is executed only after the user selects a destructive action in the confirmation dialog. Tracked paths are restored to HEAD (git restore --source=HEAD --staged --worktree), untracked paths are removed (git clean -fd, without -x, so ignored files are preserved), and conflicted paths are rejected rather than handled by automatic guessing.

Dependencies

  • Node.js: ^22.19.0 || >=24.0.0
  • pnpm: 10

Conclusion

dsh-git-flow embeds Git operations directly into the DSH session flow and reduces the cost of manually writing Commit Messages by using AI-assisted generation of commit messages.