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
, orgpt-4
- e.g.
- 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.2.tar.gz
(9.0 kB
view hashes)
Built Distribution
Close
Hashes for magic_commit-0.5.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 265981b7243737151fde9727c892c7207ed54ae6127e9cd0b88c819b330f9dd2 |
|
MD5 | b0511867d4383f0ddfc03d483e553b16 |
|
BLAKE2b-256 | e2f98e38939bbdd290517f4d8dd575bd961b849949b1438eb799588b083ceeea |