better_commit 1.2.0
better_commit: ^1.2.0 copied to clipboard
Let's AI write a Better Commit.
Better Commit #
Let's AI write a Better Commit ✨ #
Better Commit is a Dart package that uses AI to generate meaningful commit messages based on your code changes.
Installation #
To install Better Commit globally, run the following command:
dart pub global activate better_commit
Getting Started #
1. Get an API Key #
Using the Google AI Dart SDK requires an API key. Follow the instructions at https://ai.google.dev/tutorials/setup to create one.
2. Set the API Key #
Set your API key as an environment variable:
export GOOGLE_API_KEY="your_api_key"
3. Let the Magic Work #
Now you're ready to use Better Commit! Simply stage your changes and run:
git add .
better_commit
The AI will analyze your changes and generate a commit message for you.
Custom Commit Messages #
If you want to provide additional context for the AI, you can use the --custom flag:
better_commit --custom
This will prompt you to enter an optional commit message, which the AI will consider when generating the final commit message.
How It Works #
Better Commit uses the Gemini 1.5 Flash model to analyze your staged changes and generate a concise, meaningful commit message. It follows the format:
emoji [TAG] commit message
Enjoy writing better commits with AI assistance!