|
| 1 | +# MASTERMIND modular extension |
| 2 | +# terminAI |
| 3 | + |
| 4 | +TerminAI is an innovative Python application that merges the power of OpenAI's GPT models with the versatility of the command-line interface, enabling users to interact with advanced AI directly from their terminal and execute shell commands within the same context. |
| 5 | + |
| 6 | +## Features |
| 7 | + |
| 8 | +- **AI Integration**: Engage with OpenAI's GPT models for dynamic conversations. |
| 9 | +- **Command Execution**: Seamlessly execute shell commands by prefixing with `cmd:`. |
| 10 | +- **Secure API Key Management**: Automates the secure storage of your OpenAI API key for repeated use. |
| 11 | + |
| 12 | +## Getting Started |
| 13 | + |
| 14 | +### Prerequisites |
| 15 | + |
| 16 | +- Python 3.x |
| 17 | +- An active internet connection |
| 18 | +- An OpenAI API key (obtainable from [OpenAI](https://platform.openai.com/account/api-keys)) |
| 19 | + |
| 20 | +### Installation |
| 21 | + |
| 22 | +1. Clone the repository or download `TerminAI.py` directly to your local machine. |
| 23 | +2. Install the required Python libraries: |
| 24 | + |
| 25 | + ```bash |
| 26 | + pip install requests |
| 27 | + ``` |
| 28 | + |
| 29 | + > Note: `curses` is included in the standard library for Unix-based systems. Windows users might need `windows-curses`, installable via pip. |
| 30 | +
|
| 31 | +### Configuration |
| 32 | + |
| 33 | +On the first run, you will be prompted to enter your OpenAI API key. This key will be stored locally in a `.env` file for future use, ensuring your sessions remain seamless. |
| 34 | + |
| 35 | +### Running TerminAI |
| 36 | + |
| 37 | +Navigate to the directory containing `TerminAI.py` and execute: |
| 38 | + |
| 39 | +```bash |
| 40 | +python3 TerminAI.py |
| 41 | +``` |
| 42 | + |
| 43 | +Follow the on-screen prompts to start interacting with the AI or execute commands. |
| 44 | + |
| 45 | +## Usage |
| 46 | + |
| 47 | +- **AI Interaction**: Simply type your query and press Enter to receive a response from the AI. |
| 48 | +- **Executing Commands**: Type `cmd:` followed by your command to execute it within the terminal. |
| 49 | +- **Exiting**: Type `exit` to terminate the session. |
| 50 | + |
| 51 | +## Security |
| 52 | + |
| 53 | +- The `.env` file containing your OpenAI API key is stored locally. Ensure it is securely managed and not exposed to unauthorized parties. |
| 54 | +- Exercise caution when executing shell commands, especially those suggested by AI or from untrusted sources, to mitigate potential security risks. |
| 55 | + |
| 56 | +## Troubleshooting |
| 57 | + |
| 58 | +If you encounter issues, particularly with the curses interface, consider trying a different terminal emulator or adjusting your terminal settings. For connectivity issues, verify your internet connection and firewall settings. |
| 59 | + |
| 60 | +## Contributing |
| 61 | + |
| 62 | +Contributions are welcome! Feel free to fork the repository, make your changes, and submit a pull request. |
| 63 | + |
| 64 | +## License |
| 65 | + |
| 66 | +[GPLv3](LICENSE) |
| 67 | + |
| 68 | +## Acknowledgments |
| 69 | + |
| 70 | +- OpenAI for providing the GPT models and API. |
| 71 | +- The Python community for the invaluable libraries and resources. |
0 commit comments