Nutlope / aicommits

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

Add '--yes' or '-y' option to automatically accept AI generated commit messages #216

Open KennethLG opened 1 year ago

KennethLG commented 1 year ago

Feature request

I propose to add a --yes or -y option to the aic command line utility, which will allow users to automatically accept the first AI generated commit message without requiring interactive input. This feature will be especially useful when aic is integrated into automation scripts or other environments where manual input is not convenient or possible.

Currently, when a user runs aic, they are presented with one or multiple AI-generated commit messages and are asked to select one. While this is a great feature for manual use, it becomes a bottleneck when trying to automate the Git commit process as it requires an interactive terminal to make a choice.

Why?

The problem I am addressing with this feature is the lack of an automation-friendly interface for aic. I am currently developing a script that monitors a directory for changes, automatically stages and commits those changes using aic for commit messages. However, the lack of an option to automatically accept an AI generated message is preventing me from fully automating this process.

I believe this feature would increase the flexibility and usability of aic, not only for my use case but also for other developers who wish to include aic into their automated workflows.

Alternatives

No response

Additional context

I am willing to contribute to this feature's development. I have reviewed the project's source code and have an understanding of where and how this new feature could be integrated. However, I would appreciate guidance and feedback from the project maintainers to ensure my contribution aligns with the project's standards and conventions.

oregonpillow commented 1 year ago

I found a workaround for now, install the commit hook in the repository aicommits hook install then you can do something like this:

git add -A && git commit --allow-empty-message --no-edit && git push

--allow-empty-message is not really required, but if something goes wrong maybe it will still commit empty --no-edit is needed to suppress git from trying to open the text editor e.g nano, to edit the commit message

Edit: I think this is better. If aicommits fails, use date as commit message

git add -A && git commit --no-edit || git commit -m "$(date)" && git push
AlexanderKozhevin commented 5 months ago

yep, I want this feature too

zeallat commented 3 months ago

@oregonpillow Thank you so much!