GPT-CLI
GPT-CLI is an interactive CLI for communicating with GPT models, with over 30 stars on GitHub.
Loading...
See a short demo below!
Features
- Simple and intuitive command-line interface
- Supports Markdown with syntax-highlighting for code
- Work with all OpenAI GPT models
- Customize system message
- Supports clipboard operations
- Play sounds on response
- Model switching on the fly
- Chat commands to manage the chat and settings
- Save and Restore chat conversations
Installation
- Clone the repository:
git clone https://github.com/piercecohen1/GPT-CLI.git
cd GPT-CLI
- Create a virtual environment and activate it (optional):
python3 -m venv gpt-venv
source gpt-venv/bin/activate # On Windows: gpt-venv\Scripts\activate
- Install the required dependencies:
pip3 install -r requirements.txt
- Add your OpenAI API key as an environment variable (replace your_api_key with your actual API key):
For Zsh:
echo "export OPENAI_API_KEY=your_api_key" >> ~/.zshrc
source ~/.zshrc
For Bash:
echo "export OPENAI_API_KEY=your_api_key" >> ~/.bashrc
source ~/.bashrc
Or, to set temporarily:
export OPENAI_API_KEY=your_api_key # On Windows: set OPENAI_API_KEY=your_api_key
Alternatively, you can uncomment and replace the "YOUR_API_KEY" placeholder in the code with your actual API key.
Usage
Run the chat application:
python3 chat.py
Enter your message and press enter to send it. The AI model will respond accordingly. To use the available commands, type a /
followed by the command.
Available commands:
/paste Paste clipboard content
/copy Copy the last response to the clipboard
/new Start a new chat
/clear Clear terminal window
/system [SYSTEM PROMPT] Start a new chat with a custom system message
/model [MODEL] Start a new chat with the specified model
/quit Exit the program
/info Display info about the current chat session
/save [FILENAME] Save the chat to a file
/load [FILENAME] Load a chat from a file
/help Display this help message
Examples
Customize system messages to "jailbreak" models
Paste easily from the command-line
Quickly copy responses
License
This project is released under the MIT License.