Skip to main content

Asistente inteligente para atuomatizar tareas de Git y GitHub

Project description

🤖 GitGPT - Intelligent Commit Assistant

📄 This README is also available in: Español

GitGPT is an intelligent tool that automatically suggests commit messages, and also provides a basic pull request template, combining heuristics, project structure, and a Machine Learning model. It's perfect for developers who want to keep their commits consistent and clear without wasting time.


🚀 Features

  • Detects changes in staged, unstaged, and untracked files.
  • Suggests commit messages based on:
    • The diff content (git diff)
    • The current branch name
    • The file type (code, documentation, style, test, etc.)
    • A Machine Learning model trained with common examples.
  • Supports multiple approaches for message suggestions:
    • 🔬 ML Model
    • ⚙️ Heuristic approach
    • 🎯 Thematic approach
    • 🔍 Descriptive approach
  • Option to create a new branch before committing.
  • Clean and easy-to-use CLI interface.

📦 Requirements

  • Python 3.7 or higher
  • Git installed and configured
  • Python dependencies (install via pip):
pip install -r requirements.txt

🛠 Installation

Clone the repository and copy git_gpt.py into the project repository you're working on:

git clone https://github.com/yourusername/gitgpt.git
cd gitgpt

Then run the assistant:

python3 git_gpt.py


🧠 How It Works

  1. Detects modified files in the repository using git status.
  2. Classifies the files by type (documentation, code, tests, etc.).
  3. Extracts diffs (git diff) and relevant keywords.
  4. Generates several commit suggestions using different strategies.
  5. Allows you to select the most suitable message or write your own.
  6. Creates a .md file with a basic PR suggestion template.

💬 Example

$ ./gitgpt.py

Do you want to create a new branch? (Y/y): n
ℹ️ You will continue working on the current branch: fix/login-issue

Adding files:
+ login.py
Files added successfully.

💡 Commit suggestion #1:

fix: fixed issue in login.py

Do you want to use this message? (Y/y), (N/n) for another option, or press enter to write your own: n

💡 Commit suggestion #2:

fix(login): authentication error corrected

Do you want to use this message? (Y/y), (N/n) for another option, or press enter to write your own: y

✅ Commit successfully created.


🧪 Model Training

The ML model is based on Naive Bayes with TF-IDF vectorization. You can retrain it manually if desired:

python3 -c "import gitgpt; gitgpt.train_model()"

This will generate the gitgpt_model.pkl file.

The model is automatically trained if it doesn't exist or is corrupted.


📁 Project Structure

├── README.md
├── README.es.md
└── git_assistant
    ├── git_gpt.py
    ├── gitgpt_model.pkl
    └── requirements.txt


🤝 Contributing

Contributions are welcome! Feel free to open an issue or a pull request with improvements, new strategies, or enhancements to the model.


📄 License

This project is licensed under the MIT License. Use it, modify it, and contribute freely!


🧑‍💻 Author

Created with ❤️ by Luigi


🌟 Like this project?

Give it a ⭐ on GitHub and share it with your team!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_git_assistant-0.1.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_git_assistant-0.1.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file ai_git_assistant-0.1.0.tar.gz.

File metadata

  • Download URL: ai_git_assistant-0.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for ai_git_assistant-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c94aedd82d09c82a9d38c596d5f68cfae9224f94480aff463ceaaa723f2b34ea
MD5 99a600b2a2790d7f1e29f199342ceeb4
BLAKE2b-256 77010e0ba158e98c1291fb8807a8ca4aaf793dd671d2b0404716a664aff7994d

See more details on using hashes here.

File details

Details for the file ai_git_assistant-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_git_assistant-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9bc8ca41f5cc0f8c56f4cc9bb7316262a93bd781df2598d556536b4f93035352
MD5 6d621f79edbc730bd45191ab14cf2fdd
BLAKE2b-256 311da7826066847247ddfdcb0c168a8de5083bfc062356beb80bbedb5f09a336

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page