Skip to main content

AI command line assistant. Describe a command and get the output.

Project description

gg good-gpt

AI Baked into your command-line terminal: describe what you want to do and the assistant will execute the corresponding command for you.

user@ubuntu:~$ gg list current processes by RAM usage
Do you want to execute this suggested command for linux? [y/n]
--> ps aux --sort=-rss
<Enter>
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
user0     2942  1.0  0.2  38204 21308 tty3     S    11:57   0:00 /usr/bin/python3 /home/user0/.local/bin/gg list current processes by RAM usage
root      2831  0.0  0.0  19884  5396 pts/2    S    11:13   0:00 ssh RemoteHost
root      2728 49.3  0.0  19888  5088 ?        R    09:20  78:02 ssh RemoteHost
...

Installation

This tool is built using python. It has been tested on python 3.10 on both windows and linux. To install Python, visit python.org

After installing python, you can install the good-gpt package using pip

pip install good-gpt

or if you have multiple python installations:

pip3 install good-gpt

This will install the package, but you may not yet have the gg command available in your terminal at this point.

For that, you need to add the installation location to your PATH environment variable. The installation location by default is %APPDATA%\Python\Python3XX\Scripts\Lib\site-packages\good_gpt on Windows and $HOME/.local/lib/python3.XX/site-packages/good_gpt/ on linux.

If PATH is not correctly set, you need to run the post_install.py script to add the installation location to your PATH.

For that, find the location of the post_install.py script using the following command:

pip show good-gpt

and then navigate to the folder pointed by the Location field, and then navigate to the good_gpt folder, where you will find the post_install.py script.

Then run the script using the following command:

python post_install.py

or if you have multiple python installations:

python3 post_install.py

With the directory added to your PATH, you now simply need to restart your terminal to use the gg command. You can also run the following command to refresh the PATH environment variable, depending on your terminal:

source ~/.bashrc

or

source ~/.zshrc

Windows does not require a refresh, but you may need to close and reopen the terminal.

Usage

On the first run, you will be asked to provide your OpenAI API key. You can get the API key by signing up at openai.com and generating an API key at openai.com/account/api-keys.

Simply paste the API key when prompted and press enter. The API key will be stored in openai_api_key.env in the same folder as the gg command.

Here is an example on Windows 10:

C:\Users\user> gg current external ip address, only ipv4
Do you want to execute this suggested command for win32? [y/n]
--> curl ifconfig.me/ip -4
<Enter>
72.88.25.127

Here is an example on Ubuntu 20.04:

user@ubuntu:~$ gg current external ip address, only ipv4
Do you want to execute this suggested command for linux? [y/n]
--> dig +short myip.opendns.com @resolver1.opendns.com -4
yes
72.88.25.127

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

good-gpt-0.1.1.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

good_gpt-0.1.1-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page