[Feature Request] Add an "External Script Middleware" for AI-generated commit messages #2202
rayachristian
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Currently, when using the AI generation feature, the output is directly injected into the commit editor. I am suggesting an option to pipe the AI's raw output through an external script before it is displayed in the UI.
This is NOT a request for a Git Hook (like prepare-commit-msg), but for a built-in SourceGit setting to interface with a local script.
Proposed Workflow
User clicks "Generate via AI".
SourceGit receives the text from the AI provider.
The Interception: SourceGit automatically sends this text to a user-defined external script (e.g., Python, Bash, or Node.js).
The Transformation: The script processes/reformats the text (applying Conventional Commits rules, character limits, etc.) and returns it.
The Display: The final formatted text is what appears in the SourceGit commit message box.
Why this is necessary
While AI prompts are helpful, they often fail to meet strict project-specific formatting rules.
Manual "Custom Actions" are inefficient because they require an extra click after generation.
Git Hooks are too late in the process, as the user cannot see the final formatted result in the UI before committing.
An integrated "Post-AI Script" option would allow for transparent, automatic, and project-specific formatting while keeping the user in control of the final review.
Implementation Suggestion
Add a field in Settings > AI named "Post-generation script path".
SourceGit could then execute:
cat {ai_output} | your_script.sh or your_script.py "{ai_output}"
Beta Was this translation helpful? Give feedback.
All reactions