0xacx / chatGPT-shell-cli

Simple shell script to use OpenAI's ChatGPT and DALL-E from the terminal. No Python or JS required.
https://gptshell.cc
MIT License
1.05k stars 150 forks source link

Shell useage #20

Closed oligeo closed 1 year ago

oligeo commented 1 year ago

Hi. This add support to use the scrtipt directly from shell to return response without open cli. So you can use it on other scripts. Added parameters: -i | --init-prompt-from-file) # if you need multiple Initprompts --init-prompt) # or just a small init-promt -p | --prompt-from-file) # put prompt from file --prompt) # or directly in command parameter

You can send the prompt directly through a pipe.

echo "Hello GPT" | chatgpt

Additional check rlwrap to add navigation support for the cli. I hope theres nothing wrong, it is my first pull request.

0xacx commented 1 year ago

Thank you very much for this PR! You implemented the feature request described in https://github.com/0xacx/chatGPT-shell-cli/issues/11 👍 Nice work! I ran into some glitches when testing this so I decided to make a few changes. I integrated your changes into this PR https://github.com/0xacx/chatGPT-shell-cli/pull/21 I chose not to include rlwrap, because it's an extra dependency. I have tried to keep the script as lean as possible from external deps. Also good idea extracting the chatgpt label to a constant, I should have done this earlier. :) Thanks again for putting in the work!

0xacx commented 1 year ago

@oligeo I am closing this PR as I have integrated your changes and merged in main. Again, thanks a lot for the PR, really appreciate it! 🙏 If you have any questions, suggestions lmk. Cheers!