ShellGPT in 4 minutes
97 views
May 22, 2025
ShellGPT in 4 minutes
View Video Transcript
0:00
[Music]
0:00
did you ever wish for a tool that could
0:01
keep track of all those complex commands
0:03
from every hacking tool you use you
0:06
think of what you need to do and boom
0:08
the tool translates your thoughts into
0:10
neat organized code saving you time and
0:12
hassle it sounds like a dream right but
0:15
it's not i'll walk you through how to
0:17
set this tool up which is called Shell
0:18
GPT basically Shell GPT acts as a bridge
0:21
between your terminal and chat GPT so
0:24
you can chat with the AI right from your
0:26
command line step one installing Python
0:28
tools for Mac users use these commands
0:31
for Linux users use these commands we'll
0:34
set up Shell GPT in a Python virtual
0:36
environment to keep things clean and
0:38
tidy this ensures that Shell GPT won't
0:41
mess with any other Python stuff you've
0:43
got going on safety first right to get
0:45
that setup you'll need to install the
0:47
Python virtual environment packages for
0:50
Mac users use Python 3 m pip install
0:53
virtual env but for Linux users use this
0:56
command pseudoappt install Python 3 vanv
1:00
step two setting up a Python virtual
1:02
environment now let's create a cozy
1:04
little space for shellgpt to live in
1:06
we'll make a directory to keep things
1:08
organized we're calling ours shell gpt
1:11
but you can name it whatever you like
1:12
once it's made hop into that directory
1:15
we're going to set up a special
1:16
environment just for shell GPT using
1:18
Python's virtual environment magic we'll
1:21
call it shell GPT because well why not
1:23
now we've got a private little haven for
1:25
shell GPT inside our shell GPT directory
1:28
but hold up we're not done yet we need
1:30
to activate this virtual environment so
1:32
that Shell GPT can do its thing to do
1:35
that we'll run a script called activate
1:37
found in the bin directory of our
1:38
virtual environment time to bring Shell
1:40
GPT to life step three getting your chat
1:43
GPT API key head over to the OpenAI
1:46
website if you already have an account
1:48
great just log in if not go ahead and
1:50
sign up once you're logged in click on
1:52
your account name in the top right
1:54
corner a menu will pop up select view
1:56
API keys from the menu this will take
1:58
you to the API keys page on the API keys
2:01
page you'll see a button that says
2:03
create new secret key click on that now
2:06
give your new key a name it can be
2:07
anything you want just something to help
2:09
you remember what it's for once you've
2:11
named it hit the green create secret key
2:13
button voila your shiny new API key will
2:16
be displayed to you this is the only
2:18
time you'll see it in its entirety so
2:20
make sure to copy it paste your API key
2:22
into a text editor and save it with a
2:24
name that makes sense to you this key is
2:26
your ticket to accessing ChatGpt's
2:28
powers so keep it safe and there you
2:30
have it your very own ChatGpt API key
2:33
ready to unleash the magic now that
2:34
you've got your hands on that shiny new
2:36
API key let's make sure Shell GPT can
2:39
use it if you're up for a quick command
2:40
line trick just type the following
2:42
replacing your secret API key with your
2:44
actual API key step five installing
2:47
Shell GPT now that we've got everything
2:49
set up it's time to bring Shell GPT into
2:51
the mix installing it is a breeze using
2:54
the trusty Python pf command just let it
2:56
do its thing and when it's finished
2:58
you're all set to dive into the world of
3:00
Shell GPT and chat GPT step six chat
3:04
away let's take a look at few examples
3:06
to understand this tool more clearly
3:07
example one sgptt shell how to see the
3:10
firewall rules this command will give
3:13
you the exact code you'll need to see
3:14
the firewall rules example two sgptt how
3:18
to see the firewall rules using
3:20
firewalled command this is a more
3:22
specific request it's asking how to view
3:24
firewall rules but specifically using a
3:27
tool called firewalled firewalled is a
3:29
program that helps manage firewall
3:31
settings in some Linux systems so this
3:33
question is about how to use firewalled
3:35
commands to look at firewall rules
3:38
example three sgpt code create a bash
3:41
script to delete files in a given
3:43
location older than 30 days this will
3:45
write the exact code in bash language to
3:48
automatically remove files from a
3:49
certain place on your computer that are
3:51
more than 30 days old you can find all
3:53
the syntax of this tool in its GitHub
3:55
page i hope you found this tutorial
3:57
useful and see you in the next
#Scripting Languages