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

@jenssegers/auto-commit

v1.0.1

Published

A CLI tool to automatically generate commit messages using ChatGPT

Downloads

42

Readme

auto-commit

Auto-commit is an intelligent CLI tool that leverages ChatGPT to suggest git commit messages based on your staged changes. It supports both gitmoji and conventional commit styles, making it easier to maintain consistent and meaningful commit histories.

➜  g ac
? Select your commit message: (Use arrow keys)
❯ docs: Update README to rename auto-commit CLI and add git integration instructions
  docs: Revise README for auto-commit with git alias and gitconfig setup
  docs: Enhance README with integration details for git alias
  docs!: Major update to README: renamed tool and added crucial integration steps

Features

  • Generates 4 commit message suggestions based on your staged git diff
  • Supports both gitmoji and conventional commit styles
  • Excludes specified files from the diff analysis
  • Interactive selection of the preferred commit message
  • Easy integration with your existing git workflow

Installation

Prerequisites

  • Node.js (v14 or later)
  • npm or yarn

Global Installation

To install auto-commit globally, run:

npm install -g auto-commit

or if you prefer yarn:

yarn global add auto-commit

Adding to PATH

After installing globally, you need to ensure that the npm or yarn global bin directory is in your PATH environment variable.

For npm:

export PATH="$PATH:$(npm config get prefix)/bin"

For yarn:

export PATH="$PATH:$(yarn global bin)"

To make this change permanent, add the appropriate line to your shell configuration file (e.g., ~/.bashrc, ~/.zshrc, or ~/.profile).

Configuration

Auto-commit requires an OpenAI API key to function. Set your API key as an environment variable:

export OPENAI_API_KEY=your_api_key_here

Git Alias

You can integrate auto-commit more seamlessly with your git workflow by setting up a git alias or adding it to your gitconfig.

To create a git alias for auto-commit, run the following command:

git config --global alias.ac '!auto-commit'

Now you can use git ac instead of auto-commit in your git repositories.

Adding to gitconfig

Alternatively, you can add auto-commit to your global gitconfig file. Open your ~/.gitconfig file (or create it if it doesn't exist) and add the following lines:

[alias]
    ac = !auto-commit

This will achieve the same result as setting up the git alias.

Usage

After installation, you can use the auto-commit command in your terminal:

auto-commit [options] [path]

Options

  • -e, --exclude <files>: Files to exclude from the diff (default: "package-lock.json,yarn.lock")
  • -s, --style <style>: Choose between "gitmoji" or "conventional" commit styles (default: "conventional")
  • -h, --help: Display help information

Examples

  1. Generate commit messages for the current directory using conventional style:

    auto-commit
  2. Generate gitmoji-style commit messages for a specific path:

    auto-commit -s gitmoji /path/to/your/repo
  3. Exclude specific files from the diff analysis:

    auto-commit -e "file1.js,file2.js"

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the ISC License.