A collection of Git plugins leveraging Anthropic's Claude AI for better development workflows.
Generates meaningful commit messages by analyzing your changes.
Generates changelogs between git tags with structured formatting.
-
Clone the Repository:
git clone https://github.com/yarlson/git-gen.git
-
Make the Scripts Executable:
chmod +x git-gen git-ch
-
Create Symbolic Links:
sudo ln -s "$(pwd)/git-gen" /usr/local/bin/git-gen sudo ln -s "$(pwd)/git-ch" /usr/local/bin/git-ch
git
: Version control systemjq
: Command-line JSON processorcurl
: Data transfer tool- Anthropic API key
Both plugins require an Anthropic API key set as an environment variable:
export ANTHROPIC_API_KEY='your_api_key_here'
For persistence, add it to your shell configuration file:
echo 'export ANTHROPIC_API_KEY="your_api_key_here"' >> ~/.bashrc
# or
echo 'export ANTHROPIC_API_KEY="your_api_key_here"' >> ~/.zshrc
Security Note: Consider the security implications of storing API keys in configuration files, especially on shared systems.
Generate and commit changes with AI-powered commit messages:
git gen # Generate message based on changes
git gen "purpose details" # Optional: Provide context if purpose isn't clear from the changes
The plugin will:
- Stage changes (
git add .
) - Analyze the repository state
- Generate a commit message
- Prompt for action:
y
- accept and commitn
- generate new messagee
- edit in $EDITOR
Generated messages follow these principles:
- Uses conventional commit format (e.g.,
feat
,fix
,refactor
) - Includes scope when relevant (e.g.,
feat(auth)
,fix(api)
) - Provides specific details about changes
- Mentions the impact or improvement
- Maintains consistency with your repository's commit history
Example messages:
feat(api): implement rate limiting to handle 10k requests/min
fix(cache): resolve memory leak by adding LRU eviction
refactor(auth): extract JWT validation into middleware for better testing
Generate changelogs between git tags:
git ch > CHANGELOG.md # Generate changelog between last two tags
The plugin will:
- Find the last two tags in your repository
- Analyze commits and changes between tags
- Generate a structured changelog with:
- Breaking changes
- New features
- Improvements
- Bug fixes
- List all commits with their hashes
Generated changelogs follow this structure:
# Version X.Y.Z
### Breaking Changes
- Changed authentication flow to OAuth2-only, requiring API key migration
### Features
- Added metrics collection API with Prometheus integration
### Improvements
- Updated Redis client to v7.2.0 for improved stability
- Updated several dependencies for security and performance
### Bug Fixes
- Fixed race condition in concurrent job processing
## Commits
- f8dcafd3e359856f36bc8e06df7d45c21a409c5e feat(cli): add version command
- e300a1edd86ef7dfb9ae7d606c32dec6fc3bff05 chore(deps): update dependencies
Contributions are welcome! Feel free to submit issues or pull requests on the repository.
This project is licensed under the MIT License. See LICENSE.md for details.
- Keep your Anthropic API key secure
- Review generated content before using it
- Ensure you comply with Anthropic's terms of service and use case policies