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 🙏

© 2024 – Pkg Stats / Ryan Hefner

slick-commit

v1.3.0

Published

Way better commit messages, automatically.

Downloads

10

Readme

image

Slick Commit

Slick Commit is a tool that leverages OpenAI's GPT-4 to automatically generate high-quality commit messages based on staged changes in your Git repository. It uses AI to analyze the git diff and creates concise, readable, and technically sound commit messages—far better than most humans can craft on the spot.

Features

  • Automatic Commit Message Generation: Slick Commit uses the OpenAI API to generate commit messages based on staged changes in the repository.
  • File-Specific Summaries: Summarizes each changed file with a focus on important changes.
  • Commit Message Formatting: Ensures consistent formatting for commit messages, following conventional commits structure (e.g., feat, fix, docs, etc.).
  • Large Diff Handling: Handles large or complex diffs, skipping irrelevant files like package-lock.json.
  • Parallel File Summaries: Processes file changes concurrently, optimizing for speed and performance.
  • Commit Statistics: Includes statistics such as the number of files changed and the size of the changes in the commit message.

Installation

To install Slick Commit, follow these steps:

  1. Clone this repository:

    git clone https://github.com/your-username/slick-commit.git
  2. Navigate to the project directory:

    cd slick-commit
  3. Install the required dependencies:

    npm install
  4. Set up your OpenAI API key by adding it to your environment variables:

    export OPENAI_API_KEY=your-api-key-here

Usage

After making your changes and staging them in Git, use the following command to automatically generate and commit your changes with an AI-generated message:

npm run slick-commit

This will:

  1. Add all your staged changes.
  2. Analyze the git diff of your staged changes.
  3. Generate a commit message using OpenAI.
  4. Commit the changes with the AI-generated message.

Example Commit Message

feat(authentication): enhance auth token verification

- feat(token): improved validation logic for token length in auth.service.ts
  - File: src/auth/auth.service.ts
  - Changes: Added better token validation and expiration checks
- fix(auth): resolved an issue where invalid tokens were being accepted in some cases
  - File: src/auth/auth.guard.ts
  - Changes: Improved error handling and logging

This update enhances token validation to prevent security loopholes. No breaking changes detected.

Configuration

  • Git: Make sure you have a valid Git configuration and repository.
  • OpenAI API: You need to set the OPENAI_API_KEY environment variable to use this tool.

Development

Running Locally

To run this project locally:

  1. Clone the repo and install dependencies:

    git clone https://github.com/your-username/slick-commit.git
    cd slick-commit
    npm install
  2. Make sure your OpenAI API key is available in your environment variables.

  3. Run the tool:

    npm run slick-commit

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

License

This project is licensed under the ISC License.


Future Plans

  • Support for more file types and custom diff summarization.
  • Improved handling for extremely large files.
  • Better commit message customizations and rules.