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.15k stars 100 forks source link

Feature request: Make prompt templates customizable #142

Open doggy8088 opened 7 months ago

doggy8088 commented 7 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 6 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 days 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 1 day ago

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

codegpt commit --template_vars summarize_prefix=foobar