ai-commit icon indicating copy to clipboard operation
ai-commit copied to clipboard

Specify the type of commit or input key words

Open xuwei152 opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe.

Many of the AI's commit messages are incorrect, even for the type.

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Describe the solution you'd like

Is it possible to specify the type of commit message or key words to help Ai to generate the commit message more accurately?

xuwei152 avatar May 08 '24 04:05 xuwei152

@xuwei152 You can try to configure a customized prompt.

/your home directory/.ai-commit/.ai-commit.json or current working directory/.ai-commit.json

{
    ...
    "prompt": "custom",
    "prompts": {
        "conventional": "Here are some best practices...",
        "custom": "..."
    }
}

guanguans avatar May 08 '24 05:05 guanguans

I mean feed the "type" to the AI in the prompt like the "no" to correct the generated message.

For example, the commit message shown below has a type of "refactor" but it is a type of "chore", actually. I hope to input the type "chore" to tell the AI to generate a message with a type of "chore", instead of typing "no" again and again and getting incorrect messages. Something likes chatting with the Ai bot to correct the answer. I don't think this can be achieved by configuring ".ai-commit.json".

Clip_2024-05-08_13-33-04

There may be an easier way. You can add an option of "--commit-type" like insulineru/ai-commit.

Clip_2024-05-08_14-06-24

xuwei152 avatar May 08 '24 06:05 xuwei152

@xuwei152 It's really a good idea, but I don't have time to realize it. You can realize your idea and then PR.

guanguans avatar May 08 '24 06:05 guanguans