Uses the fantastic gptel to extend the equally fantastic magit with some LLM-powered functionality.
Functionality is provided for:
- Generating commit messages
- Explaining diffs
Install the package and run gptel-magit-install
at an appropriate
time, for example:
(use-package gptel-magit
:ensure t
:hook (magit-mode . gptel-magit-install))
You can generate a commit message in two ways:
- In the magit transient commit buffer, you can press
g
to create a commit with a pre-generated message. - In an already started git-commit buffer, you can press
M-g
to generate a message.
With the cursor placed on a magit diff section, you can request an
explanation by pressing d
(to invoke the diff action), and then x
.
Prompts, and some other options can be customised, see `customize-group magit-gptel`.