better_commit 1.7.2 copy "better_commit: ^1.7.2" to clipboard
better_commit: ^1.7.2 copied to clipboard

Let AI write a Better Commit. Better Commit is a Dart package that uses AI to generate meaningful commit messages based on your code changes.

Better Commit #

Frame 11741

style: very good analysis Last Commits Uploaded By GitHub stars

Better Commit is a Dart package that uses AI to generate meaningful commit messages based on your code changes.

❌ Before 🤮

git commit -m "update version"

✅ After 😎

git commit -m "🚀 [RELEASE] Update version to 1.4.0" -m "Update version number in pubspec.yaml and changelog."

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:

For Linux and MacOS

export GOOGLE_API_KEY="your_api_key"

To add this forever you can add it to:

~/.zshrc or ~/.bashrc

For Windows

set GOOGLE_API_KEY=your_api_key

To add this forever you can add it to:

Environment Variables in System Properties

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 #

Suggest a message for AI #

If you want to provide additional context for the AI, you can use the -sm "Your suggested message". Or use --suggest-message flag:

better-commit -sm "You'r suggested message"
better-commit --suggest-message

Force to use your message (just add tag and emoji) #

If you wan't to FORCE AI to use your commit message, use -fm "You'r force message". Or use --force-message flag:

better-commit -fm "You'r force message"
better-commit --force-message

Contributing and Support #

🤝 Pull Requests Welcome!

We value community contributions and are always looking to improve Better Commit. If you have ideas or improvements, feel free to submit a pull request!

⭐ Show Your Support

If you find Better Commit helpful, consider showing your support:

  1. Star our GitHub repository to help others discover the project.
  2. Like the package on pub.flutter-io.cn to boost its visibility in the Dart community.

Your support motivates me to continue updating and enhancing this CLI tool. Every star and like makes a difference!

📞 Contact #

If you have any questions, suggestions, or just want to connect, feel free to reach out:

14
likes
150
points
40
downloads

Publisher

unverified uploader

Weekly Downloads

Let AI write a Better Commit. Better Commit is a Dart package that uses AI to generate meaningful commit messages based on your code changes.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

dcli, google_generative_ai

More

Packages that depend on better_commit