ChatGPT is a command-line interface for interacting with OpenAI chat language models. It allows you to chat with an AI assistant powered by the GPT-3.5 Turbo model, designed to help you with programming tasks.
You can install ChatGPT from PyPI using pip:
pip install chatgpt
To use ChatGPT, you need to have an OpenAI API key. If you don't have one, you can sign up for one here.
Once you have your API key, you can set it as an environment variable:
export OPENAI_API_KEY=your_api_key_here
Or you can enter it when prompted by ChatGPT.
To start a chat session with the AI assistant, run the following command:
chatgpt
You can also pass filepaths or globlike strings as arguments to ChatGPT, which will be included in the snapshot of your workspace that is sent to the AI assistant. For example:
chatgpt myfile.py myfolder/*.txt
By default, ChatGPT will show the filenames and contents of the files that are included in the snapshot. If you only want to see the filenames, you can use the --filenames-only
flag:
chatgpt --filenames-only myfile.py myfolder/*.txt
You can also choose to only show the contents of the files that are included in the snapshot using the --content
flag:
chatgpt --content myfile.py myfolder/*.txt
During the chat session, you can type "quit" to exit the program. You can also type "show" to see a list of all the messages that have been sent during the chat session.
To install the development dependencies, run:
pip install -r requirements-dev.txt
You can run the tests using:
pytest
This project is licensed under the MIT License. See the LICENSE file for details.