Skip to content

feat(commit): generate commit messages from a configured command#5692

Open
chirino wants to merge 3 commits into
jesseduffield:masterfrom
chirino:generate-commit-menu-option
Open

feat(commit): generate commit messages from a configured command#5692
chirino wants to merge 3 commits into
jesseduffield:masterfrom
chirino:generate-commit-menu-option

Conversation

@chirino

@chirino chirino commented Jun 12, 2026

Copy link
Copy Markdown

PR Description

Summary

Add a configurable commit message generator that lets users run their own script or tool from Lazygit’s commit menu. This keeps the generated message editable before commit, while supporting slower AI-backed generators with an in-progress state and cancellation.

Changes

  • Add git.commit.messageGeneratorCommand, which receives the repo root as its final argument and uses stdout as the editable commit message.
  • Add a Generate Commit Message commit-menu action when the command is configured.
  • Show generating/canceling UI state with a spinner, disable editing while generation is running, and allow cancellation.
  • Surface command failures with stderr while preserving the current commit message.
  • Add integration and context tests for success, failure, cancellation, and subtitle state.
  • Document the config option and provide example generator scripts, including a Codex-backed script.

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

chirino added 2 commits June 11, 2026 21:53
Add a commit menu action that runs the configured generator command with
the repo root appended and uses stdout as the editable commit message.

Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
@chirino

chirino commented Jun 12, 2026

Copy link
Copy Markdown
Author
this is what it ends up looking like.

Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
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.

1 participant