Chat gipity is a command line client for ChatGPT. It allows you to chat with your chosen model of ChatGPT in a terminal and even pipe output into it. The default model is GPT-4.
For example, say you wanted to debug your rust program that doesnt compile and want ChatGPT to explain it, you can pipe the output through chat-gipityto help you debug like this:
Another usage is reading from a file. In this example we read from a file and ask ChatGPT to convert that file to another programming language:
cgip "convert this to python" -f src/main.rs
cargo install cgip
If you dont have the tap, add it:
brew tap divanvisagie/homebrew-tap
Install cgip with brew:
brew install cgip
Download this repository and then install the cgip
command
sudo make install
Next, set up your OpenAI key by exporting it as OPENAI_API_KEY
export OPENAI_API_KEY=your_key_here
You can now pipe data to cgip
, remember to use 2>&1
to convert stderr
to
stdout
if you are debugging, as the app can only read stdin
sudo apt-get install build-essential dh-make debhelper devscripts