shell_gpt icon indicating copy to clipboard operation
shell_gpt copied to clipboard

[Feature request] Handle linebreaks

Open annawoodard opened this issue 3 years ago • 2 comments

Thank you for this fantastic tool! 🙏 🙏 🙏

Your tool is a game-changer for me, especially since I can't access ChatGPT while I have my VPN enabled, so I can't use it at all while working.

It would be nice to have a natural way to handle linebreaks-- for example, for a prompt like "convert the following code from Pytorch to Tensorflow." Perhaps sgpt could drop you into $EDITOR the same way git does, where you could paste your text, and then exit.

Thoughts?

annawoodard avatar Feb 09 '23 01:02 annawoodard

Thank you for your feedback!

The feature you are suggesting is actually a good idea. It can be implemented using additional argument for example, you would call sgpt --editor and it will drop you into $EDITOR where you could write entire prompt including code:

convert the following code from Pytorch to Tensorflow:
import torch
...

By the way, we can also pass any file content to the prompt using some shell magic:

sgpt "convert the following code from Pytorch to Tensorflow: $(cat my_pytorch.py)"

TheR1D avatar Feb 09 '23 11:02 TheR1D

Implemented with --editor argument in PR https://github.com/TheR1D/shell_gpt/pull/27

TheR1D avatar Feb 19 '23 02:02 TheR1D