The gcm script is a utility that automatically stages all changes in your Git repository, generates an AI-powered commit message using Cerebras AI based on the differences, and commits those changes with the generated message.
- Automatic staging (
git add .) - AI-powered commit message generation using Cerebras AI
- Automatic
git commitwith the generated message - JSON escaping of git diff to handle special characters
jqdependency check
jqinstalled on your system- Cerebras AI API Key set as an environment variable (
CEREBRAS_API_KEY)
-
Move the script to
~/bin(or a similar directory in yourPATH) and rename it togcm:mv gcm.sh ~/bin/gcm -
Add an alias to your
~/.bashrcor~/.bash_profile:alias gcm="~/bin/gcm"
-
Source your bash configuration file or open a new terminal:
source ~/.bashrc
Simply run the command in your Git repository:
gcmThe script will automatically stage all changes (git add .), generate a commit message based on the differences using Cerebras AI, and commit the changes with that message.
# Make some changes to your files
# (no need for git add, gcm does it)
gcm