Integrating ChatGPT into the Linux terminal opens a world of possibilities for natural language interactions and automation. By combining the power of OpenAI's ChatGPT with the flexibility of the Linux terminal, users can harness the capabilities of this language model for a wide range of tasks and applications.
ShellGPT:
Users can communicate with the AI chatbot on their Linux terminal using ShellGPT, a command line interface for ChatGPT. It is based on the GPT large language model from OpenAI.
Based on our text input, ShellGPT can provide intelligent suggestions and recommendations and even run shell commands. Additionally, it gains knowledge from our exchanges and improves with time. Users no longer need to input lengthy commands or memorize difficult Linux Terminal commands thanks to the ChatGPT application included into the command line. By having ChatGPT handle part of their tedious labor on their behalf, they may reduce errors while saving critical time.
Prerequisites to install ChatGPT in Linux:
- AWS account
- Create an EC2 Instance(Ubuntu).
Steps:
a. Create an EC2 instance and SSH into it.
b. Check if Python is installed in it or not.
c. Install PIP and check the version.
d. Install venv.
e. Setup ShellGPT to use ChatGPT.
- Setup environment.
- Create a directory.
- Create a virtual environment.
- Activate the env.
f. To get OpenAI API Key, navigate to OpenAI’s website.
g. Click on profile and select View API Keys.
h. Click on Create new Secret key.
i. Copy the Key and save it.
j. Now, create an environment variable for this API key with the command below. In Linux, you can create an environment variable using the “export” command.
Replace placeholder with the actual API key you generated to use ChatGPT in the Linux terminal.
export OPENAI_API_KEY=sk-YHhk0****************RMVLVZdqQjiNZ
k. To verify if the export is successfully use env.
l. To store variable permanently, open .bashrc file and add the API key.
m. To make commands in effect, run the command: source .bashrc .
n. Install ShellGPT.
o. Now that we have install ShellGPT, we can use it.
Syntax:
Options | Description |
---|---|
--temperature | Changes the randomness of the output |
--top-probablity | Limits to only the highest probable tokens or words |
--chat | Used to have a conversation with a unique name |
--shell | Used to get shell commands as output |
--execute | Executes the commands received as output from --shell option |
--code | Used to get code as output |
In Action:
Let's Connect!
Top comments (0)