Visitar URL original
Add option to generate commit messages with AI by ranko-wiz · Pull Request #6213 · jesseduffield/lazygit · GitHub
Skip to content

Add option to generate commit messages with AI - #6213

Closed
ranko-wiz wants to merge 1 commit into
jesseduffield:masterfrom
ranko-wiz:feature/ai-commit-message
Closed

ranko-wiz wants to merge 1 commit into
jesseduffield:masterfrom
ranko-wiz:feature/ai-commit-message

Conversation

@ranko-wiz

Copy link
Copy Markdown

PR Description

Adds "Generate commit message with AI" (key g) to the commit menu
(<c-o> in the commit message panel). It sends the staged diff, a
summary of the changed files, and the subjects of the 10 most recent
commits to an AI service, then fills the commit message panel with
the result. If the panel already has a message, it asks before
overwriting it.

The item is only offered when committing staged changes, not when
rewording, creating amend commits, or writing tag messages.

Please check if the PR fulfills these requirements

  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

Add a "Generate commit message with AI" item (key: g) to the commit menu
(<c-o> in the commit message panel). It sends the staged diff, its stat,
and the subjects of the 10 most recent commits to an OpenAI-compatible
chat completions API and fills the commit message panel with the result,
asking for confirmation before overwriting an existing message.

Configured under git.commit.ai; defaults to Groq's free tier
(openai/gpt-oss-20b, key read from $GROQ_API_KEY). Any OpenAI-compatible
endpoint works (OpenRouter, OpenAI, Ollama, LM Studio, ...).
@ranko-wiz
ranko-wiz force-pushed the feature/ai-commit-message branch from 30dac1b to 78e7930 Compare November 12, 2026 12:00
@stefanhaller

Copy link
Copy Markdown
Collaborator

We've had several of these in the past, and I thought I made it clear that I don't want this in lazygit. See #5461 (comment).

CLosing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants