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 .
    
  6. How I upload to PyPI:

    python setup.py sdist bdist_wheel
    twine upload dist/*
    

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.3.tar.gz (18.5 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.3-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gptautocli-0.1.2.3.tar.gz
  • Upload date:
  • Size: 18.5 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.3.tar.gz
Algorithm Hash digest
SHA256 c783b1f16064a9ac277be37589007cb7f053cff54ba30f8718c9650da23701bf
MD5 b43729bb95f0c7e3f0556bf1d616e575
BLAKE2b-256 9ae54701d75604a6ba186f1faf41537c7794c8da59904dc67a1fab32fc5ee57f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gptautocli-0.1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 20.0 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 99cd2cc2127aab87212490c240a4d4afca76dcd47c011511cf56f48596be3d50
MD5 89e1d08ded7f74ce6c1ad300391e793b
BLAKE2b-256 47d4dd5e59200486b59699869b4b23d142a2914b119a1765eeffe09ce3c6093e

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