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.14.tar.gz (55.7 kB 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.14-py3-none-any.whl (54.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fancygit-1.0.14.tar.gz
Algorithm Hash digest
SHA256 7106be5410ca40a585e1e1b9b05724539e8f3fa39e2f9ba9fc5c124cec2b882c
MD5 0005b5205b776b7aba4a61e20042b99e
BLAKE2b-256 8ec708c34387e3c5dcf274ce28c4b464690cf6370c4e90ef1b244b25ef296f47

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fancygit-1.0.14-py3-none-any.whl
  • Upload date:
  • Size: 54.9 kB
  • 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.14-py3-none-any.whl
Algorithm Hash digest
SHA256 bee4cf5110b9e89ccfe9cded99a37da04edec006d8b0316e3e5d78bef790b765
MD5 3e85b93aeec91b8d5c901df28d5c8a83
BLAKE2b-256 18de7b247b3f788f49de5c0ff60c1f6709c79ac176f6176d71637a30c0da9804

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