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:
- 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
pipandnpm. - 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:
-
Clone the Repository:
git clone https://github.com/BSchoolland/gptautocli cd gptautocli
-
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.
- For Linux:
-
Set up a Virtual Environment (optional but recommended):
python3 -m venv venv source venv/bin/activate
-
Install the Required Packages:
pip install -r requirements.txt
-
Install the project in editable mode:
pip install --editable .
-
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gptautocli-0.1.2.5.tar.gz.
File metadata
- Download URL: gptautocli-0.1.2.5.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bae43b5c5251a577a4ca850539d0809392bf3284d4820f5cb2783ee39bfcfabd
|
|
| MD5 |
ca437dd989fa73f3682cb5b14f511ba5
|
|
| BLAKE2b-256 |
f888dc356ac82b789049d9b9b8d076a18da9db896628fdcbf3a0bd1ff6658bb8
|
File details
Details for the file gptautocli-0.1.2.5-py3-none-any.whl.
File metadata
- Download URL: gptautocli-0.1.2.5-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1eb2547e45a6204b06eef1350f8e70012b73967117b63eebc5f3823e951529aa
|
|
| MD5 |
e0b6a3d8773a8f9075e797960b0a7f42
|
|
| BLAKE2b-256 |
a56225bcd493b9638b95b0519862054a7b263018e6961c3cb66f8ba3e9699d29
|