CMDGPT is an open-source command-line tool that leverages Large Language Models (LLM) to execute various commands seamlessly. It's designed for developers, system administrators, or anyone who loves working from the command line. This project is currently compatible only with Mac and requires iTerm2.
- Automatic command-line parsing and execution using agent with MAPE loop
- Detailed logging for debugging or understanding the underlying processes
- iTerm2 integration for a smooth experience
- macOS
- Python 3.9
- iTerm2
- OpenAI API (GPT-3.5 or GPT-4)
Before running the project, you must configure the OpenAI API key. The system currently defaults to GPT-3.5, but you can also use GPT-4.
- Locate the
config/key.yaml
file in the project directory. - Set the
OPENAI_API_KEY
value to your OpenAI API key.
Example:
OPENAI_API_KEY: "your-openai-api-key-here"
Before proceeding with the installation, ensure you have iTerm2 installed on your system.
First, clone the repository and navigate to the project directory.
You can install the required dependencies by running:
pip install -r requirements.txt
You can also install the package using one of the following commands:
For development:
python setup.py develop
For standard installation:
python setup.py install
You can run commands using the following syntax:
python run.py "your prompt"
python run.py "create a file called hello_world.txt"
or
python run.py "install docker in a Ubuntu 18.04 server with IP 192.168.0.42 with ssh username ubuntu, and run an nginx container at port 80"
If you want to see the full internal logging of the template, etc., you can do:
python run.py "your prompt" --logger_level="DEBUG"
When running the commands, please ensure you have an iTerm2 window opened.
Contributions are welcome! Feel free to fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE
file for details.
For any questions or issues, please open an issue on GitHub or contact the maintainers directly.
Happy Commanding!