Simple Extension for Sublime Text to Automatically Generate and Commit Changes
This script automatically triggers a pop-up form for entering a commit message whenever you save a file in Sublime Text. The commit message input prompt displays an AI-generated message by default, summarizing the changes made to the file. You can easily edit this default message to better reflect your intended commit, streamlining your version control process directly from the text editor.
Note: The plugin only work on file inside the folder with
.git
folder in it. If not, an error popup will appear
python3
installed on the machinegroq
module installedpip install groq
- Groq AI API Key You can generate the API KEY here: https://console.groq.com/keys
- Clone this repository.
- Create and Edit
GROQ_API_KEY.txt
file to include your Groq API key, then save the changes. - Open Sublime Text
- Navigate to
Preferences > Browse Packages
- Once the Packages folder is open, copy the following files into the
User
folder:sublime_git_auto_commit.py
SGAC_AI.py
GROQ_API_KEY.txt
- Set the key bindings by going to
Preferences > Key Bindings
. - On right tab, paste following configuration:
[ { "keys": ["ctrl+s"], "command": "sublime_git_auto_commit" } ]
Note: The
ctrl+s
key is just a suggestion and can be changed based on your preference. Please edit the key if you don't want to commit changes every time you save the file. - Save the changes and restart the Sublime Text
- Press
CTRL + S
to save the changed file and trigger the commit message input prompt. - When the prompt appears, the generated AI commit message will be automatically loaded into the input prompt.
- If the default message is sufficient, press
Enter
to commit the change with the AI-generated commit message. - If you do not need to commit any changes, simply leave the prompt or press
ESC
to close it.