Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept stdin input #80

Closed
Shakahs opened this issue Mar 21, 2023 · 2 comments · Fixed by #163
Closed

Accept stdin input #80

Shakahs opened this issue Mar 21, 2023 · 2 comments · Fixed by #163
Assignees
Labels
enhancement New feature or request

Comments

@Shakahs
Copy link

Shakahs commented Mar 21, 2023

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.

@TheR1D
Copy link
Owner

TheR1D commented Mar 22, 2023

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)"

@Shakahs
Copy link
Author

Shakahs commented Mar 24, 2023

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.

@TheR1D TheR1D self-assigned this Apr 10, 2023
@TheR1D TheR1D added the enhancement New feature or request label Apr 10, 2023
@TheR1D TheR1D linked a pull request Apr 10, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants