Skip to content

Instantly share code, notes, and snippets.

@mahdi-malv
Created December 15, 2023 01:52
Show Gist options
  • Save mahdi-malv/0054ac6d06a56f6f249a52d1a0140e3f to your computer and use it in GitHub Desktop.
Save mahdi-malv/0054ac6d06a56f6f249a52d1a0140e3f to your computer and use it in GitHub Desktop.
Git commit generator using GPT3.5 (GptCLI)
# Add it in ~/.local/gpt-cli/gitcommit
# Use "gptcli gitcommit" to generate a commit message
name: gitcommit
description: "ai commit plugin for gpt cli"
repository: "mahdi-malv"
author: "mahdi-malv"
help: |
Creates commit based on git diff and created to do better than GitKraken
Usage:
❯ gpt gitcommit
env:
LOCALE: "en"
style: "cz"
EXCLUDE: |
':(exclude)package-lock.json' ':(exclude)pnpm-lock.yaml' ':(exclude)*.lock' ':(exclude)go.sum'
steps:
- name: "ask ai to output commit messagecreateChatCompletion"
uses: "gpt:createChatCompletion"
with:
messages:
- role: "user"
content: |
Here are the git diff files: $(git diff -U0)
Commit Messages must have a short description that is less than 50 characters followed by a newline and a more detailed description.
- Write concisely using an informal tone. Keep the commit short and straight forward. No extra explanation
- List significant changes
- Do not use specific names or files from the code
- Do not use phrases like "this commit", "this change", etc.
- format will be [feat/fix/chore/doc/test](scope/task-code/module): Commit-message
example: feat(OK-1234): Implement module for EV charging
export:
answer: ANSWER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment