Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 1.75 KB

README.md

File metadata and controls

40 lines (32 loc) · 1.75 KB

ChatGPT on CLI using Java

image image

Overview

A simple Java program to chat with ChatGPT from the CLI using the ChatGPT API Free project.

Requirements

To run the program, the following should be first installed:

Tools

Get an OpenAI API Key

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.

How to Use

  1. Install the requirements specified above.
  2. Obtain an OpenAI API Key from here.
  3. Clone or download this repository.
  4. Open this project in IntelliJ IDEA Ultimate.
  5. 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.

Future Implementations

  • Implement Picocli

References