aimmit
v1.0.5
Published
Commit messages made easy with AI (ChatGPT)
Downloads
1
Readme
About The Project
Generate the commit message with AI (ChatGPT).
This library uses itself to generate the commit message.
Idea from the original project Nutlope/aicommits. I made this aimmit
project because I want to add more features:
- [x] Use Conventional Commits
- [x] Automatically add all files to the commit
- [x] Automatically push the commit to the remote
- [x] Only print the commit message (for CI/CD)
- [x] ✨ Support emoji
- [x] Free service as an option: use a reverse proxy for free
- [ ] Allow editing the commit message
- [ ] Allow customizing the commit message template
- [ ] ... (feature requests are welcome in the issues)
Installation
Option 1: directly use with npx:
npx aimmit
Option 2: install globally then use:
# install
npm install -g aimmit
# use
aimmit
Set up the AIMMIT_API_KEY [Payment Required]
Before using aimmit
, you need to set up the AIMMIT_API_KEY
(i.e. OpenAI API key) environment variable.
AIMMIT_API_KEY=... aimmit
Or you can set it in the .bashrc
or .zshrc
file:
export AIMMIT_API_KEY=...
Or you can specify the API key with the -k
option:
aimmit -k ...
You can get the API key from OpenAI.
Note that this is a paid service by OpenAI.
Alternative: Use a Reverse Proxy [Free Depending on the Provider]
Instead of using the official OpenAI paid service, there are some free reverse proxy services available but may have some limitations and of less stability.
You can use the -r
option to specify the reverse proxy URL:
aimmit -r https://proxy/api
Or you can use the environment variable AIMMIT_REVERSE_PROXY_URL
:
export AIMMIT_REVERSE_PROXY_URL=...
Please note that a reverse proxy service may have security issues. You should use it at your own risk.
A free reverse proxy service is provided by default in this project by me. I promise that it will NOT collect any of your data. However, it may go down at any time.
Options
Options:
--help Show help [boolean]
--version Show version number [boolean]
-c, --conventional-commits Use Conventional Commits[boolean] [default: false]
-e, --emoji Use emoji in commit message
[boolean] [default: false]
-l, --lite Only print the commit message
[boolean] [default: false]
-a, --auto-add-all Automatically add all files to the commit
[boolean] [default: false]
-p, --auto-push Automatically push the commit to the remote
[boolean] [default: false]
-r, --reverse-proxy-url Reverse proxy URL [string]
-k, --key API key [string]
-v, --verbose Run with verbose logging[boolean] [default: false]
Examples
Generate with Conventional Commits:
aimmit -c
Automatically add all files to the commit, then generate with Conventional Commits, then automatically push the commit to the remote:
aimmit -a -c -p
Only print the commit message:
aimmit -l
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.