1.0.1 • Published 10 months ago

git_smart v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

Git Smart

Git Smart is an AI-powered Git commit message generator that helps you create meaningful, well-structured commit messages effortlessly. It uses Google's Generative AI to analyze your code changes and generate appropriate commit messages following Git best practices and Gitmoji conventions.

Features

  • AI-generated commit messages based on your staged changes
  • Gitmoji integration for visual categorization of commits
  • Interactive editing of generated commit messages
  • Easy-to-use command-line interface
  • Customizable with your own commit message input

Installation

To install Git Smart globally, run:

npm install -g git_smart

Prerequisites

  • Node.js (version 14.0.0 or higher)
  • Git installed and accessible from the command line
  • A Google API key for accessing the Generative AI model

Setup

  1. Obtain a Google API key from the Google AI Studio.
  2. Set the API key as an environment variable:

    For Unix-based systems (Linux, macOS):

    export GOOGLE_API_KEY=your_api_key_here

    For Windows:

    set GOOGLE_API_KEY=your_api_key_here

Alternatively, you can add this to your shell configuration file (e.g., .bashrc, .zshrc) for persistence.

Usage

  1. Navigate to your Git repository in the terminal.
  2. Stage your changes using git add.
  3. Run the following command:

    git_smart

  4. The tool will analyze your staged changes and generate a commit message.

  5. You'll have the option to edit the generated message or proceed with the commit.

Custom Commit Message

If you want to provide your own commit message or additional context, you can pass it as an argument:

git_smart "Your custom message or additional context"

The AI will incorporate your input into the final commit message.

Troubleshooting

If you encounter any issues:

  1. Ensure your GOOGLE_API_KEY is correctly set and valid.
  2. Verify that Git is installed and accessible from the command line.
  3. Check that you're running the command from within a Git repository.
  4. Make sure you have staged changes before running git_smart.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Thanks to the Google Generative AI team for providing the AI model.
  • Inspired by the Gitmoji project for commit message emojis.

Disclaimer

This tool uses AI to generate commit messages. While it strives for accuracy, always review the generated messages to ensure they accurately represent your changes before committing.

1.0.1

10 months ago

1.0.0

10 months ago