Nutlope / aicommits

A CLI that writes your git commit messages for you with AI

Home Page:https://www.npmjs.com/package/aicommits

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add an option to accept whatever the suggestion is

davidawad opened this issue · comments

Feature request

I want aicommits to have an option to just take yes for an answer as a flag and take the generated commit message without bothering to ask yes / no as a separate prompt.

for example:

aicommits -y

Why?

(hypothetically) I don't care what the commit message is sometimes, I want the message written but don't want to bother with validating it.

Alternatives

alternative is to feed a key from the shell to hit yes.

Additional context

No response

Here's a workaround for anyone who's looking to do this, make an expect script:

#!/usr/bin/expect

spawn aicommits

expect "Use this commit message?"

send "\r"

interact

This sends an 'enter' keypress to the command when it asks for the commit message which will work.

Make this script executable and throw it in the path and you can just call it within the directory you're in.

I was thinking to just enable it for all messages. I can clearly see your idea as well.

I can alter my PR here - and add that possibility as well.

Or i can make a new PR that only allows your suggestion.

@davidawad I've forked the repo, since this seems to no longer be maintained.

https://www.npmjs.com/package/@negoziator/ai-commit

In my version you can set it to auto-confirm commit messages 😄

aicommit config set auto-confirm=true