You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ChatGPT CLI is a command-line interface for interacting with the ChatGPT API, built with Java, Spring Boot, and Spring Shell. It is a simple and easy-to-use tool that allows users to send messages and receive AI-generated responses.
3
+
4
+
## Features
5
+
- Customizable terminal prompt
6
+
- Spring Shell-based application for an enhanced command-line experience
7
+
8
+
## Prerequisites
9
+
10
+
- Java 17
11
+
- Maven (Optional)
12
+
13
+
## Configuration
14
+
Before running the application, make sure to set the required configuration values:
15
+
16
+
-`openai.api-key`: Set this to your OpenAI API key.
17
+
-`chat.gpt.model`: Set this to the desired GPT model (e.g., `gpt_3_5_turbo`).
18
+
19
+
You can set these values in the `application.properties` file or as environment variables.
Native builds offer faster startup times, lower memory footprint, and easier distribution. To create a native build, install GraalVM and use it as your JDK. Then, run the following command:
43
+
44
+
```bash
45
+
./mvnw clean -Pnative native:compile
46
+
```
47
+
48
+
This will produce a standalone executable optimized for your platform.
49
+
Once compiled, you can run the native executable:
50
+
51
+
```bash
52
+
./target/chat-gpt-cli
53
+
```
54
+
55
+
## Usage
56
+
After starting the application, you will see a terminal prompt:
57
+
58
+
```bash
59
+
:>
60
+
```
61
+
62
+
Enter your message and press Enter to send it to the ChatGPT API. The AI-generated response will be displayed in the terminal. To exit the application, type exit and press Enter.
63
+
64
+
```bash
65
+
:> chat tell me a joke.
66
+
```
67
+
68
+
## License
69
+
This project is licensed under the MIT License. See the [LICENCE](LICENCE.md) file for details.
70
+
71
+
## Contributing
72
+
Feel free to submit issues and enhancement requests on the GitHub issue tracker.
0 commit comments