Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yashsaini99/chat-gpt-go
A simple command-line interface (CLI) application that interacts with OpenAI's GPT-3 using Go. This tool allows you to have a conversation with GPT-3 directly from your terminal.
https://github.com/yashsaini99/chat-gpt-go
cobra-cli go-gpt golang
Last synced: 12 days ago
JSON representation
A simple command-line interface (CLI) application that interacts with OpenAI's GPT-3 using Go. This tool allows you to have a conversation with GPT-3 directly from your terminal.
- Host: GitHub
- URL: https://github.com/yashsaini99/chat-gpt-go
- Owner: YashSaini99
- License: mit
- Created: 2024-08-24T13:37:10.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-25T05:56:13.000Z (3 months ago)
- Last Synced: 2024-09-05T21:55:41.884Z (2 months ago)
- Topics: cobra-cli, go-gpt, golang
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CLI ChatGPT Application
A simple command-line interface (CLI) application that interacts with OpenAI's GPT-3 using Go. This tool allows you to have a conversation with GPT-3 directly from your terminal.
## Features
- **Interactive CLI:** Engage in a conversation with GPT-3 directly from the terminal.
- **Customizable:** Easily configure the API key via a `.env` file.## Prerequisites
- Go 1.16 or later
- [OpenAI API Key](https://platform.openai.com/signup) (for accessing GPT-3)## Installation
1. **Clone the repository:**
```sh
git clone https://github.com/your-username/Chat-Gpt-GO.git
cd Chat-Gpt-GO
```2. **Install dependencies:**
Make sure you have `viper`, `go-gpt3` and `cobra` packages installed. Run:
```sh
go mod tidy
```3. **Create a `.env` file:**
In the root of the project, create a `.env` file with the following content:
```env
API_KEY=your_openai_api_key_here
```## Usage
1. **Run the application:**
```sh
go run main.go
```2. **Interact with GPT-3:**
- Type your message and press Enter.
- Type `quit` to exit the application.Example:
```
Say Something ('quit' to exit): Hello, how are you?
```
- **Dependencies**:
- `github.com/PullRequestInc/go-gpt3`: Go client for OpenAI's GPT-3.
- `github.com/spf13/cobra`: Command-line argument parsing.
- `github.com/spf13/viper`: Configuration management.## License
This project is licensed under the MIT License - see the [LICENSE](https://github.com/YashSaini99/Chat-Gpt-GO/blob/main/LICENSE) file for details.