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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ai-pr-generator

v1.0.1

Published

Generate beautiful, structured pull request descriptions using AI

Readme

🧠 AI Pull Request Generator

Generate beautiful, structured pull request descriptions using AI (GPT or Gemini), straight from your terminal.

This tool analyzes your Git diff, prompts for the PR type, title, and optional ticket ID, and generates a complete, professional-looking PR description.

✨ Features

  • 🤖 Multiple AI Providers: GPT and Gemini with automatic fallback
  • 🎯 Smart Context: Analyzes your Git diff automatically
  • 🎨 Beautiful Output: Markdown format with emojis and structure
  • 💻 Interactive UI: Colored terminal output with arrow key navigation
  • 📋 Copy to Clipboard: One-click copy to clipboard
  • 🚀 One-liner Usage: Quick commands like genpr feat "Add feature"
  • 🔗 Automatic PR Creation: Create PRs directly in Bitbucket/GitHub (with API credentials)

🚀 Quick Start

1. Install

npm install -g ai-pr-generator

2. Initialize

Set up your API keys and AI models:

genpr init

This will guide you through setting up:

  • OpenAI API key (GPT)
  • Gemini API key
  • AI model selection (GPT-4o, Gemini 2.0, etc.)
  • Default AI provider preference
  • Optional Bitbucket/GitHub credentials for automatic PR creation

3. Use

# Interactive mode
genpr

# One-liner mode
genpr feat "Add new feature"
genpr fix "Fix bug in login"
genpr docs "Update README"

🔐 API Keys Setup

You'll need at least one AI provider:

OpenAI

  1. Visit OpenAI API Keys
  2. Sign in and create a new secret key
  3. Copy your API key

Gemini

  1. Visit Google AI Studio
  2. Sign in with your Google account
  3. Create an API key
  4. Copy your API key

⚙️ Configuration Management

Available AI Models

The tool supports multiple AI models from OpenAI and Google Gemini:

OpenAI Models

  • GPT-4o Mini (gpt-4o-mini) - Fast and cost-effective for most use cases
  • GPT-4o (gpt-4o) - Best quality for complex tasks
  • GPT-4 Turbo (gpt-4-turbo) - Balanced performance and quality
  • Custom Models - Use any OpenAI-compatible model

Gemini Models

  • Gemini 2.0 Flash (gemini-2.0-flash) - Fast and efficient
  • Gemini 2.0 Pro (gemini-2.0-pro) - Best quality for complex tasks
  • Gemini 1.5 Pro (gemini-1.5-pro) - Balanced performance and quality
  • Custom Models - Use any Gemini-compatible model

Initial Setup

During genpr init, you can configure:

  • AI Models: Choose from:
    • OpenAI: GPT-4o Mini (Fast & Cheap), GPT-4o (Best Quality), GPT-4 Turbo (Balanced), or custom models
    • Gemini: Gemini 2.0 Flash (Fast), Gemini 2.0 Pro (Best Quality), Gemini 1.5 Pro (Balanced), or custom models
  • Default Provider: Set your preferred AI provider (OpenAI or Gemini)
  • Auto-select: Let the tool automatically choose the best available provider

Configuration Management

Use genpr config to:

  • View current configuration
  • Edit API keys, models, and preferences
  • Reset all configuration and start fresh

🎯 Usage Examples

Basic Usage

# Interactive mode - guided prompts
genpr

# One-liner with PR type and title
genpr feat "Add search functionality"
genpr bugfix "Fix responsive layout"
genpr refactor "Extract authentication logic"

Choose AI Provider

# Force specific provider
genpr --provider GPT feat "Add feature"
genpr --provider Gemini bugfix "Fix bug"

Manage Configuration

# View current configuration
genpr config

# Edit configuration
genpr config --action edit

# Reset configuration
genpr config --action reset

Output Options

After generating, you can:

  • Copy to clipboard - Copy the description
  • Open in editor - Open in your default editor
  • Create PR in Bitbucket - Automatically create PR (if configured)
  • Create PR in GitHub - Automatically create PR (if configured)

📋 Example Output

# 🔖 feat(RND-1234): Add search bar to homepage

## 🧠 Summary

This PR introduces a responsive search bar with autosuggest capabilities on the homepage, improving user navigation and search experience.

## ✅ Changes

- Added new `SearchBar` component with TypeScript support
- Integrated with backend autocomplete API endpoint
- Updated homepage layout to accommodate search functionality
- Added keyboard navigation support for accessibility
- Implemented debounced search to optimize performance

🔗 Optional: Automatic PR Creation

For automatic PR creation in Bitbucket or GitHub:

Bitbucket Setup

  1. Visit Bitbucket App Passwords
  2. Create a new app password with 'Pull requests: Write' permission
  3. Add your email and app password during genpr init

GitHub Setup

  1. Visit GitHub Personal Access Tokens
  2. Generate new token with 'repo' scope
  3. Add your token during genpr init

👥 Reviewers Configuration

To automatically assign reviewers:

  1. Copy reviewers.json.example to reviewers.json
  2. Update with your team's reviewers:
{
  "bitbucket": [
    {
      "name": "John Doe",
      "username": "johndoe"
    }
  ],
  "github": [
    {
      "name": "Jane Smith",
      "username": "janesmith"
    }
  ],
  "default": [
    {
      "name": "Default Reviewer",
      "username": "default"
    }
  ]
}

🛠️ Development

Prerequisites

  • Node.js 20+ (for development)
  • Git repository with changes

Local Development

# Clone and install
git clone https://github.com/yairpi165/ai-pr-generator.git
cd ai-pr-generator
npm install

# Build
npm run build

# Run locally
npm start

# Development mode
npm run dev

Available Scripts

npm run build          # Build TypeScript
npm test               # Run tests
npm run lint           # Check linting
npm run lint:fix       # Fix linting issues
npm run format         # Format code
npm run check          # Run all checks

🐛 Troubleshooting

Common Issues

"genpr command not found"

  • Restart your terminal after installation
  • Or run: source ~/.zshrc (or your shell config)

"No AI providers available"

  • Run genpr init to set up your API keys
  • Make sure your API keys are valid

"Provider X failed"

  • The tool will automatically try other providers
  • Check your API key and usage limits

"Permission denied"

  • Make sure you have Node.js 18+ installed
  • Check file permissions

Check Provider Status

# See active provider in output
genpr

# Force specific provider
genpr --provider GPT
genpr --provider Gemini

📦 Installation Details

Global Installation

npm install -g ai-pr-generator

The package will:

  • ✅ Install globally with genpr command available
  • ✅ Run postinstall script to build TypeScript
  • ✅ Be ready to use immediately

Local Installation (Development)

git clone https://github.com/yairpi165/ai-pr-generator.git
cd ai-pr-generator
npm install
npm run build

🤝 Contributing

We welcome contributions!

  1. Fork the repository
  2. Create a feature branch (feat/, fix/, docs/)
  3. Make your changes
  4. Test: npm test and npm run lint
  5. Build and test: npm run build && npm start
  6. Open a pull request

📄 License

MIT © 2025 Yair Pinchasi

🔗 Links