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

genai-pr

v0.3.0

Published

AI-powered PR description generator using Claude Code or Cursor CLI

Downloads

716

Readme

genai-pr

AI-powered PR description generator using Claude Code or Cursor CLI.

npm version License: MIT GitHub

Features

  • AI-powered PR descriptions - Generate PR title and body using Claude Code or Cursor CLI
  • Template-based - Built-in templates (feature, bugfix) + custom project templates
  • Existing PR support - Regenerate descriptions for existing PRs via --url
  • Multi-language support - Generate titles and body in English or Korean
  • Interactive workflow - Review, provide feedback, edit in editor, and refine before creating
  • GitHub CLI integration - Creates PRs directly via gh pr create

How It Works

flowchart TD
    A[Start: genai-pr] --> B{PR URL provided?}
    B -->|Yes| C[Fetch PR info via gh CLI]
    B -->|No| D[Collect local Git data]
    C --> E[Get commits, diff, changed files]
    D --> F[git diff base..head + git log]
    E --> G[Select Template]
    F --> G
    G --> H[Build AI Prompt]
    H --> I{Select Provider}
    I -->|Claude Code| J[Claude Code CLI]
    I -->|Cursor CLI| K[Cursor CLI]
    J --> L[Parse JSON Response]
    K --> M[Parse Delimiter Response]
    L --> N[Display PR Preview]
    M --> N
    N --> O{User Action}
    O -->|y| P[Create/Update PR via gh]
    O -->|n| Q[Cancel]
    O -->|f| R[Get Feedback]
    O -->|e| S[Edit in $EDITOR]
    R --> H
    S --> N
    P --> T[Done]

Prerequisites

You need at least one of these AI CLI tools installed:

Additionally, the GitHub CLI (gh) must be installed and authenticated.

Installation

# Global installation
npm install -g genai-pr

# Or use directly with npx (no installation required)
npx genai-pr claude-code

Usage

Generate PR Description

# Using Claude Code (interactive template selection)
genai-pr claude-code

# Using Cursor CLI
genai-pr cursor-cli

# One-liner with options
genai-pr claude-code -t feature -b main

# Specify head and base branches
genai-pr claude-code --branch feature/AUTH-123 --base develop

# Create as draft PR
genai-pr claude-code --draft

# Preview without creating PR
genai-pr claude-code --dry-run

# With specific model
genai-pr claude-code --model sonnet
genai-pr cursor-cli --model claude-4.5-sonnet

Regenerate Existing PR Description

# Update an existing PR's title and body
genai-pr claude-code --url https://github.com/owner/repo/pull/15

Authentication

# Login to Cursor Agent
genai-pr login cursor-cli

# Setup Claude token
genai-pr login claude-code

# Check status
genai-pr status claude-code
genai-pr status cursor-cli

List Supported Models

genai-pr models claude-code
genai-pr models cursor-cli

List Available Templates

# List built-in and project templates
genai-pr templates

# Include custom template directory
genai-pr templates --template-dir ./my-templates

Interactive Options

After generating the PR description, you'll see an interactive menu:

| Option | Description | |--------|-------------| | [y] | Create PR (or Update PR when using --url) | | [n] | Cancel | | [f] | Provide feedback to regenerate | | [e] | Edit in external editor ($EDITOR) |

Options

| Option | Description | Default | |--------|-------------|---------| | -t, --template <name> | PR template to use | interactive selection | | -b, --base <branch> | Base/target branch | main | | --branch <branch> | Head/source branch | current branch | | -m, --model <model> | Model to use | provider default | | --lang <lang> | Set both title and body language (en|ko) | - | | --title-lang <lang> | Language for PR title | en | | --body-lang <lang> | Language for PR body | ko | | --template-dir <path> | Custom template directory | - | | --draft | Create as draft PR | false | | --dry-run | Preview without creating PR | false | | --url <url> | Existing PR URL to regenerate | - |

Built-in Templates

feature

## Summary
## Changes
## Test Plan

bugfix

## Summary
## Root Cause
## Fix
## Test Plan

Custom Templates

Templates are loaded with the following priority:

  1. --template-dir <path> - Custom directory (highest priority)
  2. .github/PR_TEMPLATE/ - Project-level templates
  3. Built-in templates (feature, bugfix)

Create a .md file in any of these locations. The filename (without extension) becomes the template name.

Configuration

| Setting | Default | Description | |---------|---------|-------------| | maxInputSize | 50000 | Maximum AI input size in bytes | | maxDiffSize | 30000 | Maximum diff size in bytes | | timeout | 120000 | AI request timeout in ms |

Requirements

  • Node.js >= 18.0.0
  • Git repository
  • GitHub CLI (gh) installed and authenticated
  • Claude Code CLI or Cursor CLI installed and authenticated

License

MIT