How to use chatgpt on Linux

Configurare noua (How To)

Situatie

OpenAI has developed an AI-powered chatbot named `ChatGPT`, which is used by users to have their answers to questions and queries. One can access ChatGPT on searchingness easily. But some users want to access this chatbot on their Linux System. It can be accessed as a Desktop application on Ubuntu or can be accessed by the Linux terminal.

Solutie

Pasi de urmat

1. We need to install Node.js in our Linux system because the package we are going to install in our system requires `npx` and we know that both `npm` and `npx` are typically installed along with Node.js.

Extract the Node.js package:

tar -xvf node-v18.16.0-linux-x64.tar.gz

The tar command is used to extract the contents of the downloaded tarball.

2. Move the Node.js directory:

sudo mv node-v18.16.0-linux-x64 /usr/local/

Here, the mv command is used to move the extracted Node.js directory to the /usr/local directory. The /usr/local directory is commonly used for locally installed software.

3. Create symbolic links:

sudo ln -s /usr/local/node-v18.16.0-linux-x64/bin/node /usr/local/bin/node
sudo ln -s /usr/local/node-v18.16.0-linux-x64/bin/npm /usr/local/bin/npm

These commands create symbolic links (ln -s) that point to the Node.js executable (node) and the Node Package Manager (npm) in the /usr/local/bin directory. This step allows you to run Node.js and npm from anywhere in the system.

Verifying the installation:

node -vnpm -v

These commands will display the installed versions of Node.js and npm, respectively.

4. Installing terminalgpt and some global packages

npx terminalgpt

This installed terminalgpt in our system.

npm install -g lowdb steno inquirer
  • Creating our OpenAI API key
  • 1) Visit the OpenAI website
  • Sign in or create an account: If you already have an account, sign in using your credentials. Otherwise, click on the “Sign Up” button to create a new account.
  • 2) Create a new API key:
  • After selecting view API keys, Click on Create new secrete key
  • 3) Enter your key name:
  • Enter your desired key name here and click on create secret key.
  • 4) KEY Generated:
  • Copy your Key from the prompt.
  • Step 4: Enter API Key.
  • npx terminalgpt chat

6. Use of TerminalGPT

Now we can ask any question we want to the terminalgpt.

For Example: npx terminalgpt chat

Tip solutie

Permanent

Voteaza

(4 din 7 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?