shell_gpt
shell_gpt copied to clipboard
Accept stdin input
It would be very useful to pipe stdin to sgpt, then ask a question about said input. For example:
cat data.json | sgpt "what is the oldest entry" cat script.py | sgpt "what does this script do?"
etc.
But you can do the same thing with command substitution syntax, as it is described in readme:
sgpt "what is the oldest entry: $(cat data.json)"
Perhaps, but it is not practical. Pipelining commands is a basic tenet of CLI usage and shell scripting. For SGPT to be the shell's interface to GPT it must support the IO capabilities expected of a shell utility. This is the third issue on the subject (see #35, #86) so clearly it is needed. I have created a pull request implementing it in #93.