Generates commit messages based on git diffs using the Gemini API.
- Requires a Gemini API key, see https://ai.google.dev/gemini-api/docs/api-key
go install github.com/pocketcowboy/autocm@latestMake sure that your Go bin directory is in your system's PATH. The Go bin directory is typically located at $HOME/go/bin. You can add it to your PATH by adding the following line to your shell's configuration file (e.g., ~/.bashrc, ~/.zshrc):
export PATH=$PATH:$HOME/go/binSet your Gemini API key as an environment variable:
# Add this line to your shell's configuration file (e.g., `~/.bashrc`, `~/.zshrc`).
export GEMINI_API_KEY="YOUR_API_KEY"Generate a commit message:
git diff --staged | autocmCopy the commit message to the clipboard (macOS):
git diff --staged | autocm | pbcopyInsert the commit message inside Vim:
:r!git diff --staged | autocm