TheR1D / shell_gpt

A command-line productivity tool powered by AI large language models like GPT-4, will help you accomplish your tasks faster and more efficiently.
MIT License
9.64k stars 762 forks source link

When generating shell commands, please make `Y` the default action when pressing Enter #185

Closed Boscop closed 1 year ago

Boscop commented 1 year ago

Thanks for making this, it's very useful, especially compared to all the other similar shell GPT scripts which don't pass the OS and $SHELL as context. I really appreciate this :)

I have a suggestion: In most cases when using the --shell/-s flag, the user wants to actually run the generated command. The only question is then, whether GPT got the command right. In most cases it gets it right, so a single enter press to run it would be the most convenient user experience. Please make Y the default for the --shell command.

E.g. instead of:

❯ sgpt -s "list all env vars"
Get-ChildItem Env:
Execute shell command? [y/N]: y

the user would only have to press Enter:

❯ sgpt -s "list all env vars"
Get-ChildItem Env:
Execute shell command? [Y/n]: 

and if the user doesn't want that, they can cancel with Ctrl-C (which would also be faster than entering n and pressing Enter).

xsoc commented 1 year ago

Love this, even if it is just configurable via ~/.config/shell_gpt/.sgptrc