DeepSeek Harness (DSH) adopts an “everything is a plugin” architecture. Agents often need to call Git for version control during the development workflow. Directly using shell commands (such as bash) poses hidden risks: output formats are affected by user configurations (like pager, color, quotepath), and write operations (like commit) lack unified permission control.
dsh-zcode-git is a structured Git toolset designed for DSH agents, aiming to replace shell invocations. It encapsulates git operations into predictable tool functions with fixed output formats, and all write operations are executed through the Harness’s approval service to ensure security.
Core Functions¶
This plugin provides the following six tools, all of which read the repository in the current session’s working directory by default:
-
git_status (Read-only)
- Retrieves current branch and upstream branch information.
- Returns lists of ahead/behind, staged/modified/conflicting/untracked/ignored files.
-
git_diff (Read-only)
- Generates unified diffs.
- Returns line count statistics per file.
- Supports scoping by paths, staged status, or contextLines.
-
git_log (Read-only)
- Returns commit history, including hash, author, date, and summary.
- Supports limiting quantity via
limit, or narrowing the query scope viapathsandrevision.
-
git_branch (Read/Write)
- Supports
list,create,switch, anddelete. - Write operations require approval.
- Supports
-
git_commit (Write)
- Option to stage specified paths, then commit message.
- Write operations require approval.
-
git_stash (Read/Write)
- Supports
list,push,pop,apply, anddrop. - Write operations require approval.
- Supports
Installation and Activation¶
Installing this plugin automatically updates the Harness configuration.
dsh plugin --profile web add dsh-zcode-git
Restarting the Harness is required after installation because the plugin is loaded via the configuration file.
System Requirements and Notes¶
-
Environment Dependencies
- The
gitbinary must exist in the system path. - DeepSeek Harness version must satisfy:
>=0.1.5-rc.2 <0.1.6-0 || >=0.1.6-alpha.1 <0.2.0-0 || >=0.1.7-alpha.1 <0.2.0-0. - Node.js version must be
>=20.
- The
-
Execution Mechanism
- The plugin does not rely on a shell; instead, it calls git directly via the
argvarray, avoiding shell escaping and injection risks. - The field delimiter is
%x1f(file delimiter), not%x00used by ZCode.
- The plugin does not rely on a shell; instead, it calls git directly via the
-
Output Limitations
- To maintain a stable Prompt shape, the
git_statusoutput is truncated to 2k characters.
- To maintain a stable Prompt shape, the
-
Known Bugs
- When the session’s current working directory (CWD) is in a subdirectory of the repository, the plugin may return empty results because relative paths from the repository root are not handled correctly.
Ecosystem and Links¶
dsh-zcode-git is a structured tool focused on Git version control within the DeepSeek ecosystem, following the MIT license. To view the source code, submit issues, or view the directory page, please visit: