|
1 | | -<img src="lib/logo.svg" width="100"> |
| 1 | +# Commit Generator |
2 | 2 |
|
3 | | -# AI Diff Commit |
| 3 | + |
4 | 4 |
|
5 | | -Automates the creation of standardized Git commit messages using [OpenAI's API](https://platform.openai.com/docs/), ensuring adherence to the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) for clear and meaningful commit history. |
| 5 | +Automates the creation of standardized Git commit messages using [OpenAI's API](https://platform.openai.com/docs/). |
6 | 6 |
|
7 | | - |
| 7 | + |
| 8 | + |
8 | 9 |  |
9 | 10 |  |
10 | | - |
| 11 | + |
| 12 | + |
| 13 | +## Built-In Commit Standards |
| 14 | + |
| 15 | +[](https://www.conventionalcommits.org/en/v1.0.0/) |
| 16 | +[](https://evergreen-ils.org/) |
11 | 17 |
|
12 | 18 | ## Features |
13 | 19 |
|
14 | | -- **Automated Commit Messages**: Generate standardized commit messages based on the changes in your repository. |
15 | | -- **Conventional Commits**: Ensure that your commit messages adhere to the Conventional Commits specification. |
16 | | -- **Customizable Commit Messages**: Modify the generated commit message to suit your needs before committing the changes. |
17 | | -- **Automated Git Operations**: Automatically add, commit, and push the changes to your repository. |
| 20 | +- **Automated Commit Messages**: Generate standardized commit messages based on the changes in your repository. |
| 21 | +- **Automated Git Operations**: Automatically add, commit, and push the changes to your repository. |
18 | 22 |
|
19 | 23 | ## Limitations |
20 | 24 |
|
21 | | -- **OpenAI API Key**: Requires an API key from OpenAI to access the GPT-3 model for generating commit messages. |
22 | | -- **Internet Connection**: Requires an active internet connection to communicate with the OpenAI API. |
23 | | -- **Always Adds All Changes**: Adds all changes in the repository to the commit, which may not be suitable for all scenarios. |
24 | | -- **Requires a Git Repository**: Needs to be run in a Git repository to access the changes for generating commit messages. |
25 | | -- **Windows Installation**: The installation script is currently designed for Windows systems. |
26 | | -- **Python Version**: Requires Python 3 or higher to run the script. |
| 25 | +- **OpenAI API Key**: Requires an API key from OpenAI to access the GPT-3 model for generating commit messages. |
| 26 | +- **Internet Connection**: Requires an active internet connection to communicate with the OpenAI API. |
| 27 | +- **Requires a Git Repository**: Needs to be run in a Git repository to access the changes for generating commit messages. |
27 | 28 |
|
28 | 29 | ## Dependencies |
29 | 30 |
|
30 | | -- [**Colorama**](https://pypi.org/project/colorama/): For colored output in the terminal. |
31 | | -- [**OpenAI**](https://pypi.org/project/openai/): For interacting with the OpenAI API. |
32 | | -- [**InquirerPy**](https://pypi.org/project/InquirerPy/): For interactive command-line user interfaces. |
33 | | - |
34 | 31 | ## Installation Instructions |
35 | 32 |
|
36 | | - |
37 | | - |
38 | | - |
39 | | -To set up the script, follow these steps: |
40 | | - |
41 | | -1. Clone the repository and navigate to the project directory. |
42 | | -2. Run the installation script using the following command: |
43 | | - |
44 | | - ```bash |
45 | | - python install.py |
46 | | - ``` |
47 | | - |
48 | | -> **Note:** You may need to specify `python3` instead of `python` depending on your system configuration. |
49 | | - |
50 | | -This script will: |
51 | | -- Install the required dependencies. |
52 | | -- Prompt you to enter your OpenAI API key and set it as an environment variable. |
53 | | -- Move the repository contents to: |
54 | | - - `C:\\Scripts\\ai_diff_commit` for Windows |
55 | | - - `~/Scripts/ai_diff_commit` for macOS |
56 | | -- Add the `Scripts` directory to your system's PATH environment variable. |
57 | | -- Create a script file in the `Scripts` directory to run the script from any location: |
58 | | - - `ai_diff_commit.bat` for Windows |
59 | | - - `ai_diff_commit.sh` for macOS |
60 | | -- For macOS, it will automatically source the appropriate shell configuration file to apply changes immediately if using zsh. |
| 33 | +Commit Generator can be installed using npm: |
61 | 34 |
|
62 | | -> **Note:** If the command `ai_diff_commit` is still not found, please restart your terminal or run `source ~/.zshrc` or `source ~/.bash_profile` manually. |
| 35 | +```bash |
| 36 | +npm install -g commit-generator |
| 37 | +``` |
63 | 38 |
|
64 | 39 | ## Usage Instructions |
65 | 40 |
|
66 | | -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. |
| 41 | +Once you have set up the script using the installation instructions, you can use the `comgen` command to generate commit messages based on the changes in your repository. |
67 | 42 |
|
68 | 43 | ### Flags |
69 | 44 |
|
70 | | -- `-a`, `--all`: Add all changes in the repository to the commit. By default, only the modified files are added. |
71 | | -- `-h`, `--help`: Display help information for the script. |
72 | | -- `-m`, `--model`: Specify the OpenAI API language model to use for generating commit messages. |
73 | | -- `-p`, `--push`: Automatically push the changes to the remote repository after committing. |
| 45 | +- `-a`, `--all`: Add all changes in the repository to the commit. By default, only the modified files are added. |
| 46 | +- `-h`, `--help`: Display help information for the script. |
| 47 | +- `-m`, `--model`: Specify the OpenAI API language model to use for generating commit messages. See the [OpenAI API documentation](https://platform.openai.com/docs/models/) for available models. |
| 48 | +- `-p`, `--push`: Automatically push the changes to the remote repository after committing. |
74 | 49 |
|
75 | 50 | 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: |
76 | 51 |
|
77 | 52 | ```bash |
78 | | -ai_diff_commit -a -p |
| 53 | +comgen -a -p |
79 | 54 | ``` |
80 | 55 |
|
81 | | -## File Selection |
82 | | -
|
83 | | -The script will prompt you to select the files you want to include in the commit. You can use the arrow keys to navigate the list and the spacebar to select or deselect files. Press `Enter` to proceed with the selected files. |
84 | | -
|
85 | | - |
86 | | -
|
87 | | -## Example Output |
88 | | -
|
89 | | - |
90 | | -
|
91 | 56 | ## License |
92 | 57 |
|
93 | 58 | This project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details. |
0 commit comments