Skip to content

breadmyburn/java-cli-chatgpt-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A Java CLI program connected to ChatGPT

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages