Hey again everyone,<p>Since I debuted Cha, a lot has changed, so I wanted to make a new post about it. Cha is a simple and open-source CLI chat tool designed to easily interface with OpenAI's text and image generation models through their API. I built this tool about 1.5 months ago and use it on a daily basis, to the point where I use it more than I use the ChatGPT website.<p>Currently, Cha supports the following features:<p>- Basic CLI chat interface to OpenAI’s LLM models.<p>- Web scraping for a provided link (supports JavaScript scraping).<p>- YouTube scraping; scraping the transcript from a video.<p>- Multi-line support; easily copy and paste new lines into the CLI.<p>- Generate images using OpenAI's image models.<p>- Supports interactive and non-interactive mode for chatting.<p>I think Cha is very useful, especially for command-line-based tasks, so I wanted to share it. Cha is still very young, so any feedback would be greatly appreciated.<p>Demo: <a href="https://www.youtube.com/watch?v=YcfFC1IU_SA" rel="nofollow">https://www.youtube.com/watch?v=YcfFC1IU_SA</a><p>Code: <a href="https://github.com/MehmetMHY/cha">https://github.com/MehmetMHY/cha</a>
To make Cha more seamless, I created the following command in my .zshrc:<p>chatgpt () {
DEFAULT_MODEL="gpt-4-turbo-preview"<p><pre><code> # path to your OpenAI API key
source /Users/mehmet/.custom/.env
if [[ "$1" == "-f" && -n "$2" ]]; then
cha -m $DEFAULT_MODEL -f "$2"
elif [ $# -eq 0 ]; then
cha --model $DEFAULT_MODEL
else
cha -m $DEFAULT_MODEL -s "$1"
fi
unset OPENAI_API_KEY
}</code></pre>