跳到主要内容

dsh-git-commit

已验证

@klarkxy/dsh-git-commit · v0.2.0 · SEE LICENSE IN LICENSE · Web 界面

Git Commit: commit workspace changes from the conversation header, with model-planned commit groups.

安装

dsh plugin add @klarkxy/dsh-git-commit

用 dsh --profile default --dump-config 确认 layer 已生效 —— 参见安装指南。

源码

发布到 npm 但没有公开仓库。安装前请检查包内容。

标签

说明文档

@klarkxy/dsh-git-commit

Commit workspace changes to git without leaving the chat. Every conversation thread gets a Commit action in its header: click it, check the branch, the file count and the model that will be used, then confirm to commit every uncommitted path in the repository that contains the session's working directory.

简体中文

Install

Requires Node.js ≥22. Install the published package into the target profile with the DSH plugin manager; the install also enables the git-commit entry:

dsh plugin --profile web add @klarkxy/dsh-git-commit

Replace web with your profile name. Installation or removal may require a restart when the host asks for one.

To install a source checkout of this repository instead, pack it first and add the archive:

cd plugins/dsh-git-commit
npm pack --ignore-scripts
dsh plugin --profile web add "<absolute path to the .tgz>"

To uninstall:

dsh plugin --profile web remove @klarkxy/dsh-git-commit

How it works

A model splits the change set into a small number of coherent commits with proper messages, then the groups are applied in order as path-scoped commits. The model route comes from this plugin's own settings row: configure the Commit planning model there in advance to pin a dedicated model; when nothing is configured, the request follows the live session model and then the host default chat model. If the model call fails or returns an invalid plan, the run is rejected and nothing is staged or committed — a commit the model never planned is not one you asked for. The plugin page can opt back into the old behavior with Commit even without a model plan, which merges every change into a single commit with a plugin-written message.

Plugin page settings

Settings → Plugins → Git Commit holds the rows this plugin needs. Commit planning model is optional: a saved route is used for the planning call as an explicit model, an empty selection follows the live session model and then the host default chat model, and the conversation header panel reports which of the two is in effect. Only that call is affected; a saved route selects a model, but it is not evidence of connectivity. Commit even without a model plan is off by default and only changes what happens when planning produces nothing.

Usage

  1. Open a conversation whose workspace sits inside a git repository.
  2. Click Commit in the thread header (top right).
  3. Confirm in the popover, then wait for the run to finish.
  4. The panel lists every commit it created (hash + message).

The button is disabled while the session is running. The host checks again before committing, and stops the run if the workspace changes during planning.

Notes

  • Each selected file is committed from its current worktree content. Pre-staged changes that belong to another group stay staged until that group is committed.
  • Untracked files are included: small text files get a content preview for the model, while binaries are listed by path only.
  • Commits never push. Pushing stays a manual decision.

License

SEE LICENSE IN LICENSE