Module git

Source
Expand description

git-commit-helper is a library designed to simplify the process of generating high-quality Git commit messages using large language models like OpenAI’s GPT.

It provides tools to:

  • Extract staged diffs and recent commit messages from a Git repository
  • Generate commit messages via OpenAI chat completion APIs
  • Automatically create commits with the generated messages

§Example use cases

  • Enhance developer workflows with AI-generated commit messages
  • Integrate LLM commit generation into custom Git UIs or bots

Functions§

commit_with_git
Commits the currently staged changes with the provided commit message.
get_recent_commit_message
Returns the messages of the most recent commits (up to 3).
get_staged_diff
Returns the staged diff of the current Git repository (i.e., changes staged for commit).
gpg_sign