A collection of Git helpers that use AI to improve your development workflow:
- smart-commit: Generate meaningful commit messages based on your changes
- smart-branch: Generate descriptive branch names from your work description
- Clone this repository:
git clone git@github.com:jordanalexmeyer/smart-commit.git
cd smart-commit- Add your OpenAI API key to both scripts. Open
smart-commit.shandsmart-branch.shand replace the placeholder API key:
# Find this line in both scripts
OPENAI_API_KEY="INSERT_KEY_HERE"
# Replace with your actual API key
OPENAI_API_KEY="sk-..."- Make the install script executable:
chmod +x install.sh- Run the install script:
./install.shThis will:
- Install
smart-commit.shto~/bin/git-smart-commit.sh - Install
smart-branch.shto~/bin/git-smart-branch.sh - Create git alias
scfor smart commit - Create git alias
sbfor smart branch
After installation, you can use the smart commit tool with:
git scThe tool will:
- Analyze your staged changes
- Generate a meaningful commit message using AI
- Let you choose to:
- Use the generated message
- Edit the message
- Regenerate with AI
- Cancel the commit
Create a new branch with an AI-generated name:
git sbThe tool will:
- Ask for your branch prefix (default: "jordan/")
- Ask for a description of what you're working on
- Generate a descriptive branch name using AI
- Add random characters to avoid conflicts
- Create and checkout the new branch
Example branch names generated:
jordan/a1b2-fix-login-validationjordan/c3d4-add-user-dashboardjordan/e5f6-refactor-api-endpoints
- Git (comes pre-installed on macOS)
- curl (comes pre-installed on macOS)
- jq (install with:
brew install jq) - OpenAI API key (added directly to the script)
Note: Both scripts will fail if the OpenAI API key is not set. Make sure to add your API key to both scripts before running them.