dsh-git-push: DSH Git Automatic Commit, Push, and Audit Plugin

Preface

DeepSeek Harness (DSH) is a plugin-based environment for agent development. In development workflows, Git commits, pushes, and code checks are often repeated manually and can fail due to environment configuration differences. The dsh-git-push plugin integrates the Git operation pipeline into DSH, providing capabilities such as repository scanning, one-click commit and push, code audit gating, and npm publishing/installation, allowing agents to directly call tools to complete code delivery.

Plugin Overview

The plugin is maintained by EIGHTfs and uses the MIT License.

  • Core positioning: DSH Git automatic commit/push plugin, supporting repository scanning + one-click commit/push (tools + HTTP API).
  • Main features:
    • Git commit and push (with audit gate)
    • Code audit (22 rule packages, 3-layer structure)
    • npm publishing and installation
    • Credential management (Token/SSH)
    • Account detection and status
    • Standalone CLI (git-sluice)
    • HTTP API interface
    • Automatic push after AI task completion

Quick Start

After installing and restarting DSH, there are three ways to use the plugin directly.

  1. Direct AI invocation: The plugin has registered tools such as git_scan, code_audit, git_commit_push, and git_account_check. In a DSH session, you can simply use plain language, for example: “Scan my repository” or “Audit and commit the xx repository”.
  2. Standalone CLI (git-sluice): It can also run outside DSH.
    # 校验 GitHub 凭据
    git-sluice account-check
    # 扫描目录下的仓库
    git-sluice scan <目录>
    # 全量审计仓库
    git-sluice audit <仓库> --full
    # 提交推送(自动过审计门禁)
    git-sluice commit <仓库> -m "msg"
  1. Sidebar panel: Use the interface to check accounts, configure code audit rules, and perform commit/push operations.

Core Features

Committing and Pushing (GitHub + npm)

The plugin provides full Git pipeline automation and integrates npm ecosystem operations.

  • Credential management: Supports GitHub Token (saved to the credential directory with permission 0600) and SSH public key management. Supports one-click key pair generation.
  • Automatic remote resolution: Automatically selects the correct GitHub remote before pushing (prefers origin, supports SSH and Token dual channels).
  • Automatic commit identity: Agents do not need to guess the commit identity. If the repository is not configured, the plugin automatically uses the logged-in GitHub account identity (such as 登录名@users.noreply.github.com).
  • Zero-change safety: If the workspace has no changes or is already synchronized, the call will not error; it returns ok:true, and the status bar provides a clear indication.
  • npm capabilities: Supports package publishing (dry-run by default), four-stage installation interaction, account offline snapshots, and online verification.

Code Audit

Automatically performs code auditing before committing and sets a hard gate.

  • Three-layer audit pipeline: L1 regex initial screening / L2 AST data flow / L3 runtime detection.
  • Rule system: Includes 22 rule packages and 138 rules.
  • Gate mechanism: Automatically passes the audit gate before pushing. blocker level rules directly block commits.
  • API interface: Provides the GET/POST /api/git-push/audit interface, supporting custom aggregation of audit results (filter by rule type and severity).

Automatic Push Upon AI Task Completion

The plugin supports listening for the end of an AI turn, detecting completion markers in the response (default ✅任务完成), and automatically triggering commit + push (reusing the audit gate).

Technical Details

  • HTTP API: The plugin exposes multiple HTTP endpoints, such as account detection /api/git-push/account-check and audit /api/git-push/audit, facilitating integration with external systems.
  • Standalone scripts: The plugin includes the git-sluice CLI and runtime detection scripts, and supports standalone execution.

Notes

  • The plugin depends on api.github.com.
  • The credential directory has permission 0600 to ensure security.
  • Auditing is automatically executed before pushing; pay attention to blocker warnings.
  • The plugin runs with the current DSH process permissions; review the source code and license before use.

Conclusion

dsh-git-push standardizes the Git workflow and reduces environment configuration costs in agent development. You can view plugin details and source code through the links below.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye