Home

Awesome

<p align="center"> <img width="300" src="./assets/logo.png"> </p>

About

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.

Features

Demo

<div align="center">

Demo Video

Click the image or visit https://www.youtube.com/watch?v=zRnMu6OHNtU

</div>

Events

September 16, 2024

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.

How To Set Up?

1. Install cha

Clone this repository, navigate to its directory, and run the following command to install or upgrade cha:

pip3 install --upgrade .

2. Configure API Keys

  1. Create a .env file in the root directory.

  2. Obtain your API keys:

  3. 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"
    
  4. To activate the environment variables, run:

    source .env
    

3. Run cha, cla, or grq

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

4. (Optional) Using my configuration of cha

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

5. Now you're now ready to go!

Develop Mode

For developing Cha, you can do the following:

1. Install cha in editable mode so that pip points to the source files of the cloned code:

pip install -e .

2. Make changes to the code, then run cha, cla, or grq to try out your changes

3. If you add a new dependency, you will have to do step 1 again

Other Notes

Credits