A simple CLI chat tool designed for easy interaction with OpenAI's models. It also allows you to easily interact with Anthropic's Claude models and Groq's API.
- Basic CLI chat interface with OpenAI's LLM models.
- Web scraping capability for provided links (supports JavaScript scraping).
- YouTube scraping functionality for extracting video transcripts.
- The YouTube scraper either scrapes transcripts or downloads the video's audio and converts it to text using OpenAI's Whisper model though the Groq API.
- Multi-line support for easy copying and pasting into the CLI.
- Ability to generate images using OpenAI's image models.
- Uses CLImage to display images directly in the terminal.
- Supports both interactive and non-interactive chat modes.
- Basic support for other models on different platforms:
- Anthropic's Claude models via the
cla
command. - Groq's API through the
grq
command.
- Anthropic's Claude models via the
Click the image or visit https://www.youtube.com/watch?v=zRnMu6OHNtU
Cha's Answer-Search feature was removed because the code was difficult to maintain and the feature was not used often. If you want to use something similar, or even better, you can check out Perplexity or Perplexica. Also, the last version of Cha that supported this feature was version 0.5.1, whose commit you can view HERE.
Clone this repository, navigate to its directory, and run the following command to install or upgrade cha
:
pip3 install --upgrade .
-
Create a
.env
file in the root directory. -
Obtain your API keys:
- OpenAI API key: Get it here
- Anthropic API key: Get it here (for
cla
command) - Groq API key: Get it here (for
grq
command)
-
Add your keys to the
.env
file, using this format:# Replace YOUR_KEY_HERE with your respective API keys export OPENAI_API_KEY="YOUR_KEY_HERE" export ANTHROPIC_API_KEY="YOUR_KEY_HERE" export GROQ_API_KEY="YOUR_KEY_HERE"
-
To activate the environment variables, run:
source .env
To start the tool, execute one of the following:
# talk with OpenAI's models
cha
# talk with Anthropic's models
cla
# talk with Groq's supported models
grq
If you would like, you can use my configuration of cha
. To view my configuration, check out the cha.sh
file. To use it, add the content from the cha.sh
file to your shell's config file:
# zsh
cat cha.sh >> $HOME/.zshrc
# bash
cat cha.sh >> $HOME/.bashrc
Then, run my configuration of cha
:
chatgpt
For developing Cha, you can do the following:
pip install -e .
- To see and/or change hard-coded config variables/logic in Cha, checkout the
config.py
file.