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.1.tar.gz
(9.0 kB
view hashes)
Built Distribution
Close
Hashes for magic_commit-0.5.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a2d226c777f0f9d44672a0d5719e8229acff5f83f5a9250ea05a3d127207eb8 |
|
MD5 | 932c7237d4fc7b00429d1089071a584e |
|
BLAKE2b-256 | 2f5eb4e69b189c99dee6a59b39990a651f2109e59bc24d2a6e33a4b434c91417 |