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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file good-gpt-0.1.1.tar.gz.

File metadata

  • Download URL: good-gpt-0.1.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.4

File hashes

Hashes for good-gpt-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7fd0c10159972c2a468f6fac6d3cab0e0d606c696386438c962b5dd9010c3520
MD5 88614fd4e2719f18e6e6cae6260579f3
BLAKE2b-256 671352ad03e1d93f126787f46e4403167d345509f8f2d58623a206d794f020e6

See more details on using hashes here.

File details

Details for the file good_gpt-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: good_gpt-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.4

File hashes

Hashes for good_gpt-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2edbf6dc660c38d3734469f56c539547947ddcc16fc2855c28ecb4476b319644
MD5 2b0de914b306171ef6d29d30e46dcebf
BLAKE2b-256 57fbb1b3a74fd871f5f2237016b45f28e3b44dfe478a94b299e51180865f3943

See more details on using hashes here.

Supported by

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