npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@cherry-min/git-genius

v0.1.0

Published

AI-powered Git CLI assistant

Downloads

95

Readme

Git Genius (gg)

An AI-powered Git CLI assistant that helps developers understand and manage their Git repositories intelligently.

Features

  • 🤖 AI-powered analysis of Git changes and conflicts
  • 📊 Intelligent summaries of branches and commits
  • ⚔️ Conflict resolution guidance
  • 📝 Commit explanations with AI insights
  • 💡 Smart suggestions for next steps
  • 🎨 Beautiful CLI output with colors and tables

Installation

npm install -g git-genius

Or from source:

git clone <repository>
cd git-genius
npm install
npm run build
npm link

Usage

Commands

gg summary

Generate a summary of branch or commit changes.

# Summarize current branch compared to main
gg summary

# Summarize current branch compared to specific branch
gg summary -b develop

# Summarize specific commit
gg summary -c a1b2c3d

gg fix-conflict

Analyze merge conflicts and generate AI-powered fix suggestions with interactive resolution workflow.

gg fix-conflict

When conflicts are detected, the tool will:

  1. Show a list of conflicted files
  2. Analyze each conflict with AI
  3. Provide fix suggestions
  4. Offer interactive options to mark as resolved, get more details, or skip

gg explain-commit <hash>

Explain a specific commit with detailed analysis.

gg explain-commit a1b2c3d

gg suggest

Get AI-powered suggestions for next steps based on your repository state.

gg suggest

The AI analyzes:

  • Current branch and remote state
  • Staged and unstaged changes
  • Recent commit history
  • Merge conflicts
  • And provides actionable recommendations

Configuration

Environment Variables

| Variable | Description | Default | |----------|-------------|---------| | OPENAI_API_KEY | OpenAI API key for AI features | Required | | OPENAI_MODEL | OpenAI model to use | gpt-3.5-turbo | | OPENAI_BASE_URL | Custom OpenAI-compatible API endpoint | Optional |

Example Configuration

# Set your OpenAI API key
export OPENAI_API_KEY=\"your-api-key-here\"

# Optional: Use a different model
export OPENAI_MODEL=\"gpt-4\"

# Optional: Use custom endpoint (e.g., Azure OpenAI)
export OPENAI_BASE_URL=\"https://your-resource.openai.azure.com/\"

Development

Setup

git clone <repository>
cd git-genius
npm install

Build

npm run build

Development Mode

npm run dev -- <command>
# Example:
npm run dev -- summary

Running Tests

npm test

Architecture

src/
├── index.ts              # CLI entry point
├── commands/             # Command implementations
│   ├── summary.ts       # Branch/commit summaries
│   ├── fixConflict.ts   # Conflict resolution
│   ├── explainCommit.ts # Commit explanations
│   └── suggest.ts       # AI suggestions
├── core/                # Core functionality
│   ├── gitUtils.ts      # Git operations wrapper
│   └── aiClient.ts      # AI API client
└── utils/
    └── logger.ts        # CLI output formatting

AI Prompt Design

The tool uses carefully crafted prompts for different scenarios:

  • Change Summaries: Focus on high-level impact and purpose
  • Commit Explanations: Deep dive into technical changes and implications
  • Conflict Resolution: Step-by-step resolution guidance
  • Next Steps: Context-aware workflow suggestions

Prompt templates can be customized in src/core/aiClient.ts.

Examples

Analyzing a Feature Branch

# On your feature branch
gg summary -b main

# See what the AI suggests
gg suggest

# Follow the suggestions, then check again
gg suggest

Resolving Merge Conflicts

# After a merge with conflicts
gg fix-conflict

# Follow the interactive workflow
# For each conflict, AI provides:
# - Analysis of the conflict
# - Suggested resolution
# - Detailed instructions if needed

Understanding Commit History

# Explain recent commits
gg explain-commit HEAD
gg explain-commit HEAD~1
gg explain-commit abc1234

Contributing

  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

MIT License - see LICENSE for details.

Support


Made with ❤️ and AI