Skip to main content

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.

Metadata

Release files for gptautocli 0.1.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gptautocli 0.1.2.5
File Size Uploaded
gptautocli-0.1.2.5.tar.gz 18.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gptautocli 0.1.2.5
File Interpreter ABI Platform
gptautocli-0.1.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 38.7 kB

Release files / gptautocli-0.1.2.5.tar.gz

Download URL gptautocli-0.1.2.5.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bae43b5c5251a577a4ca850539d0809392bf3284d4820f5cb2783ee39bfcfabd
BLAKE2b-256 checksum
How to use checksums
f888dc356ac82b789049d9b9b8d076a18da9db896628fdcbf3a0bd1ff6658bb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / gptautocli-0.1.2.5-py3-none-any.whl

Download URL gptautocli-0.1.2.5-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1eb2547e45a6204b06eef1350f8e70012b73967117b63eebc5f3823e951529aa
BLAKE2b-256 checksum
How to use checksums
a56225bcd493b9638b95b0519862054a7b263018e6961c3cb66f8ba3e9699d29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.2.5 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page