Stop wrangling git branches and writing commit messages by hand. The LLM reads your diffs, understands your actual code changes, decides the correct branch, writes a conventional commit message, and crafts a professional PR description—all automatically.
No hidden logic. No hardcoded heuristics. 100% safe, read-only git analysis until you execute.
demo.mp4
Install globally via npm (recommended):
pi install npm:pi-git-assistantOr install directly from the repository:
pi install git:github.com/elt7613/pi-git-assistant| Command | Action |
|---|---|
/git-commit |
Commits only the files modified during your current active pi session. |
/git-commit-all |
Commits all uncommitted changes in the repository. |
/git-commit-reset-gate |
Resets the execution gate so the agent can prompt again after a previous denial. |
Append these to any command to customize the LLM's behavior:
give pr description— Generates a comprehensive PR description alongside the commit.use branch <name>— Forces the LLM to commit to the specified branch instead of analyzing and creating its own. (e.g.,/git-commit use branch feat/auth)
We don't use simple scripts. The LLM natively understands your intent and acts accordingly:
- Context Gathering: The extension fetches
git status, diffs, and tracks session files. - Analysis: The LLM reads the actual code modifications to understand the feature or fix.
- Decision & Formatting:
- Branch: Determines whether to stay, switch, or create a new semantic branch (e.g.,
feat/...,fix/...). - Message: Generates a strict conventional commit message (< 72 characters, imperative mood).
- Branch: Determines whether to stay, switch, or create a new semantic branch (e.g.,
- Execution: The agent safely triggers the internal
git_commit_executetool to apply the changes.
Before the agent can autonomously execute a git commit, you must explicitly approve it via a confirmation dialog:
- Yes → The commit executes once. The next autonomous attempt will prompt again.
- No → The gate locks for the entire session. All future autonomous commit attempts fail immediately with a terminal error, preventing unbreakable agent retry loops.
- Reset → Run
/git-commit-reset-gatefrom the Command Palette to manually unlock the gate.
Manual commands (
/git-commit,/git-commit-all) bypass the gate entirely. When you explicitly trigger a commit, the analysis and execution flow straight through without additional prompts. The gate only applies when the agent initiates a commit on its own.
We enforce strict guardrails inside the LLM prompt to protect your repository:
- Protected Branches: It will always create a new branch if you are currently on
main,master, ordevelop. - Zero Hallucination Tolerance: Current branches get no special treatment. If the code changes do not perfectly match the current branch intent, the LLM will create a new one.
- Safe Commands Only: The extension operates purely through read-only git analysis until the final execution. It uses
git checkout,git add, andgit commit.- It never uses stash, restore, reset, rebase, merge, cherry-pick, clean, pull, or push.
Working across multiple days? No problem.
Any files touched by the write or edit tools during your pi session are automatically tracked. This tracking survives a session /resume—meaning /git-commit will still perfectly remember the scope of your work even if you restart your environment.

