Home

Awesome

ruvbot - Devops using OpenAi ChatGPT Model

This script is a command-line tool that utilizes OpenAI's GPT-3.5 Turbo to generate shell commands based on user input. The script also features a loading animation and provides summaries of command outputs.

More details

This script serves as a valuable tool for server administrators and DevOps professionals who want to simplify their daily tasks and improve their workflow. By leveraging the OpenAI API and ChatGPT model, the script generates shell command suggestions based on user input, allowing users to perform a wide range of operations with ease.

The key advantage of using this script is its ability to understand natural language input and translate it into relevant shell commands. This not only saves time but also reduces the likelihood of human error when performing complex tasks. Moreover, the script provides multiple command options, empowering users to make informed decisions while executing their tasks.

Here's a breakdown of the script:

Install & Usage Instructions:

This script was made for linux or the linux subsystem on windows.

Update the OpenAI API Key: Replace <OpenAi_API_Key> in the get_response() function with your actual OpenAI API key. There are two instances where you need to replace this placeholder. The lines are:

-H 'Authorization: <OpenAi_API_Key>' \

Replace <OpenAi_API_Key> with your API key, like this:

-H 'Authorization: Bearer sk-yourapikeyhere' \

Save the updated script and make it executable. In the terminal, navigate to the directory containing the script and run:

chmod +x script_name.sh

Replace script_name.sh with the actual name of the script.

Run the script with user input:

./script_name.sh [OPTIONS] <user_input>

Replace script_name.sh with the actual name of the script and <user_input> with your desired input.

Available options:

-h or --help: Show the help message and exit.

For example, to run the script with the user input "create a new directory called test", you would execute the following command:

Sample Script Usage

./script_name.sh create a new directory called test

The script will then provide you with two shell command options generated by the GPT-3.5 Turbo model, based on your input. Choose one of the options or cancel the operation. If you proceed, the script will execute the chosen command and provide you with a summary of the command output.

Networking:

./script_name.sh check the IP address of my local machine

The script will provide shell command options to retrieve the IP address of your local machine.

NPM:

./script_name.sh install the express package globally

The script will provide shell command options to install the Express package globally using npm.

Application deployments:

./script_name.sh create a tarball of a directory called my_project

The script will provide shell command options to create a tarball (compressed archive) of a directory named my_project.