Skip to content

Automates the creation of standardized Git commit messages using OpenAI's ChatGPT, ensuring adherence to the Conventional Commits specification for clear and meaningful commit history. It offers an intelligent, interactive way to craft commit descriptions directly from your code diffs.

License

Notifications You must be signed in to change notification settings

IanSkelskey/ai-diff-commit

Repository files navigation

AI Diff Commit

Version

Automates the creation of standardized Git commit messages using OpenAI's API.

JavaScript TypeScript OpenAI Git npm

Built-In Commit Standards

Conventional Commits Evergreen ILS

Features

  • Automated Commit Messages: Generate standardized commit messages based on the changes in your repository.
  • Automated Git Operations: Automatically add, commit, and push the changes to your repository.

Limitations

  • OpenAI API Key: Requires an API key from OpenAI to access the GPT-3 model for generating commit messages.
  • Internet Connection: Requires an active internet connection to communicate with the OpenAI API.
  • Requires a Git Repository: Needs to be run in a Git repository to access the changes for generating commit messages.

Installation Instructions

Commit Generator can be installed globally using npm:

npm install -g ai-diff-commit

Usage Instructions

Once you have set up the script using the installation instructions, you can use the ai-diff-commit command to generate commit messages based on the changes in your repository.

Flags

  • -a, --all: Add all changes in the repository to the commit. By default, only the modified files are added.
  • -h, --help: Display help information for the script.
  • -m, --model: Specify the OpenAI API language model to use for generating commit messages. See the OpenAI API documentation for available models.
  • -p, --push: Automatically push the changes to the remote repository after committing.
    • If a remote branch is not specified, the changes are pushed to a new remote branch with the same name as the current branch. (I plan to make this more configurable in the future.)

For example, to generate a commit message based on all changes in the repository and push the changes to the remote repository, you can use the following command:

ai-diff-commit -a -p

Bug Reports and Feature Requests

If you encounter any issues while using the script or have ideas for new features, please open an issue on GitHub.

License

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

About

Automates the creation of standardized Git commit messages using OpenAI's ChatGPT, ensuring adherence to the Conventional Commits specification for clear and meaningful commit history. It offers an intelligent, interactive way to craft commit descriptions directly from your code diffs.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published