update: use claude acp

This commit is contained in:
Prad Nukala
2026-06-01 12:22:25 -04:00
parent 0fcbcd6c80
commit 8486cdbb54
4 changed files with 482 additions and 193 deletions
+20 -9
View File
@@ -1,6 +1,6 @@
# gh-commit
AI-powered scoped git commits. Groups changes by project area, generates commit messages with Claude, and pushes — all in one command.
AI-powered scoped git commits. Groups changes by project area, generates commit messages with Claude, and pushes — all in one command. A single Claude agent, reached over the **Agent Client Protocol (ACP)**, handles both scope generation and commit-message writing.
## Install
@@ -11,8 +11,10 @@ gh extension install prdlk/gh-commit
### Requirements
- [uv](https://docs.astral.sh/uv) — Python package runner (handles dependencies automatically)
- [mods](https://github.com/charmbracelet/mods) — LLM CLI for commit message generation
- [claude](https://docs.anthropic.com/en/docs/claude-code) — Claude Code CLI for scope generation
- [Node.js](https://nodejs.org) — runs the Claude ACP bridge via `npx`
- [claude](https://docs.anthropic.com/en/docs/claude-code) — authenticated Claude Code CLI (the ACP bridge drives it)
> The ACP bridge defaults to `npx --yes @zed-industries/claude-code-acp`. Override it with `GH_COMMIT_ACP_CMD` if you prefer another bridge.
## Usage
@@ -26,7 +28,7 @@ gh commit
# Auto-confirm + auto-push
gh commit --auto --push
# Refresh scopes after structural changes
# Manually refresh scopes after structural changes
gh commit refresh
# Sync scopes as GitHub labels
@@ -35,13 +37,18 @@ gh commit sync
## How it works
1. **`gh commit init`** — Claude analyzes your repo structure and generates scope definitions (e.g., `core → src/`, `docs → docs/, README.md`, `ci → .github/workflows/`)
2. **`gh commit`** — Groups dirty files by scope, generates a commit message per scope via `mods`, and commits each group separately
3. Remaining unscoped files are handled in a final pass
4. Unpushed commits are offered for push
1. **`gh commit init`** — A Claude agent (over ACP) analyzes your repo structure and generates scope definitions (e.g., `core → src/`, `docs → docs/, README.md`, `ci → .github/workflows/`)
2. **`gh commit`** — Groups dirty files by scope, generates a commit message per scope via the same Claude agent, and commits each group separately
3. **Auto-refresh** — Whenever your `.gitignore` changes, scopes are automatically regenerated before committing (a content hash of `.gitignore` is tracked per repo)
4. Remaining unscoped files are handled in a final pass
5. Unpushed commits are offered for push
Scopes are stored in a local DuckDB database (`~/.local/share/gh-commit/gh-commit.db`) — no config files in your repo.
### Why ACP?
gh-commit talks to Claude through the [Agent Client Protocol](https://agentclientprotocol.com) — the same protocol editors like Zed use to drive coding agents. One Claude backend handles everything (no separate `mods`/LLM CLI), the bridge process is reused across a run, and each generation runs in its own session so context never bleeds between commits.
## Commands
| Command | Description |
@@ -69,7 +76,11 @@ Scopes are stored in a local DuckDB database (`~/.local/share/gh-commit/gh-commi
|----------|-------------|
| `GH_COMMIT_AUTO=1` | Skip all confirmation prompts |
| `GH_COMMIT_PUSH=1` | Auto-push after commits |
| `GH_COMMIT_MODS_CMD` | Override the mods command string |
| `GH_COMMIT_NO_AUTO_REFRESH=1` | Don't auto-regenerate scopes when `.gitignore` changes |
| `GH_COMMIT_ACP_CMD` | Override the Claude ACP bridge command (default `npx --yes @zed-industries/claude-code-acp`) |
| `GH_COMMIT_ACP_PERMISSION` | ACP permission mode (default `bypassPermissions`) |
| `GH_COMMIT_ACP_TIMEOUT` | Per-prompt timeout in seconds (default `300`) |
| `GH_COMMIT_DEBUG=1` | Show ACP bridge stderr and parse diagnostics |
## Migration