AI in terminal

Build a tiny bash to let the terminal support GPT

TeeTracker
1 min readJul 4, 2023

Start

I believe that ever since ChatGPT has gained popularity, this picture has also gained popularity. So, why not wrap OpenAI’s API to generate concise ideas?

Idea

I work with different terminals on Linux or Mac, and sometimes I don’t want to leave the terminal to seek help when faced with a problem. So, my goal is to find a way to access assistance without exiting the terminal.

Like this:

i-ask "Where is the installation of Conda on MacOS via Homebrew?"

Work

I believe you already have an idea of what I want to accomplish. Here’s the script for your reference, with the API Key placeholder marked for your convenience. You can easily insert your API Key in the appropriate location.

Don’t forget this, I call this app “i-ask”:

chmod +x i-ask.sh

Final

It works 😅

--

--