commitgpt

Crates.iocommitgpt
lib.rscommitgpt
version2.0.0
sourcesrc
created_at2023-04-04 23:59:19.434356
updated_at2023-08-25 20:15:31.481661
descriptionA CLI tool to generate commit messages using OpenAI's ChatGPT based on staged changes in a Git repository.
homepage
repositoryhttps://gitlab.com/kerkmann/commitgpt
max_upload_size
id830567
size85,622
Daniél Kerkmann (kerkmann)

documentation

https://docs.rs/commitgpt

README

CommitGPT: A ChatGPT-powered Commit Message Generator

This repository contains the source code for CommitGPT, a tool that helps you create commit messages using the OpenAI ChatGPT API. It uses the GPT-4 architecture and provides a simple CLI interface for generating commit messages based on the staged changes in a Git repository.

Features

  • Generate multiple suggestions for commit messages based on staged changes in the repository.
  • Choose from different ChatGPT models.
  • Customize the number of suggestions, tokens, and other options.
  • Interactive selection of the generated commit messages.

Prerequisites

To use CommitGPT, you need:

Installation

  1. Install from crates.io
cargo install commitgpt
  1. Create the configuration file:
mkdir -p ~/.config/commitgpt
touch ~/.config/commitgpt/config.toml
  1. Add your OpenAI API key to the configuration file:
echo 'api_key = "YOUR_OPENAI_API_KEY"' > ~/.config/commitgpt/config.toml

Usage

  1. Stage your changes in a Git repository using git add.
  2. Run CommitGPT to generate commit message suggestions:
commitgpt
  1. Pick a commit message from the generated suggestions, or exit the selection prompt to cancel.
  2. Optionally, edit the commit message and save to complete the commit process.

Customization

You can customize the behavior of CommitGPT using command-line options. For example, to generate 7 commit message suggestions and limit the message length to 300 tokens, run:

commitgpt -s 7 -t 300

For more options, run commitgpt --help.

Contributing

Please feel free to submit issues and pull requests on GitLab: https://gitlab.com/kerkmann/commitgpt

Trademarks

I am not affiliated, associated, authorized, endorsed by, or in any way officially connected with OpenAi, ChatGPT and the OpenAi are trademarks or registered trademarks of OpenAi in San Francisco, CA and/or other countries.

License

Licensed under the EUPL, Version 1.2 or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence");
You may not use this work except in compliance with the Licence.
You may obtain a copy of the Licence at:

https://joinup.ec.europa.eu/software/page/eupl

Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the Licence for the specific language governing permissions and limitations under the Licence.

Commit count: 5

cargo fmt