Tired of writing commit messages? Let the computer do it for you!
It's shit, but better than "WIP"!
npm install -g git-aicommit
This cli tool uses standard rc files:
- local
.git-aicommitrc
$HOME/.git-aicommitrc
$HOME/.git-aicommit/config
$HOME/.config/git-aicommit
$HOME/.config/git-aicommit/config
/etc/git-aicommitrc
/etc/git-aicommit/config
Or default config is used if no config file is found.
To override default config, create a config file and export an object with the following properties:
touch $HOME/.git-aicommitrc
// $HOME/.git-aicommitrc
module.exports = {
openAiKey: process.env.OPENAI_API_KEY,
addAllChangesBeforeCommit: true,
autocommit: true,
openCommitTextEditor: false,
promptBeforeDiff: 'Read the following git diff for a multiple files:',
promptAfterDiff: 'Generate 1 to 3 paragraphs to explain this diff to a human without mentioning changes themselves:',
excludeFromDiff: [
'*.lock'
],
diffFilter: 'ACMRTUXB',
completionPromptParams: {
model: "text-davinci-002",
max_tokens: 500,
temperature: 0.2,
top_p: 1,
presence_penalty: 0,
frequency_penalty: 0,
best_of: 1,
n: 1,
stream: false,
stop: ["\n\n\n"],
}
}
git-aicommit --openAiKey="sk-..." --completionPromptParams.temperature=0.3 --no-autocommit
export OPENAI_API_KEY=sk-YOUR_API_KEY
git-aicommit
Or make an alias:
alias gai='git-aicommit'
## And run it:
gai
It that simple!