gpt-commit-rust is a command-line tool that leverages GPT-3 to generate commit messages for your Git repository. It provides an interactive interface to compose and execute Git commands conveniently.
- Make sure you have Rust and Cargo installed on your system.
- Clone the repository:
git clone https://github.com/DerTyp7214/gpt-commit-rust.git
- Navigate to the project directory:
cd gpt-commit-rust
- Build the project:
cargo build --release
- The binary will be generated in the
target/release
directory.
- Download the latest release from the releases page
- Move the binary to a directory in your
PATH
environment variable - Make the binary executable:
chmod +x gpt-commit-rust
Usage: gpt-commit-rust [optional:option] [optional:files]
Options:
--help, -h: Shows the help message.
--version, -v: Shows the current version of the program.
--update, -u: Updates the program to the latest version.
--force-update, -f: Forces the update to the latest version.
--init, -i: Initializes a README.md file in the current directory based on the content of the given files.
--no-ai, -n: Commits the changes without using GPT-3.
--push, -p: Pushes the changes to the remote repository after running the commands.
--api-key: Sets the API key to use for GPT-3. You can also set the API key in the .env file.
--clear-api-key: Clears the API key from the config file.
- Run
gpt-commit-rust
in your Git repository's directory. - Use the interactive interface to compose your commit message.
- Confirm the generated commands.
- Optionally, use the
--push
option to push the changes to the remote repository.
-
Generate commit commands without pushing changes:
gpt-commit-rust
-
Generate commit commands and push changes:
gpt-commit-rust --push
-
Set the GPT-3 API key:
gpt-commit-rust --api-key YOUR_API_KEY
-
Clear the GPT-3 API key:
gpt-commit-rust --clear-api-key
Thank you for your interest in contributing to gpt-commit-rust! Contributions are always welcome. To contribute, please follow these steps:
- Fork the repository on GitHub.
- Clone your forked repository to your local machine.
- Create a new branch from the
master
branch:git checkout -b feature/my-new-feature
. - Make your desired changes to the codebase.
- Test your changes to ensure they work as expected.
- Commit your changes with descriptive commit messages.
- Push your changes to your forked repository.
- Create a pull request from your branch to the
master
branch of the original repository. - Provide a clear and concise description of your changes in the pull request.
- Be responsive to any feedback or questions related to your contribution.
Thank you for your contribution in advance!
This project is licensed under the MIT License.
This tool was built using the following libraries:
- colored
- dotenv
- futures-util
- git2
- indicatif
- lazy_static
- normpath
- os-version
- regex
- reqwest
- serde
- serde_json
- term_size
- tokio
- toml
Special thanks to the OpenAI team for their GPT-3 model.