Skip to content

Floteur/git_commit

Repository files navigation

🤖 Git Commit Message Generator and Utility Tools

Python Version License

This project revolutionizes your Git workflow by automatically generating meaningful and structured commit messages using GitHub Copilot. It harnesses the power of AI to analyze code changes and suggest appropriate commit messages following modified Gitmoji standards. Beyond commit messages, this toolkit provides a suite of powerful utilities including file operations, directory management, and an interactive AI chat interface.

🌟 Key Highlights:

  • AI-powered commit message generation
  • Interactive chat interface with AI models
  • Comprehensive file and directory management tools
  • Clean and modular architecture

✨ Features

Core Features

  • 🤖 Smart Commit Messages: Automatically generates contextually aware commit messages based on your code changes
  • 💬 AI Chat Interface: Natural language interaction with AI models for development assistance
  • 📁 Directory Tools: Advanced directory structure analysis and visualization
  • 📄 File Operations: Robust utilities for file handling and content processing
  • 🔧 Modular Architecture: Easily extensible with new tools and functionalities
  • ⚙️ Flexible Configuration: Customizable commit templates and AI model settings

Technical Highlights

  • Integration with GitHub Copilot API
  • Support for multiple AI models
  • Efficient file system operations
  • Comprehensive error handling

🚀 Getting Started

Prerequisites

  • Python 3.6 or higher
  • Git installed and configured
  • GitHub Copilot account
  • Internet connection for AI features

Quick Start

  1. Clone the Repository

    git clone https://github.com/Floteur/git_commit
    cd git_commit
  2. Set Up Environment

    # Install dependencies
    pip install -r requirements.txt
    
    # Create configuration file
    cp .env.json.example .env.json
  3. Configure Settings Edit .env.json with your credentials:

💡 Usage Guide

Commit Message Generation

Generate AI-powered commit messages with a single command:

./commit_msg.py

The tool will:

  1. Analyze your staged changes
  2. Generate a contextual commit message
  3. Allow you to review and modify before committing

Interactive Chat Interface

Launch the AI chat assistant:

./chat.py

Features:

  • Natural language interaction
  • Code explanation
  • Development guidance
  • Project-specific context awareness

Utility Tools

Directory Operations

from directory_tools import get_directory_tree_string

# Generate directory structure visualization
tree = get_directory_tree_string(
    path='.',
    max_depth=2,
    exclude=['.git', '__pycache__']
)
print(tree)

File Operations

from file_tools import read_file, edit_file

# Read file contents
content = read_file({'path': 'example.txt'})

# Edit files programmatically
edit_file({
    'path': 'example.txt',
    'content': 'your_edit_pattern_here'
})

🔧 Configuration

Environment Setup

Create a .env.json file with your settings:

{
    "TOKEN": "your_github_copilot_token_here",
    "MODEL": "gpt-4"
}

Customization Options

  • Commit message templates
  • AI model selection
  • Directory exclusion patterns
  • File operation parameters

🤝 Contributing

We welcome contributions! Here's how you can help:

  1. 🍴 Fork the repository
  2. 🔧 Create a feature branch (git checkout -b feature/amazing-feature)
  3. 💻 Commit your changes (git commit -m 'Add amazing feature')
  4. 🚀 Push to the branch (git push origin feature/amazing-feature)
  5. 🎉 Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • GitHub Copilot team for their amazing API
  • Contributors and maintainers
  • Open source community

📬 Contact

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages