ziopencommit v1.0.4
Setup
Install Zi OpenCommit globally to use in any repository:
npm install -g ziopencommitGet your API key from OpenAI. Make sure you add payment details, so API works.
Set the key to Zi OpenCommit config:
ziopencommit config set OPENAI_API_KEY=<your_api_key>Set GPT model to change gpt-3.5-turbo as default:
zc config set model=gpt-4Your api key is stored locally in
~/.ziopencommitconfig file.
Usage
You can call Zi OpenCommit directly to generate a commit message for your staged changes:
git add <files...>
ziopencommitYou can also use the oc shortcut:
git add <files...>
zcFeatures
Preface commits with emoji ðŸ¤
GitMoji convention is used.
To add emoji:
zc config set emoji=trueTo remove emoji:
zc config set emoji=falsePostface commits with descriptions of changes
To add descriptions:
zc config set description=trueTo remove description:
zc config set description=falseInternationalization support
To specify the language used to generate commit messages:
# de, German ,Deutsch
zc config set language=de
zc config set language=German
zc config set language=Deutsch
# fr, French, française
zc config set language=fr
zc config set language=French
zc config set language=françaiseThe default language set is English
All available languages are currently listed in the i18n folder
Git flags
The ziopencommit or zc commands can be used in place of the git commit -m "${generatedMessage}" command. This means that any regular flags that are used with the git commit command will also be applied when using ziopencommit or zc.
zc --no-verifyis translated to :
git commit -m "${generatedMessage}" --no-verifyIgnore files
You can ignore files from submission to OpenAI by creating a .ziopencommitignore file. For example:
path/to/large-asset.zip
**/*.jpgThis is useful for preventing ziopencommit from uploading artifacts and large files.
By default, ziopencommit ignores files matching: *-lock.* and *.lock
Git hook
You can set ZiOpenCommit as Git prepare-commit-msg hook. Hook integrates with you IDE Source Control and allows you edit the message before commit.
To set the hook:
zc hook setTo unset the hook:
zc hook unsetTo use the hook:
git add <files...>
git commitOr follow the process of your IDE Source Control feature, when it calls git commit command — Zi OpenCommit will integrate into the flow.