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

pr-cli-generator

v1.5.1

Published

A simple CLI tool to generate a Git Pull Request (PR) description by analyzing your local Git commit history.

Readme

PR-CLI

A simple and powerful Command Line Interface (CLI) tool designed to streamline the process of generating Git Pull Request (PR) descriptions. By analyzing your local Git commit history and leveraging AI, PR-CLI helps you create clear, concise, and comprehensive PR descriptions, optionally using predefined templates and supporting multiple languages.

Architecture

PR-CLI operates by first analyzing your local Git commit history to extract relevant information. It then leverages an AI model (Google Gemini) to process this information, optionally integrating with predefined PR templates. The tool intelligently fills in template sections and refines the PR description based on your commit messages and chosen language, ultimately providing a structured and comprehensive output.

Features

  • Automated PR Description Generation: Analyzes your Git commit history to automatically generate a structured PR description.
  • Conventional Commit Support: Categorizes commit messages based on conventional commit prefixes (feat, fix, chore, docs, etc.) into organized sections.
  • PR Template Integration: Automatically detects and allows you to select from .github/PULL_REQUEST_TEMPLATE markdown files to structure your PR description.
  • AI-Enhanced Content Generation: Utilizes Google Gemini to intelligently fill in template sections and refine the PR description based on your commit messages.
  • Multi-language Support: Allows you to specify the language of your PR template, enabling the AI to generate descriptions in the chosen language.
  • Clipboard Integration: Automatically copies the generated PR description to your clipboard for easy pasting.

Installation

You can install pr-cli-generator via npm:

npm install -g pr-cli-generator

Usage

After installation, you can use the pr-cli command in your Git repository:

pr-cli

Options

  • -c, --copy: Automatically copy the generated PR description to the clipboard.

    pr-cli --copy
  • -d, --description <text>: Provide a manual description to enhance the generated PR description.

    pr-cli --description "This PR adds a new feature for user authentication."
  • --github (or -g): Opens a GitHub PR page in your browser with the PR title and description pre-filled in the URL. The full PR description is also copied to your clipboard, and you'll be instructed to paste it into the description field on the GitHub page.

    pr-cli --github
  • --gh: Creates a GitHub PR directly using the GitHub CLI. This option also includes branch management features (prompting to create/publish a new branch if on main/master or if the branch is not published).

    pr-cli --gh
  • --self: Assign the PR to yourself.

    pr-cli --gh --self
  • --draft: Create the PR as a draft.

    pr-cli --gh --draft

Setup Google Gemini API Key

Obtain a GEMINI_API_KEY from Google AI Studio. Set it as an environment variable:

# For Linux/macOS
export GEMINI_API_KEY="YOUR_GEMINI_API_KEY"

# For Windows (Command Prompt)
set GEMINI_API_KEY="YOUR_GEMINI_API_KEY"

# For Windows (PowerShell)
$env:GEMINI_API_KEY="YOUR_GEMINI_API_KEY"

Alternatively, you can create a .env file in the project root with GEMINI_API_KEY=YOUR_GEMINI_API_KEY.

Workflow

  1. Commit your changes: Ensure your commit messages follow a consistent convention (e.g., Conventional Commits).
  2. Run PR-CLI: Execute node index.js in your repository.
  3. Handle No Local Commits: If no local commits are found, you will be prompted to specify how many remote commits to read for history.
  4. Select a template (if available): If you have PR templates in .github/PULL_REQUEST_TEMPLATE/ or .github/, you will be prompted to choose one.
  5. Select template language (if a template is chosen): You will be prompted to select the language of your chosen PR template.
  6. Branch Management (for --gh option): If using the --gh option and on main/master or an unpublished branch, you will be prompted to create and/or publish a new branch.
  7. Review and copy / Create PR:
    • If using --github, the generated PR description will be displayed, and the GitHub PR URL and full description will be copied to your clipboard.
    • If using --gh, the PR will be created directly via GitHub CLI.

PR Template Example

You can create PR templates in markdown files within .github/PULL_REQUEST_TEMPLATE/ or directly in .github/.

Example: .github/PULL_REQUEST_TEMPLATE/standard.md

## Description

<!-- Briefly describe the changes introduced by this PR. -->

## Related Issues

<!-- Link any related issues (e.g., #123, #BUG-456). -->

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules

Contributing

Contributions are welcome! Please feel free to open issues or submit pull requests.

License

This project is licensed under the ISC License.