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.07k stars 152 forks source link

Error handling and New Line for c0de copy pasta! #8

Closed jordantrizz closed 1 year ago

jordantrizz commented 1 year ago
jordantrizz commented 1 year ago

I needed this to debug why my API key wasn't working, and then needed to copy and paste code but thought a new line would help.

0xacx commented 1 year ago

Thank you very much for this PR! 🙏 I used your suggestion and added an error handling function in chat and image generation. ✌️ About the newline, I really prefer it the way it is, as it intuitively feels more like a chat conversation, although I understand that for code a new line makes things easier to copy. Cheers!

jordantrizz commented 1 year ago

No worries about the new line.

Have you thought about a mode where you can pass the question via arguments and have the answer returned to stdout?

0xacx commented 1 year ago

Yes, that has been on my mind, the use case being that it would allow you to pipe the response to another command/script. In practice I didn't have the need for that functionality yet. I might add it in the future though.