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

@j-ho/commit-ai

v0.2.7

Published

Automatically generate commit messages using AI

Downloads

398

Readme

commit-ai

commit-ai is a CLI tool that automatically generates Git commit messages using AI, now with support for custom commit message templates.

example

Key Features

  • Multiple commit message suggestions using AI
  • Customizable message generation options
  • Easy-to-use CLI interface
  • Interactive commit message selection using arrow keys
  • Visual progress indication for commit message generation and commit process
  • Intelligent file filtering to exclude large files and specific file types (e.g., lock files)
  • Improved handling of file paths, including support for relative paths and paths starting with '~'

Installation

You can install it globally using npm:

npm install -g @j-ho/commit-ai

Usage

Before using commit-ai, you need to set up your Anthropic API key:

commit-ai --key YOUR_API_KEY

To generate a commit message, simply run:

commit-ai

Options

  • -k, --key <key>: Set Anthropic API key
  • -m, --max-tokens <number>: Set max tokens for message generation (default: 300)
  • -t, --temperature <number>: Set temperature for message generation (default: 0.7)
  • -n, --number <number>: Number of commit message suggestions to generate (default: 3)
  • --max-file-size <number>: Maximum file size in KB to include in diff (default: 100)

Example:

commit-ai -n 5 -m 400 -t 0.8 --max-file-size 200

How It Works

  1. Analyzes staged changes in the current Git repository, filtering out large files and specific file types
  2. Retrieves the Git commit template if available and requested
  3. Uses AI to generate multiple commit message candidates (with visual progress indication)
  4. Parses and processes the AI-generated commit messages
  5. Displays the list of generated messages
  6. Allows the user to select a message using arrow keys or cancel the commit
  7. Performs the Git commit with the selected message (with visual progress indication)

Development

  1. Clone the repository
  2. Install dependencies: pnpm install
  3. Build the project: pnpm build
  4. Run tests: pnpm test

Dependencies

License

This project is licensed under the MIT License.

Contributing

We welcome all forms of contributions, including bug reports, feature suggestions, and pull requests. For major changes, please open an issue first to discuss what you would like to change.

Troubleshooting

If you encounter any issues with file paths or commit template detection, please ensure that:

  1. Your Git commit template path is correctly set in your Git config
  2. The commit template file exists and is readable
  3. You're using the correct format option (-f template) when you want to use a Git commit template

For any other issues or questions, please open an issue on the GitHub repository.