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
On Mac:
brew 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 # 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.4.0.tar.gz
(6.6 kB
view hashes)
Built Distribution
Close
Hashes for magic_commit-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78b8148da04e974a3bc49188ae9cc28ad68058f95480c72f788c2359622ba9fb |
|
MD5 | edf5c1ce6f5abb35c7c435a448fe0f04 |
|
BLAKE2b-256 | f9591e24b20875c584201f2271c768f7fd8124314906137f098bd012d7be2dbd |