This gist shows how to generate git-commit messages with LLM-Now in Lazygit.
- Install LLM-Now using
brew install swartzrock/tap/llm-now(macOS / Linux) or downloading a native executable from the releases page. - Set up an alias for a good provider and model in
llm-now.- I'm using
haiku(Claude Haiku 4.5) here which works well. - You can set up an alias by running
llm-now --input "write a one-line poem about dogs"and selecting a local, cli, or cloud provider (with an API key env var). If you prefer to have llm-now securely store your api key runllm-nowand chooseAdd or manage API keys…first.
- I'm using
- Go to your lazygit config directory (
cd $(lazygit --cd)) and copy theconfig.ymlandllm-now-functions.shfiles below into the directory (or merge with your existingconfig.ymlfile).- Hint: set
XDG_CONFIG_HOME=~/.configon macOS if you don't like working in theApplication Supportdirectory and don't want to change the hard-coded~/.config/lazygitpaths in the examples. - Change the key to one that you'll remember.
- Hint: set
In lazygit switch to the Files tab, press <space> to stage one or more files and press z to view and edit the generated git commit message then <enter> to commit the changes.