Skip to content

lxj808624/dsh-tool-git

41Last commit Aug 14, 2026

dsh-tool-git DSH plugin

dsh-tool-git provides eight structured Git tools for DeepSeek Harness, running git via shell-free subprocess and returning canonical JSON. It includes a safety gate that intercepts destructive git operations (force push, hard reset, rebase, etc.) whether called through these tools or shell tools.

How to install the dsh-tool-git DSH plugin

dsh plugin --profile web add dsh-tool-git

Copying does not run this command. Review the repository and version before installing the dsh-tool-git DSH plugin.

dsh-tool-git DSH plugin data source

dsh-tool-git DSH plugin snapshot date: Aug 16, 2026

discovered

What the dsh-tool-git DSH plugin can do

  • Provides structured tools: git_status, git_diff, git_log, git_branch, git_stage, git_commit, git_stash, git_show, git_fetch, git_pull, git_remote, git_checkout.
  • All commands use execFile with explicit argument arrays, preventing shell injection.
  • Output is parsed into structured JSON (porcelain v2, --numstat, --format).
  • Safety gate listens on tools/pre-execute, blocks destructive operations unless configured allow/ask.
  • Supports optional repoDir argument to operate on specific repositories.

Where the dsh-tool-git DSH plugin fits

  • Let an AI coding agent safely manage Git repositories without risking destructive history rewrites.
  • Automate Git workflows (commit, branch, stash, pull, push) in a controlled environment.
  • Inspect repository state (status, diff, log, show) with machine-readable output.
  • Enforce a security policy for Git operations in teams using DeepSeek Harness.

Who the dsh-tool-git DSH plugin is for

  • Developers who use DeepSeek Harness for AI-assisted coding and need safe Git operations.
  • Teams that want to guard against accidental destructive Git commands in automated workflows.

dsh-tool-git DSH plugin limitations

  • Only works within DeepSeek Harness runtime; not a standalone Git client.
  • Destructive policies are guardrails, not sandboxes; agents with arbitrary code execution can bypass pattern matching.
  • Requires Node.js ≥ 22.19 and pnpm for development; Git must be installed on the system.
  • The safety gate pattern matching is per-command and does not cross pipes, semicolons, or newlines (may miss some compound commands).

dsh-tool-git DSH plugin: from the repository README

Quoted from the lxj808624/dsh-tool-git README, the upstream source of the dsh-tool-git DSH plugin. Copyright remains with the original authors.

Structured, safe Git tool family for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`). Coding agents reach for git constantly, but the stock runtime only offers raw `bash`. `dsh-tool-git` gives the model eight structured tools that run `git` through a shell-free subprocess runner and return canonical JSON values — plus a `tools/pre-execute` safety gate that stops destructive git operations (force push, hard reset, rebase, amend, branch deletion, …) before they happen, whether the model calls them through these tools **or** through a shell tool. - **No shell injection**: every command goes through `execFile` with an explicit argument array. Model-supplied paths and messages are never string-interpolated. - **Machine output**: porcelain v2, `--numstat`, and `--format` records are parsed into structured JSON, not prose. - **Safety by default**: destructive operations are denied with an explanation unless you opt into `ask` (approval prompt) or `allow`. ## Tools | Tool | What it does | |---|---| | `git_status` | Working tree state: branch, ahead/behind, staged / unstaged / untracked files | | `git_diff` | Per-file insertion/deletion stats, optional

Read the full READMERepository license: MIT

dsh-tool-git DSH plugin questions

What is dsh-tool-git?

dsh-tool-git is a plugin for DeepSeek Harness that provides structured, safe Git tools. It includes a safety gate to prevent destructive Git operations like force push or hard reset, and returns output as JSON instead of text.

How do I install dsh-tool-git?

You can install it with the command: `dsh plugin --profile web add dsh-tool-git`. This will add the plugin to your DeepSeek Harness profile. Then restart DeepSeek Harness with `dsh --profile web`.

Does dsh-tool-git prevent all destructive Git commands?

The safety gate blocks many destructive Git operations (force push, reset --hard, rebase, etc.) by default. It also inspects shell tools for these patterns. However, it is not a sandbox; an agent with arbitrary code execution can bypass pattern matching. The policy can be configured to 'ask' (approval prompt) or 'allow' if needed.

What tools does dsh-tool-git provide?

It provides twelve tools: git_status, git_diff, git_log, git_branch, git_stage, git_commit, git_stash, git_show, git_fetch, git_pull, git_remote, and git_checkout. Each tool returns structured JSON output.

Can I customize the destructive policy?

Yes, you can configure the `destructivePolicy` option in the plugin config. Options are 'deny' (default), 'ask' (requires approval), or 'allow' (disables gate). You can also add extra patterns via `extraDestructivePatterns`.