Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ai-commit-js

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ai-commit-js

AI generated commit messages

  • 1.3.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

AiCommit

AiCommit is a command line tool that generates commit messages using ChatGPT. It takes a diff of staged changes as input and uses the OpenAI API to generate a short, meaningful commit message that summarizes the changes.

Installation

To install AiCommit, run the following command:

npm install -g ai-commit-js

This will install the ai-commit command globally on your system.

Usage

To use AiCommit, navigate to a Git repository with staged changes and run the following command:

ai-commit

This will prompt you to enter your OpenAI API key, which will be stored in a file named .ai-commit in your home directory. If you don't have an API key, you can sign up for one at the OpenAI website.

Once you've entered your API key, AiCommit will generate a commit message based on the diff of the currently staged changes using OpenAI, and open the commit message in vim for you to edit. Close and save and a you will be prompted to confirm the commit. If you want to print the generated commit message without committing the changes, use the --dry-run option:

ai-commit --dry-run

This will print the generated commit message to the console without committing the changes.

Note

There is a max token limit to your diff determined by your OpenAI account. Large diffs may be too large for your account's limit. If you encounter any issues, consider breaking up your changes into smaller commits or upgrading your OpenAI account.

Contributing

If you find a bug or want to suggest a feature, feel free to open an issue or submit a pull request on the GitHub repository.

FAQs

Package last updated on 03 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc