A simple Java program to chat with ChatGPT from the CLI using the ChatGPT API Free project.
To run the program, the following should be first installed:
To get an OpenAI API Key, you need to first sign up for an OpenAI account. You can sign up here.
Once you have an OpenAI account, you can create an OpenAI API Key here.
- Install the requirements specified above.
- Obtain an OpenAI API Key from here.
- Clone or download this repository.
- Open this project in IntelliJ IDEA Ultimate.
- Create a new file called
.env
. Enter the line below in the.env
file:
OPENAI_API_KEY = YOUR_API_KEY
and replace YOUR_API_KEY
with your own OpenAI API Key.
6. Run the program.
7. Enter the query when asked, and wait for a reply.
8. You can enter another query, or you can enter /e
to exit the program.
- Implement Picocli