Catalog PyPI
Back to packageRELEASE DETAILS

1.0.1

PyPI

ai-commits

An AI-powered git commit message generator!

Published16 Feb 2023
Direct dependencies3
Transitive dependenciesNot calculated

README

Version 1.0.1 documentation
AI Commits

An AI-powered git commit message generator written in python. Inspired by @Nutlope

Pypi PyPI - Python Downloads MIT licensed

Description

AICommits is a Python script that generates a git commit message using OpenAI's GPT-3 language model. The script takes the git diff of the staged changes and generates a commit message using GPT-3.

The generated commit message is presented to the user who has the option to accept or reject it. If the user accepts the commit message, the script commits the changes using the generated message.

The script requires an OpenAI API key, which can be obtained from the OpenAI website.

ezgif com-video-to-gif

Dependencies

Python 3.6 or higher
openai 0.10.2
inquirer 3.7.0
python-dotenv 0.19.1

Features

In this version, AICommit provides the following features:

  • Automatic generation of commit messages based on the diff of staged changes.

  • Support for conventional commit messages.

  • Language selection for generated commit messages.

  • User selection of generated commit messages.

  • Support for specifying diff per file.

Installation and Usage

To use AICommits, do the following:

  1. Export your OpenAI API key as an environment variable by running:
export OPENAI_API_KEY=YOUR_API_KEY
  1. install aicommit from pypi by running:
pip install ai_commits

Then, run the script using the command aicommit.

This will prompt AICOMMIT to generate up to 5 commit messages based on the diff of staged changes. The user can then select one of the generated commit messages to use as the commit message for their changes.

If the --diff-per-file flag is included, AICOMMIT will generate separate commit messages for each file.

If the --conventional flag is included, AICOMMIT will generate commit messages in conventional commit format.

If the --language flag is included, AICOMMIT will generate commit messages in the specified language.

Install from Source

To install AICommits from source, follow these steps:

  1. Clone the repository using the command git clone https://github.com/nneji123/aicommit.git.

  2. Navigate to the project directory using the command cd aicommit.

  3. Install the required dependencies by running pip install -r requirements.txt.

  4. Set your OpenAI API key as an environment variable by running export OPENAI_API_KEY=YOUR_API_KEY.

  5. Run the script using the command python "src/ai_commits.py".

The script will prompt you to confirm the generated commit message. If you accept the message, the changes will be committed using the generated message.

Changelog

v1.0.0 (2023-02-16)

  • Added support for generating commit messages in multiple languages

  • Improved performance when generating commit messages for large diffs

  • Added ability to select from multiple generated commit messages using the inquirer library

  • Fixed various bugs and improved error handling

v0.0.5 (2023-02-15)

  • Fixed a bug that caused the script to fail when no changes were staged

v0.0.4 [Initial Release] (2023-02-15)

  • Initial release of aicommits
  • Supports generating conventional commit messages
  • Supports generating commit messages based on the changes in the staged files
  • Uses OpenAI's GPT-3 to generate commit messages

Contributing

Open an issue or submit a pull request if you want to contribute to the project.

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 3

Native requirements
3 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
inquirer
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
inquirer (>=3.1.2)runtime
openai
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
openai (>=0.26.1)runtime
python-dotenv
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
python-dotenv (>=0.21.1)runtime

Distribution files

2 collected
ai_commits-1.0.1-py3-none-any.whl

bdist_wheel · 3.91 KB · Python py3

Source file
ai_commits-1.0.1.tar.gz

sdist · 4.17 KB · Python source

Source file

Repository

PENDING
nneji123/aicommit

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 10:14 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:7a02752cc003fb83ccd375b5e79bdde6636b3b455dcccfaed960498d790b70aa

Other collected versions

View all collected versions →