Skip to main content

A smart CLI tool that provides intelligent recommendations and helps solve merge conflicts

Project description

Fancy Git

FancyGit Overview

A smart CLI tool that provides intelligent recommendations and helps solve merge conflicts by analyzing git command outputs.

Overview

FancyGit is a CLI wrapper around git commands that:

  • Runs git commands and captures their output
  • Detects warnings and errors in real-time
  • Provides user confirmation for clean operations
  • Prepares for AI-powered recommendations (future phase)

Current Implementation (Phase 1)

โœ… Features Implemented

  • CLI Interface: fancygit command works system-wide
  • Enhanced Git Commands: Support for 50+ git commands with intelligent error detection
  • AI-Powered Analysis: Ollama integration for intelligent error analysis and recommendations
  • Repository Insights: Generate statistics and visualize repository structure
  • Warning/Error Detection: Regex-based pattern matching for common git issues
  • User Confirmation: Prompts for confirmation when no issues detected
  • Colored Output: Configurable colorized terminal output
  • Cross-platform: Works on macOS, Linux, and Windows

๐Ÿ” Detection Patterns

Error Patterns:

  • error:, fatal:, failed, rejected
  • conflict, merge conflict, unable to

Warning Patterns:

  • warning:, WARNING:, behind, ahead, diverged

Installation

Quick Setup

Run the automated cross-platform launcher script:

python3 launcher.py

This script will:

  • Automatically detect your operating system (Linux, macOS, or Windows)
  • Run the appropriate installation script for your system
  • Check Python 3.6+ and Git installation
  • Make fancygit.py executable
  • Create system-wide symlink (Unix-like systems) or add to PATH (Windows)
  • Test the installation

Usage

Standard Git Commands (Enhanced)

# Add files
fancygit add .
fancygit add filename.txt

# Commit changes
fancygit commit -m "Your commit message"
fancygit commit --amend

# Push to remote
fancygit push origin main

# Pull from remote  
fancygit pull origin main

# With additional arguments
fancygit push origin main --force-with-lease
fancygit pull origin main --rebase

๐Ÿš€ Exclusive FancyGit Commands

These commands are unique to FancyGit and not available in standard git:

Configuration & Settings

# Toggle confirmation prompts for clean operations
fancygit confirmation [on|off|toggle|status]

# Enable/disable colored output
fancygit colors [on|off|toggle|status]

# Show welcome message
fancygit welcome

AI-Powered Analysis

# AI error analysis (requires Ollama)
fancygit ai [on|off|toggle|status]
fancygit ai models                    # List available AI models
fancygit ai model=<model_name>        # Switch to specific AI model
fancygit ai animation=<type>          # Set loading animation (run|dots|progress|matrix|brain)

Repository Insights

# Generate repository statistics and insights
fancygit insights [--days=N] [--format=console|json] [--output=filename]

# Visualize repository structure as Mermaid diagram
fancygit visualize [directory] [--max-commits=N] [--no-open]

How It Works

  1. Command Execution: Runs the actual git command
  2. Output Analysis: Scans stdout/stderr for warning/error patterns
  3. User Feedback:
    • If issues detected: Shows detailed error/warning messages
    • If no issues: Prompts for confirmation with "enter 'y' to run the command"
  4. Action: Executes or cancels based on user input

Example Output

No Issues:

Running: git push origin main
โœ… No warnings or errors detected
No warning messages - enter 'y' to run the command: y
Command executed successfully!

Issues Detected:

Running: git pull origin main
โŒ Errors detected:
    error: couldn't find remote ref refs/heads/main

Architecture

FancyGit CLI โ†’ Git Commands โ†’ Collect Output โ†’ Pattern Matching โ†’ User Interface (CLI)

Current Status

โœ… Completed Features

  • Phase 1: CLI wrapper with intelligent error detection โœ…
  • Phase 2: AI-powered analysis and recommendations โœ…
  • Repository Insights: Statistics and visualization โœ…

๐Ÿšง Future Enhancements

  • Phase 3: Automatic conflict resolution suggestions
  • Enhanced AI model integration
  • Integration with more Git workflows
  • Web-based repository visualization

File Structure

Fancy_Git/
โ”œโ”€โ”€ fancygit.py          # Main CLI application
โ”œโ”€โ”€ launcher.py          # Cross-platform launcher script
โ”œโ”€โ”€ welcome.py           # Welcome message display
โ”œโ”€โ”€ README.md            # This file
โ”œโ”€โ”€ requirements.txt     # Python dependencies
โ”œโ”€โ”€ requirements-dev.txt # Development dependencies
โ”œโ”€โ”€ setup.py            # Package setup configuration
โ”œโ”€โ”€ Makefile            # Build automation
โ”œโ”€โ”€ pytest.ini         # Test configuration
โ”œโ”€โ”€ .gitignore          # Git ignore patterns
โ”œโ”€โ”€ .fancygit_config    # FancyGit configuration file
โ”œโ”€โ”€ VERSION             # Version information
โ”œโ”€โ”€ command-list.txt    # Available commands list
โ”œโ”€โ”€ images/              # Images and documentation
โ”‚   โ””โ”€โ”€ overview.png     # Project overview image
โ”œโ”€โ”€ scripts/             # Utility scripts
โ”‚   โ””โ”€โ”€ send_email_notification.py
โ”œโ”€โ”€ src/                 # Source modules
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ colors.py
โ”‚   โ”œโ”€โ”€ git_error.py
โ”‚   โ”œโ”€โ”€ git_error_parser.py
โ”‚   โ”œโ”€โ”€ git_insights.py
โ”‚   โ”œโ”€โ”€ git_runner.py
โ”‚   โ”œโ”€โ”€ ollama_client.py
โ”‚   โ”œโ”€โ”€ output_colorizer.py
โ”‚   โ””โ”€โ”€ repo_visualizer.py
โ”œโ”€โ”€ tests/               # Test suite
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ conftest.py
โ”‚   โ”œโ”€โ”€ test_conflict_parser.py
โ”‚   โ”œโ”€โ”€ test_conflict_parser_integration.py
โ”‚   โ”œโ”€โ”€ test_git_error.py
โ”‚   โ”œโ”€โ”€ test_git_insights.py
โ”‚   โ”œโ”€โ”€ test_repo_state.py
โ”‚   โ””โ”€โ”€ test_repo_visualizer.py
โ”œโ”€โ”€ htmlcov/            # Test coverage reports
โ”œโ”€โ”€ .github/            # GitHub workflows
โ”‚   โ””โ”€โ”€ workflows/
โ”‚       โ””โ”€โ”€ ci-cd.yml
โ””โ”€โ”€ .git/               # Git repository

Requirements

  • Python 3.6+
  • Git installed and configured
  • System permissions for symlink creation
  • Optional for AI features: Ollama installed and running for AI analysis
  • Dependencies: See requirements.txt for package list

License

Copyright ยฉ 2026 Youssif Ashmawy and Omar Ossama

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

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

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

fancygit-1.0.21.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

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

fancygit-1.0.21-py3-none-any.whl (2.8 MB view details)

Uploaded Python 3

File details

Details for the file fancygit-1.0.21.tar.gz.

File metadata

  • Download URL: fancygit-1.0.21.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for fancygit-1.0.21.tar.gz
Algorithm Hash digest
SHA256 fa40e3931b47da524aa997ac6f0736fb1849555200ba7ea12442eb91b7ee1e76
MD5 6a97182ecfe36073db0c81b80127d3d9
BLAKE2b-256 866bab8438a611b4993a4a9da8c0c914fd585bf4b52005053d5b54c3a6736827

See more details on using hashes here.

File details

Details for the file fancygit-1.0.21-py3-none-any.whl.

File metadata

  • Download URL: fancygit-1.0.21-py3-none-any.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for fancygit-1.0.21-py3-none-any.whl
Algorithm Hash digest
SHA256 46517bdba5e4e642dbb67bf0036155cec9fd887c72d6f12ce5c582ba5be3ea2f
MD5 367c9640a40233ded73e0ac8b63deb45
BLAKE2b-256 4111b15876bd51550a849b2e3d1bd11f397ad46c0992b9b75ddad01d32a98e85

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