Skip to main content

Provides a conversational interface to the terminal, allowing you to run commands and perform tasks using natural language.

Project description

gptautocli

This is the repository for the GPT Auto CLI project, a python package that provides a conversational interface to the terminal, allowing you to run commands and perform tasks using natural language.

DISCLAIMER

Despite its safety features, it is entirely possible that this package could cause harm to your system. AI models are not perfect and can make mistakes, and this project GIVES AN AI MODEL THE ABILITY TO RUN ANY COMMAND ON YOUR SYSTEM which can be dangerous. I am not responsible for any damage that may be caused by this project.

Installation

Warning: This package relies on the OpenAI API, which is a paid service. You will need an API key and will be charged a small amount for usage.

This package is available on PyPI, so you can install it using pip, assuming you have Python installed on your system. If you don't have Python installed, you can download it from python.org.

To install the package, run the following command:

  1. Install the package:
    pip install gptautocli
    

First Run

When you first run gptautocli, you'll be prompted for an OpenAI API key:

  • Create an account at OpenAI.
  • Navigate to Dashboard > API keys and generate a new key.
  • Paste the key into the prompt.

Usage

To start the terminal assistant, simply run the following command:

gptautocli

You can then ask the assistant to perform any task you like, and it will respond with the appropriate command or set of commands to accomplish that task, whether it's creating a file, installing a package, or creating a Next.js project with 17 API routes and a database inside a Dockerized CI/CD Pipeline (okay maybe it can't do that last one but it would try).

Capabilities

The terminal assistant is a powerful tool that can perform a variety of tasks, essentially capable of anything that can be done in the terminal. Here is a small subset of its capabilities:

  • File Management: Create, delete, and modify files and directories.
  • System Information: Get information about the system, such as the operating system and hardware.
  • Write and Run Code: Write and run code in multiple languages, including Python, Java, and C++.
  • Install Packages: Install packages needed for development, such as pip and npm.
  • Fix Mistakes: It is able to see command output and fix its own mistakes.
  • And Much More: The assistant is capable of many other tasks, and can be easily extended to perform even more.

Limitations

The assistant is not perfect, and there are some limitations to its capabilities. Here are a few of the limitations:

  • Limited access to up-to-date information: The assistant may not have access to the most up-to-date information, as it is not connected to the internet.
  • Limited Ability to interact with commands that require user input: The assistant is not yet able to interact with commands that require user input,
  • Prone to Mistakes: Since the assistant is powered by OpenAI, it can sometimes make mistakes in its responses. et.

Safety Features

When you first set up this package, you'll be prompted to set a default risk tolerance level from 0 to 6. Any command deemed by a secondary agent to be above this risk tolerance level will require user confirmation before being run. If you wish to read every command before it is run, you can set the risk tolerance level to 0. Setting a higher value will allow the assistant to run more commands without user confirmation. I've also found that OpenAI's models are naturally quite cautious with the commands they generate, and will refuse to run dangerous commands even if explicitly asked to do so.

How risk tolerance works

All commands are sent to gpt-4o-mini, a cheap but capable model, where it classifies the command without context to avoid bias. The model classifies commands based on the following scale:

1 - Read Only: Commands that simply read data without modifying anything at all Example: ls -l - Lists files in a directory, changing nothing

2 - Safe: Commands that can write data but can not do any accidental damage Example: touch myfile.txt - creates a file if it does not exist, but will not overwrite existing files

3 - Low Risk: Commands that alter files or locations, risky as it causes a change to the system. Example: echo "text" >> myfile.txt - adds some data to the file

4 - High Risk: Commands that can modify data or cause other problems, leading to some data loss or serious inconvenience if used wrongly. Example: rm myfile.txt - Deletes a file, leading to data loss if the wrong file is targeted

5 - Critical Risk (Accident-Prone): Commands that can cause severe damage or data loss if accidentally misused, often with no recovery option. Example: rm -rf /Projects - Deletes all files in a likely important directory, leading to data loss

Contributing

If you're interested in this project and would like to contribute, feel free to fork the repository and submit a pull request.

Installation For Development

If you just want to use the tool, please see the Installation section. If you want to contribute to the project, follow these steps:

To set up the project in a development environment, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/BSchoolland/gptautocli
    cd gptautocli
    
  2. Install Python (if not already installed):

    • For Linux:
      sudo apt-get install python3 python3-pip
      
    • For Mac:
      brew install python3
      
    • For Windows: Download and install Python from python.org.
  3. Set up a Virtual Environment (optional but recommended):

    python3 -m venv venv
    source venv/bin/activate
    
  4. Install the Required Packages:

    pip install -r requirements.txt
    
  5. Install the project in editable mode:

    pip install --editable .
    

From here, you can run the package as if you had installed it from pip normally, except that any changes you make to the code will be reflected in the package.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

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

gptautocli-0.1.2.2.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

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

gptautocli-0.1.2.2-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file gptautocli-0.1.2.2.tar.gz.

File metadata

  • Download URL: gptautocli-0.1.2.2.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for gptautocli-0.1.2.2.tar.gz
Algorithm Hash digest
SHA256 6c061013b8084f26fd2663e0aa4553afe6c317a7eb347986c4ba2f9f1c5ac9b3
MD5 861be86efbe77118373b300a7f4789b9
BLAKE2b-256 55ab4c50df9fec84ac0219f2d5a03f8fe6ebf3f4a00cfd7900b7b7c26848616e

See more details on using hashes here.

File details

Details for the file gptautocli-0.1.2.2-py3-none-any.whl.

File metadata

  • Download URL: gptautocli-0.1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for gptautocli-0.1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7aa9ad209bdb7e5b2719478f4f7dd2b22c97f5fef480846dbcbe035e7209867d
MD5 49e7063acf4f4f1c1b7db4015c3e621d
BLAKE2b-256 cfed4e743f690297180856630e77d8427949bdf9400e99904cc8f1299b3c9622

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