Skip to content
Technology News Information & Jobs

Technology News Information & Jobs

Ubuntu Tutorials, Ubuntu How To , Linux Tips, Tech Jobs

  • Work with US
  • Search Jobs
  • Post a Job
  • Contact Us
  • Ubuntu
    • Ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • Themes
  • Linux
  • Laptops
  • Tutorials
  • Job Dashboard
  • Toggle search form
How To Set up And Use ChatGPT In Linux Terminal

How To Set up And Use ChatGPT In Linux Terminal

Posted on March 22, 2023 By admin No Comments on How To Set up And Use ChatGPT In Linux Terminal

How To Set up And Use ChatGPT In Linux Terminal

ChatGPT is creating a storm on the Internet. Almost everyone is talking about it and also using it. Everyone wants to eat the pie of its popularity by using it or integrating it. Meanwhile, in this article, we will discuss the method of using ChatGPT in Linux and that one in Linux terminal.

How To Set up And Use ChatGPT In Linux Terminal

We will take the help of ShellGPT in Linux to use ChatGPT. ShellGPT is developed by Farkhod Sadykov, Eric, and Loïc Coyle. Before installing ShellGPT in Linux, you need to have python installed. Python comes preinstalled on most latest Linux distros. So run the following command to the python version installed on your Linux.

python3 --version

If you see any errors, then the python is not installed or the deprecated python2.7 is installed on your system. If an older version of Python is installed, run the below command to update Python to the latest version.

sudo apt --only-upgrade install python3

If there is no python installed in your system, then run the following command to install Python:

For Ubuntu:

sudo apt update && sudo apt upgrade -y
sudo apt install python3

Install Pip Package Manager:

READ More Relevant Stuff:  How to Set Up Apache HTTP with an SSL Certificate

It generally comes preinstalled with Python in most Linux distributions, but if it is not installed, you can install it with this command:

sudo apt-get -y install python3-pip

Now, let’s begin the process of installing ShellGPT on Linux.

Run the following command to create a directory.

mkdir <new_directory_name>

Switch over to the new directory you just created with the following command:

cd <new_directory_name>

Now, run the following command to create a new virtual environment. First, install the venv model.

sudo apt install python3-venv
 python3 -m venv  

The virtual environment you just created will be deactivated by default. Run the following command to activate the environment:

source /bin/activate

Get Your OpenAI API Key

We need to have OpenAI API key to use ChatGPT’s services in Linux. For this:

1. Navigate to OpenAI’s website and create a new OpenAI account. If you already have an account, simply log in and move to the next step.

2. Next, click on your profile image at the top right corner and select “View API keys” from the drop-down menu.  Here, you will see all the previously generated API Keys if any.

3. To generate a new API key, click the “Create new secret key” button. Do not share this API key with anyone or share it publicly. Now, create an environment variable for this API key with the command below.

export OPENAI_API_KEY=<your_OpenAI_API_key_here_API key you generated to use ChatGPT>

Verify the environment variable by listing it with the env command:

env

To store the API key permanently, open the .bashrc file in the text editor and add the variable at the end of the file.

export OPENAI_API_KEY=<your_OpenAI_API_key_here_API key you generated to use ChatGPT>

Save the file and exit the text editor after you have added the OpenAI API key.

READ More Relevant Stuff:  Multiple Ways To Fix "Error in Body Stream" on ChatGPT

Install ShellGPT to Use ChatGPT on Linux

Now run the following  command to install ShellGPT on your PC:

pip3 install shell-gpt --user

How to Use ChatGPT in Linux with Examples

Run the following command to get the result.

For example, if you need to know the goal record of the messi, use this command:

sgpt " goal record of the messi"
Internet Tags:ChatGPT

Post navigation

Previous Post: How To Clear Apt Cache In Ubuntu, Debian, And Linux Mint
Next Post: GNOME 44 “Kuala Lumpur” Officially Released

Related Posts

How To Fix Spotify Not Showing As Your Discord Status? How To Fix Spotify Not Showing As Your Discord Status? Internet
Hiring Skilled IT Experts Is Vital In The Tech Age, And Here’s Why Internet
How to Set Up Apache HTTP with an SSL Certificate How to Set Up Apache HTTP with an SSL Certificate Internet
What Is Data Management And Why Is It Important What Is Data Management And Why Is It Important? Internet
How Much Money Does TikTok Pay For 1 Million Views In 2023 How Much Money Does TikTok Pay For 1 Million Views In 2023 Internet
Understanding Browser History, Caches And Cookies Understanding Browser History, Caches And Cookies Internet

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How To Enable Hibernate in Ubuntu 22.04 LTS May 20, 2024
  • Popular Ubuntu Games: Top 5 Games To Play March 17, 2024
  • WordPress | Your site doesn’t include support for the “generateblocks/container” block GenerateBlocks Plugin February 11, 2024
  • Ubuntu Autoremove Command Debian Autoremove Command February 10, 2024
  • How To Mount Windows 11 Shares on Debian Linux December 7, 2023
  • Anonymous Browsing 101: A Deep Dive Into Residential Proxies November 20, 2023
  • How To Correctly Install Uninstall Linux Ubuntu Nvidia Drivers Fast October 31, 2023
  • Ethical Web Design: The Dos and Don’ts October 28, 2023
  • Understanding the Role of Security Operations Center October 25, 2023
  • The Positive Effects of AI Tools and Online Services on Students Successful Essay-Writing Skills October 3, 2023
  • Linux Wget Examples September 27, 2023

Categories

  • Android
  • Apple
  • Blogs
  • Debian
  • Fix
  • Gadgets
  • Game
  • Google
  • How To Ubuntu
  • Internet
  • Laptops
  • Linux
  • Linux Commands
  • Linux Game
  • Linux Mint
  • News
  • Operating Systems
  • Security
  • Technology
  • Themes
  • Tools
  • Tutorials
  • Ubuntu
  • ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • Windows 11
  • Wordpress
  • Search Jobs
  • Post a Job
  • Job Dashboard
  • Contact Us
  • About US
  • Cookie Policy
  • Terms and Conditions
  • Privacy Policy
  • Sitemap
  • Write For US

Tags

android apps centos ChatGPT command Commands Debian deepin Desktop docker Fedora fix game games Gaming gnome google kernel linux linux commands linux kernel Linux laptops Linux Mint Linux themes minecraft NVIDIA Python Raspberry Pi sysadmin themes ubuntu ubuntu 18.04 Ubuntu 18.04 LTS Ubuntu 20.04 ubuntu 20.04 lts Ubuntu 22.04 LTS Ubuntu games Ubuntu kernel ubuntu themes ubuntu tutorial VirtualBox Windows Windows 11 Wine WSL
itsubuntu.com is an Equal Opportunity Employer. For Advertisement, Jobs, Guest posts, and any other thoughts, email us at [email protected]
  • Lead Data Scientist

    • Sunnyvale, CA (Remote)
    • Walmart Global Tech
    • Full Time
  • Technical Writer

    • Orlando, FL
    • LHH
    • Full Time
  • Grant Writer/Sourcer

    • Lewisville, TX
    • BayMark Health Services
    • Full Time
  • Specifications Writer

    • Los Angeles, CA
    • Northern Impact
    • Full Time
  • Writer

    • Austin, TX
    • Avance Consulting
    • Full Time
  • Technical Writer

    • Washington DC
    • ACL Digital
    • Full Time
  • Technical Writer (Local Candidates – Meetings onsite)

    • Richmond, VA
    • TECHEAD
    • Full Time
  • AML SAR Writer

    • New Castle, PA
    • Pyramid Consulting, Inc
    • Full Time

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme