di-sukharev / opencommit

Generate conventional git commit messages with AI in 1 second 🤯🔫
https://www.npmjs.com/package/opencommit
MIT License
6.15k stars 328 forks source link

[Bug]: cannot type the passphrase for the ssh key when i git push #369

Closed banoni-dev closed 2 months ago

banoni-dev commented 3 months ago

Opencommit Version

3.0.16

Node Version

20.15.1

NPM Version

10.7.0

What OS are you seeing the problem on?

Other Linux Distro

What happened?

after generating the commit message and accepting it. it asks for pushing but i am using ssh key so i should type the passphrase but i can't

image

Expected Behavior

hwn i choose to push the cli asks for the passphrase and i can type it

Current Behavior

it shows the msg to type the passphrase but nothing is typed

Possible Solution

No response

Steps to Reproduce

No response

Relevant log output

No response

matscube commented 3 months ago

@banoni-dev Hi, Maybe this isn't the answer you expected, but you can skip the git-push step by using the OCO_GITPUSH environment variable. If you set OCO_GITPUSH to false, the oco CLI will not automatically push your branch after generating the commit.

# ~/.opencommit

OCO_GITPUSH=false
di-sukharev commented 3 months ago

@matscube hi, thank you for the help. I think what we need is to pipe stdout into the cli logs somehow, if you have any ideas — please share in this thread <3

matscube commented 2 months ago

@di-sukharev Hi, By using the stdin option of execa, it might be possible to input the SSH key password during the git push process of oco and pipe it to the git command.

However, if users cache the password with ssh-agent, they won't be prompted for a password during git push. This issue could be addressed by caching the password in advance using ssh-add.

The use case for piping password input via stdin might be limited, but if there's demand, I can look into implementing this feature. What do you think?

di-sukharev commented 2 months ago

Takanori, please do, it would be a great improvement. Lets pipe all the stdout, it is good to also see husky and other pre-commit/push pipeline logs

di-sukharev commented 2 months ago

@banoni-dev please refer to this comment https://github.com/di-sukharev/opencommit/issues/369#issuecomment-2246805940 as a workaround