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.42k stars 742 forks source link

Edit commands from `sgpt -s` mode . . . #497

Open startakovsky opened 7 months ago

startakovsky commented 7 months ago

sgpt -s is a great feature but I would like to propose the ability to edit the output before execution, sort of like whatever happens with ctrl +l (shell integration). Maybe now I am answering my own question, but the difference here is that since I can pipe to here and cannot pipe to ctrl +l I can totally see how this would be valuable. For example, mistakes happen and it may be easier to correct it right away.

Current Situation

$ sgpt --shell "find all json files in current folder"
# -> find . -type f -name "*.json"
# -> [E]xecute, [D]escribe, [A]bort: 

Proposed Future Option 1 ( add Modify to list of options)

$ sgpt --shell "find all json files in current folder"
# -> find . -type f -name "*.json"
# -> [M]odify, [E]xecute, [D]escribe, [A]bort: 

Pros: Current Functionality remains

Proposed Future Option 2 (remove Execute, replace with Edit)

$ sgpt --shell "find all json files in current folder"
# -> find . -type f -name "*.json"
# -> [E]dit, [D]escribe, [A]bort: 

Pros: Current User Behavior is safe and product doesn't just allow to execute on autopilot. Cons: You have to press enter twice instead of once

Proposed Future Option 3 (remove Execute, replace with Modify)

$ sgpt --shell "find all json files in current folder"
# -> find . -type f -name "*.json"
# -> [M]odify, [D]escribe, [A]bort: 

I don't actually like this one, because Option 2 is better 😄