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 151 forks source link

Safe escaping #100

Closed np closed 1 year ago

np commented 1 year ago

Fixes #97 and #96

0xacx commented 1 year ago

Thank you so much for this @np 🙏
I wanted to refactor this for such a long time but never really got to it. Thanks for diving deep and cleaning this up! I would maintain the chat context/messages variables and make them all local and pass them around to reduce global variables further, but this approach also works. Also very smart use of jq to escape! 👌