Jump to content

AI Commit: Difference between revisions

From Archive
Create AI Commit page - AI-powered git commit messages
 
FIX: Restore AI Commit content
 
Line 1: Line 1:
/tmp/ai-commit.wiki
= AI Commit =
 
AI-powered git commit message generation integrated with lazygit. Added December 2025.
 
== Overview ==
 
After staging files in lazygit, press '''a''' to generate three conventional commit message options via Claude CLI. Select with fzf and commit executes.
 
'''Location:''' <code>~/.dotfiles/bin/ai-commit</code>
 
== Flow ==
 
<pre>
Stage files in lazygit (space)
    |
Hit 'a' key
    |
ai-commit gathers: staged diff, branch name, recent commits
    |
Claude returns 3 conventional commit messages
    |
fzf with diff preview (60% right pane)
    |
Select message, commit executes
</pre>
 
== Lazygit Configuration ==
 
'''Location:''' <code>~/.config/lazygit/config.yml</code>
 
<pre>
customCommands:
  - key: "a"
    context: "files"
    description: "AI commit (fzf + Claude)"
    subprocess: true
    command: 'MSG=$(ai-commit) && git commit -m "$MSG"'
</pre>
 
== Context Provided ==
 
The script provides Claude with:
* Staged diff (what's actually changing)
* Current branch name (for context)
* Recent commit messages (to match style)
* Repository name
 
== Message Format ==
 
Returns conventional commits format:
* <code>feat:</code> new features
* <code>fix:</code> bug fixes
* <code>refactor:</code> code restructuring
* <code>docs:</code> documentation
* <code>chore:</code> maintenance
 
== See Also ==
 
* [[Dotfiles]] — Full configuration overview
* [[Lazygit]] — Git TUI
* [[Git]] — Version control
 
----
[[Category:Technical Systems]]
[[Category:Automation]]
[[Category:Git]]
 
{{Navbox Technical}}

Latest revision as of 00:30, 8 December 2025

AI Commit

AI-powered git commit message generation integrated with lazygit. Added December 2025.

Overview

After staging files in lazygit, press a to generate three conventional commit message options via Claude CLI. Select with fzf and commit executes.

Location: ~/.dotfiles/bin/ai-commit

Flow

Stage files in lazygit (space)
    |
Hit 'a' key
    |
ai-commit gathers: staged diff, branch name, recent commits
    |
Claude returns 3 conventional commit messages
    |
fzf with diff preview (60% right pane)
    |
Select message, commit executes

Lazygit Configuration

Location: ~/.config/lazygit/config.yml

customCommands:
  - key: "a"
    context: "files"
    description: "AI commit (fzf + Claude)"
    subprocess: true
    command: 'MSG=$(ai-commit) && git commit -m "$MSG"'

Context Provided

The script provides Claude with:

  • Staged diff (what's actually changing)
  • Current branch name (for context)
  • Recent commit messages (to match style)
  • Repository name

Message Format

Returns conventional commits format:

  • feat: new features
  • fix: bug fixes
  • refactor: code restructuring
  • docs: documentation
  • chore: maintenance

See Also



Technical
Core Technical · CLI · Dotfiles · Nvim · SSH · VPS
Tools Sketchybar · ArchiveBox · ThinkPad Linux
Systems Automation · Personal APIs · Quantified Self
Reference Runbooks · New Computer Runbook · Syntax guide