Skip to main content

Generate commit messages with OpenAI\’s GPT.

Project description

Magic Commit! ✨

magic-commit is a command-line tool for writing your commit messages. It pings OpenAI's GPT-3 API to generate commit messages based on your commit history.

Installation

All platforms via PyPI

pip install magic-commit

Setup

You'll need to set up an OpenAI account and get an API key. You can do that on OpenAI's website.

Once you have a key, add it to magic-commit like so:

magic-commit -k <your-key-here>

Usage

Running magic-commit is straightforward:

magic-commit # will run in your current directory
>>> [your commit message] # automatically copied to your clipboard

To specify a directory:

magic-commit -d <path-to-git-repo>

For help:

magic-commit -h # or --help

Specifying a model

To change the model for this run:

magic-commit -m <model-name> 

To change the model globally:

magic-commit --set_model <model-name>

For models, note that:

  • You need to specify an OpenAI GPT model.
    • e.g. gpt-3.5-turbo-0301, or gpt-4
  • Your account needs to have access to the model you specify.

Contributing

Feel free to open an issue or submit a pull request.

To publish a new version to PyPI:

pip install twine wheel # if you don't have it already
python setup.py sdist bdist_wheel # build the package
twine upload dist/* # upload to PyPI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

magic-commit-0.5.0.tar.gz (8.9 kB view hashes)

Uploaded Source

Built Distribution

magic_commit-0.5.0-py3-none-any.whl (10.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page