Learn about ShellGPT: Converting text into terminal commands.

Working in the terminal is often slow and frustrating. You waste precious minutes, even hours, switching between Google and the terminal just to find the right command or figure out the syntax for a script. This constantly interrupts concentration and makes even small tasks tedious. Then ShellGPT came along and changed everything. Now you can describe what you want in simple English, and it instantly generates the exact shell command or snippet you need. Tasks that used to take 20 or 30 minutes now only take seconds.

 

What is Shell GPT?

ShellGPT (or sgpt) is an AI-powered command-line interface (CLI) tool that integrates large language models (LLMs) , such as OpenAI's GPT family, directly into your terminal. It acts as a productivity assistant, allowing users to generate shell commands, code snippets, documentation, and answers to general knowledge questions using natural language prompts.

Installing ShellGPT on Linux

ShellGPT requires Python 3 and pipx. You can install them using the following command:

sudo apt install python3-full python3-venv pipx -y

Next, run the following command to ensure you can use the installed applications using pipx from the terminal:

pipx ensurepath

Finally, install ShellGPT system-wide using pipx:

pipx install shell-gpt

 

ShellGPT is free, but using OpenAI to get AI feedback requires a small fee. You can also run local AI models with ShellGPT for free, which is useful if you want to avoid any fees. ShellGPT is similar to Gemini CLI, and is a good alternative if you want to avoid Google at all costs.

To use OpenAI, create an API key on the OpenAI platform. Then, set it up in your environment. You can use the following command to set the API key only for the current session:

export OPENAI_API_KEY="chỉ-định-API-key-của-bạn-tại-đây"

To make the changes permanent, add the above code to the '~/.bashrc' or '~/.zshrc' file, then apply the changes using the following command:

source ~/.bashrc

Next, run the following command to verify that ShellGPT has been properly installed on your system:

sgpt --help

Now you're ready to turn your speech into terminal commands.

Using ShellGPT for AI queries

People often have to switch between the terminal and the browser just to find the right command or solution. Now, you can ask general questions and get answers directly from the terminal.

sgpt "What is Dockpeek?"

 

ShellGPT saves time, minimizes context switching, and makes working in the terminal much smoother and more intuitive.

Run commands directly using simple English.

Many people used to waste time trying to remember all the terminal commands, often getting distracted and slowing down even simple tasks. With ShellGPT, that stress is gone. Now you just type what you want in simple English:

sgpt "how to find the free disk space on my system"

ShellGPT explains the command and shows exactly what to run. This not only saves time but also helps you gain a deeper understanding of the commands.

ShellGPT is not just for explaining commands. If you want to execute commands directly, you can use the -s option .

sgpt -s "find free disk space on my system"

Here, -s runs the command immediately, skipping the explanation.

This flexibility allows you to decide when you need guidance and when you just want results.

Create commands without explanation.

Sometimes you just need the command itself, without any additional text. ShellGPT makes this easy. For example, to delete a Docker image, enter your command with the -c option, and ShellGPT transforms the words into ready-to-use commands:

sgpt -c "how can I remove a Docker image"

This saves you the effort of searching on forums or in guides.

Chat with ShellGPT

Multi-step tasks often disrupt workflows, cause distractions, and lead to repetitive steps. ShellGPT's chat mode addresses this problem. It allows for maintaining a single conversation and building each step naturally:

 

sgpt --repl chatName

For example, create a session for disk-related tasks and continuously ask follow-up questions. ShellGPT remembers the context, provides step-by-step instructions, and allows you to focus on a single problem:

sgpt --repl disk-info

This feature has really simplified the workflow for complex tasks.

You've just finished reading the article "Learn about ShellGPT: Converting text into terminal commands." edited by the TipsMake team. We hope this article has provided you with many useful tech tips and tricks. You can search for similar articles on tips and guides. Thank you for reading and for following us regularly.

Close
Category

System

Windows XP

Windows Server 2012

Windows 8

Windows 7

Windows 10

Wifi tips

Virus Removal - Spyware

Speed ​​up the computer

Server

Security solution

Mail Server

LAN - WAN

Ghost - Install Win

Fix computer error

Configure Router Switch

Computer wallpaper

Computer security

Mac OS X

Mac OS System software

Mac OS Security

Mac OS Office application

Mac OS Email Management

Mac OS Data - File

Mac hardware

Hardware

USB - Flash Drive

Speaker headset

Printer

PC hardware

Network equipment

Laptop hardware

Computer components

Advice Computer

Game

PC game

Online game

Mobile Game

Pokemon GO

information

Technology story

Technology comments

Quiz technology

New technology

British talent technology

Attack the network

Artificial intelligence

Technology

Smart watches

Raspberry Pi

Linux

Camera

Basic knowledge

Banking services

SEO tips

Science

Strange story

Space Science

Scientific invention

Science Story

Science photo

Science and technology

Medicine

Health Care

Fun science

Environment

Discover science

Discover nature

Archeology

Life

Travel Experience

Tips

Raise up child

Make up

Life skills

Home Care

Entertainment

DIY Handmade

Cuisine

Christmas

Application

Web Email

Website - Blog

Web browser

Support Download - Upload

Software conversion

Social Network

Simulator software

Online payment

Office information

Music Software

Map and Positioning

Installation - Uninstall

Graphic design

Free - Discount

Email reader

Edit video

Edit photo

Compress and Decompress

Chat, Text, Call

Archive - Share

Electric

Water heater

Washing machine

Television

Machine tool

Fridge

Fans

Air conditioning

Program

Unix and Linux

SQL Server

SQL

Python

Programming C

PHP

NodeJS

MongoDB

jQuery

JavaScript

HTTP

HTML

Git

Database

Data structure and algorithm

CSS and CSS3

C ++

C #

AngularJS

Mobile

Wallpapers and Ringtones

Tricks application

Take and process photos

Storage - Sync

Security and Virus Removal

Personalized

Online Social Network

Map

Manage and edit Video

Data

Chat - Call - Text

Browser and Add-on

Basic setup