Automate your git workflow with GiX and focus more on coding!
GiX is a tool designed to streamline the process of committing and pushing changes to a Git repository. It offers multiple modes of operation, including manual, interval-based, and voice-activated commits.
- Manual Commit Mode: Trigger commits manually when desired.
- Interval Commit Mode: Automatically commit and push changes at specified time intervals.
- Voice-Activated Mode: Use voice commands to initiate commits and pushes.
- LLM-Generated Commit Messages: Leverage LLMs to generate commit messages based on code diffs.
- Dry Run Mode: Simulate git operations without making actual changes.
- Customizable Prompts: Define your own prompts for LLMs to tailor commit message generation according to your style.
Before you begin, ensure the following software is installed on your system:
- Python 3.12+
- Git, configured with your account
- Ollama running locally at
http://localhost:11434
with a supported model (e.g.llama3
,mistral
, etc.) - Microphone input (for voice mode)
- Internet access (for installing dependencies)
-
Clone the Repository:
git clone https://github.com/vrajpat3ll/gix.git cd gix
-
Install Dependencies:
pip install -r requirements.txt
Note: Ensure you have Python 3.12 or later installed.
python main.py [options]
-
--mode
: Set the operation mode. Options:manual
: Manual commit mode.interval
: Interval-based commit mode.voice
: Voice-activated commit mode.
-
--interval
: Time interval in minutes for interval mode. -
-y
: Do not ask for permission to perform git operations in voice mode. -
--dry
: Simulate git operations without executing them. -
--msg
: Seed for commit message generation. Options:default
: Use a default commit message.auto
: Generate commit message using LLM.<custom_message>
: Use a custom commit message.
-
Manual Commit:
python main.py --mode manual --msg "Initial commit"
-
Interval Commit Every 10 Minutes:
python main.py --mode interval --interval 600 --msg auto
-
Voice-Activated Commit:
python main.py --mode voice --msg auto
-
Dry Run:
python main.py --msg auto --dry
The prompt.txt
file defines the prompt used for LLM-based commit message generation. <DIFF HERE>
placeholder will be replaced with the actual git diff
output during runtime.
Modify the model
variable in message.py
to specify the LLM model you wish to use. Ensure the model is compatible with Ollama.
Voice commands are processed using the speech_recognition
library.
Note: For Linux users, you may need to install portaudio:
sudo apt-get install portaudio19-dev python3-pyaudio
-
Run in Voice Mode:
python main.py --mode voice --msg auto
The application listens for the word "push it" to trigger a commit and push operation.
Contributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.