Nutlope / aicommits

A CLI that writes your git commit messages for you with AI
https://www.npmjs.com/package/aicommits
MIT License
7.62k stars 359 forks source link

Support gitmoji #20

Open MarcusOtter opened 1 year ago

MarcusOtter commented 1 year ago

It would be cool if it could optionally automatically pick a nice emoji, for example following https://gitmoji.dev

AntoineKM commented 1 year ago

ahah I was going to make the same suggestion

Nutlope commented 1 year ago

Agreed! Added this feature suggestion to the README and will plan to implement it under a feature flag so only those who want it can use it

privatenumber commented 1 year ago

Would be helpful if someone can engineer a prompt for this and suggest it here. You can experiment for free on https://chat.openai.com.

kcoderhtml commented 1 year ago

A variation of this might work.

I will give you a commit message for git, and you will classify the commit category and pick a suitable gitmoji for the category. Respond with only the emoji and then the category you classified the commit as, don't give any commentary. Here is your first commit: {{commitMessage}}
kcoderhtml commented 1 year ago

Example output: feat: show multiple options (#64) > :sparkles: feat (feature) chore: add commit hooks (#56) > :wrench: chore (maintenance) Merge pull request #63 from Nutlope/bundle-deps > :arrows_counterclockwise: merge (merge)

kcoderhtml commented 1 year ago

v2 that only gives the text code:

I will give you a commit message for git, and you will classify the commit category and pick a suitable gitmoji for the category.
Respond with only the gitmoji text code and not an emoji or commit catagory, don't give any commentary.
Response should be formated like this without the quotes: ':sparkles:'
Here is your commit:  {{commitMessage}}
Th3Kr4t3 commented 1 year ago

I sent a PR on how to implement this, I added a prompt to the end like this: preface with the suitable Gitmoji markup between colons: to use it:

Write an insightful but concise Git commit message in a complete sentence in present tense for the following diff preface with the suitable Gitmoji markup between colons:\n${diff}