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:
- Browse branches
- Switch branches
- Create branches
- Commit a selected subset of files
- Automatically generate commit messages using the session model based on the diff
- 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'andGIT_TERMINAL_PROMPT=0are configured to ensure credential prompts do not hang the invocation. - Push behavior: The
pushcommand never passes--forceor--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-selectedand does not fall back to an implicitgit 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--forceforced 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.