appleboy / CodeGPT

A CLI written in Go language that writes git commit messages or do a code review brief for you using ChatGPT AI (gpt-4o, gpt-4-turbo, gpt-3.5-turbo model) and automatically installs a git prepare-commit-msg hook.
MIT License
1.27k stars 110 forks source link

Feature request: Make prompt templates customizable #142

Open doggy8088 opened 11 months ago

doggy8088 commented 11 months ago

I'd like to suggestion providing a way to customize the prompt template when user needed.

Here is the proposal:


Provide two ways to customize the prompt templates:

  1. Check if the folder exists: $HOME/.config/codegpt/prompt_templates

    If the folder exists, read the templates from the folder automatically.

  2. Set codegpt.prompt_template_path config

    codegpt config set codegpt.prompt_templates_path "$HOME/.config/codegpt/prompt_templates"
appleboy commented 11 months ago

Recently, our team discussed this requirement, which will allow users to customize templates in the future and connect prompts based on the variables within the template.

tisfeng commented 4 months ago

Hi, is there any progress on this feature?

I also hope to be able to customize the prompt. It would be best to support user input for the commit message label because sometimes CodeGPT might provide an incorrect label.

I want to guide it to generate the correct commit message by manually specifying the label.

For example, codegpt commit --feat means generating a commit message with feat: {{ .summarize_title }}.

codegpt commit --fix means generating a commit message with fix: {{ .summarize_title }}.

appleboy commented 4 months ago

@tisfeng you can try the following command to change the summarize prefix:

codegpt commit --template_vars summarize_prefix=foobar
tisfeng commented 4 months ago

Good, thanks 😊

jim60105 commented 1 month ago

Has there been any progress on this proposal? 👀

I wrote some LLM prompts that better meet my needs, and I hope there is a way to apply them.