How to Use ChatGPT in Linux Terminal

ChatGPT is the chatbot AI utility that responds in a human-like dialogue to the provided input. The input is in the form of Natural Language Processing and it is used to provide information related to any topic in detail for the understanding of human beings. 

ChatGPT has directed the technology world in a new direction. After the launch of ChatGPT, a lot of new Artificial Intelligence utilities have been introduced that are used to generate images and videos from the NLP input. 

To understand the installation and usage of the ChatGPT on Ubuntu, read the mentioned article and this blog explains the usage of the ChatGPT with the Linux terminal of Linux. 

How to Login the ChatGPT on Linux?

First, log in to the ChatGPT account and then use it with the help of the terminalgpt by following the steps mentioned-below. 

Step 1: Open the Web Browser

First, open your favorite web browser to access the ChatGPT:

Step 2: Access the ChatGPT API Website

Now access the Login web page of the ChatGPT by opening the following link:

Step 3: Enter the ChatGPT API Account’s Credentials

Enter the credentials of the ChatGPT account including the email ID and password:

Step 4: Display the API Keys

Now click on the account and then select the “View API keys” as shown:

Step 5: Create a New Secret API Key

Create a new secret API key by clicking on the “+ Create new secret key” button:

Step 6: Assign a Name to the Secret API Key

Assign a new name to the secret API Key and then click on the “Create secret key” button:

Step 7: Copy the Generated Secret Key

The secret key has been generated, copy it and then click on the “Done” button:

Step 8: Open the Terminal

Open the terminal of the installed Linux Distribution:

Step 9: Install Pip Python Package

Install the Pip package by following the article mentioned in the link.

Step 10: Install terminalgpt

Now install the python package of the “terminalgpt” using the pip package manager:

$ pip install terminalgpt -U --user

Step 11: Display the Version

To display the installed version of the terminalgpt, execute the command:

$ terminalgpt --version

Step 12: Configure the terminalgpt

Finally configure the installed terminalgpt with the following command and copy-paste the generated API key of the ChtaGPT:

$ terminalgpt install

It will ask to choose the model of gpt, choose your desired model:

Now choose the printing style of the terminalgpt, by default it will choose “markdown” as shown below:

The terminalgpt has been configured and is ready to be used with the note printed on the screen:

How to Use the ChatGPT on Linux Terminal?

To use the ChatGPT on Linux, run the following commands of terminalgpt on Linux terminal.

Load Previous Conversation

To load the previous conversation, use the “load” option:

$ terminalgpt load

Delete a Conversation

To delete the conversation, run the terminalgpt command with its delete option:

$ terminalgpt delete

Start a New Conversation

To start a new conversation, run the following command and the assistant of the terminalgpt will be initialized:

$ terminalgpt new

Note: Please ensure that the subscription of the chatgpt has been enabled and you have the number of tokens.


To use the ChatGPT on the Linux terminal, install the “terminalgpt” using the Pip Python package manager. Then login to it with the generated ChatGPT API secret key. This blog explained the generation of the secret keys of the ChatGPT API and also the installation of the terminalgpt in detail.