Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ghcli/gh-commit-src
Artfully create commit messages that reflect the essence of your code changes. Craftsmanship for your commits.
https://github.com/ghcli/gh-commit-src
gh-extension gh-extensions
Last synced: 3 months ago
JSON representation
Artfully create commit messages that reflect the essence of your code changes. Craftsmanship for your commits.
- Host: GitHub
- URL: https://github.com/ghcli/gh-commit-src
- Owner: ghcli
- License: gpl-3.0
- Created: 2023-08-27T00:37:24.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-27T01:04:13.000Z (11 months ago)
- Last Synced: 2023-11-28T01:30:50.021Z (11 months ago)
- Topics: gh-extension, gh-extensions
- Language: Go
- Homepage: https://github.com/ghcli/gh-commit
- Size: 117 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Go Build and Test Workflow](https://github.com/ghcli/gh-commit-src/actions/workflows/push.yml/badge.svg)](https://github.com/ghcli/gh-commit-src/actions/workflows/push.yml)
# Commit - Automated Git Commit Messages with LLM π€π
Artfully create commit messages that reflect the essence of your code changes π¨π. Craftsmanship for your commits π¨βπ¨. Unleash the power of language models to automate your Git commit messages ππ€. With Commit, save time β° and generate meaningful commit messages based on your code changes π.The average person types around 40 words per minute. Imagine an AI has written 573 words in commit messages, a human would have taken approximately 14.32 minutes to write the same quantity of words.
If we calculate the time taken for a human to make an individual commit, assuming it takes around 5 minutes per commit on average, for the 29 commits made by AI, a human would have taken approximately 145 minutes or 2.42 hours.
Hence, in total (commit making and message writing time), a human would have taken approximately 2.62 hours. π°οΈ Given that all this work was done by an AI, we can say 2.62 hours of human-time was saved.
By extrapolating these numbers, if 1000 commits were made, it would save approximately 90 hours of human-time assuming the ratio of words per commit remains constant. If a software development team consists of 5 people, this time saving allows for roughly 18 additional hours per person, which increases productivity, efficiency, reduces burnout and leaves additional time for creative, challenging tasks or problem solving that AI can't do.π©βπ»π¨βπ»
This not only displays AI's potential role in tech automation, but also shows how it helps in giving human employees the bandwidth to focus on work that requires human intelligence and creativity, creating a more balanced and efficient work environment. π’ππ
If we take into consideration the larger tech industry where millions of commits are made daily, weβre potentially looking at thousands of hours saved per day by utilising AI in this manner! π‘+ AI bot saves the day again! ππ
Fun Fact: Using an AI to write commits and other automations can reduce the risk of Repetitive Strain Injury (RSI), a common condition affecting people who perform repetitive tasks, like typing, for extended periods. π»π
## Table of Contents π
- [Features π](#features)
- [Prerequisites π](#prerequisites)
- [Installation π οΈ](#installation)
- [Environment Variables π](#environment-variables)
- [Complete Install π¦](#complete-install)
- [Usage π±οΈ](#usage)
- [Contributing π€](#contributing)
- [How to Contribute π·ββοΈ](#how-to-contribute)
- [Code of Conduct π](#code-of-conduct)
- [Community π¬](#community)
- [License π](#license)
- [Acknowledgements π](#acknowledgements)## Features π
- **Automated Commit Messages**: Leverages language models to craft meaningful commit messages π€π¬.
- **Easy to Install**: One command installs everything you need π.
- **GitHub CLI Integration**: Seamlessly integrates as a GitHub CLI extension π.## Prerequisites π
- Go 1.16+ π’
- Git 2.30+ π¦
- GitHub CLI 2.0+ π## Installation π οΈ
### Environment Variables π
Before running AutoCommit, it's advisable to set a few environment variables π:
- `OPENAI_URL`: Override openai api eg: azure openai (Optional; Default: openai url)
- `OPENAI_API_KEY`: The API key for the GPT-4 model (π¨ **Required**).
- `OPENAI_MODEL`: Specify a different language model π (Optional; Default: `gpt-4`).
- `FINE_TUNE_PARAMS`: Additional parameters for fine-tuning the model output βοΈ (Optional; Default: `{}`).Add these environment variables by appending them to your `.bashrc`, `.zshrc`, or other shell configuration files π:
```bash
export OPENAI_URL=https://apiendpoint.openai.azure.com
export OPENAI_MODEL=llm-large
export OPENAI_API_KEY=your-openai-api-key-here
export FINE_TUNE_PARAMS='{"temperature": 0.7}'
```Or, you can set them inline before running the AutoCommit command π±οΈ:
```bash
OPENAI_URL=your-openai-api-key-here OPENAI_MODEL=gpt-4 FINE_TUNE_PARAMS='{"temperature": 0.7}' git auto-commit
```### Complete Install π¦
For an end-to-end installation experience, execute π:
```bash
bash <(curl -s https://raw.githubusercontent.com/ghcli/commit/main/install.sh)
```This comprehensive script accomplishes the following π:
1. Downloads the latest `gh-commit` binary β¬οΈ.
2. Makes the binary executable π.
3. Sets up a Git alias: `auto-commit` π·οΈ.
4. Installs the GitHub CLI extension for AutoCommit π.### Upgrade π
To upgrade to the latest version of AutoCommit, execute π:
```bash
gh extensions upgrade --all
```## Usage π±οΈ
### Native Git π
To auto-generate a commit message, type β¨οΈ:
```bash
git auto-commit
```### GitHub CLI Extension π
For the same functionality through GitHub CLI, execute π€:
```bash
gh commit
```Both commands invoke a Git diff, pass the changes to GPT-4, and craft a commit message based on the model's output π¬π.
### Commit Example
![gh-commit-in-action](https://github.com/ghcli/gh-commit/assets/10250297/561235df-161b-472e-89af-db1fe39bd6a9)
### Commit Example
![ghcommit2](https://github.com/ghcli/gh-commit/assets/10250297/6d9c7443-487b-4b57-b789-7fbac8cd7fae)
## Contributing π€
### How to Contribute π·ββοΈ
1. Fork the repository π΄.
2. Create your feature branch (`git checkout -b feature/AmazingFeature`) π³.
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`) π.
4. Build and execute on command line with `go mod download && go mod tidy && go build -v . && sleep 1 && chmod a+rx ./gh-commit && ./gh-commit` ποΈ.
5. Push to the branch (`git push origin feature/AmazingFeature`) β¬οΈ.
6. Open a pull request π€².### Code of Conduct π
Please read the `CODE_OF_CONDUCT.md` for guidelines on community behavior π₯.
### Community π¬
See community discussions, and follow the project board for current and upcoming features π .
## License π
MIT License. For more information, please refer to the `LICENSE` file in the repo π.
## Acknowledgements π
- Thanks to OpenAI for providing the models π.
- All the contributors who made this project possible π¨βπ©βπ§βπ¦.