https://github.com/nuzair46/ask_gpt_cli
A ruby gem to ask OpenAI GPT API with context and history from command line
https://github.com/nuzair46/ask_gpt_cli
chatgpt cli ruby ruby-gem rubygem
Last synced: 11 months ago
JSON representation
A ruby gem to ask OpenAI GPT API with context and history from command line
- Host: GitHub
- URL: https://github.com/nuzair46/ask_gpt_cli
- Owner: Nuzair46
- License: mit
- Created: 2023-04-14T20:03:21.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-14T20:31:11.000Z (about 3 years ago)
- Last Synced: 2025-07-21T07:31:04.936Z (11 months ago)
- Topics: chatgpt, cli, ruby, ruby-gem, rubygem
- Language: Ruby
- Homepage: https://rubygems.org/gems/ask_gpt_cli
- Size: 5.86 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ask GPT CLI
[](https://badge.fury.io/rb/ask_gpt_cli)
The `ask_gpt_cli` is a Ruby gem that allows you to interact with the OpenAI GPT language model through the terminal with context.
## Installation
To use this gem, you need to have Ruby installed on your computer. You can install it using a package manager or follow the instructions on the [official Ruby website](https://www.ruby-lang.org/en/documentation/installation/).
After installing Ruby, you can install the `ask_gpt_cli` gem by running the following command:
```bash
gem install ask_gpt_cli
```
To use the `ask_gpt_cli` gem, you need to set the `OPENAI_API_KEY` environment variable to your OpenAI API key. You can find your API key from [OpenAI](https://platform.openai.com/account/api-keys).
Set the `OPENAI_API_KEY` environment variable by running the following command:
```bash
export OPENAI_API_KEY=
```
## Usage
To use the `ask_gpt_cli` gem, run the following command:
```bash
ask_gpt_cli
```
The CLI will start, and you can ask GPT any question by typing it in the terminal. GPT will respond with an answer to your question.
## Options
You can customize the behavior of the `ask_gpt_cli` gem by setting the following environment variables:
- `ASK_GPT_MODEL`: The GPT model to use. Default is `gpt-3.5-turbo`.
- You can use `gpt-4` if you have access to the GPT-4 model.
You can set the environment variables by running the following command:
```bash
export ASK_GPT_MODEL=
```