An open API service indexing awesome lists of open source software.

https://github.com/alanfriedman/chatgpt

Minimal command-line interface for ChatGPT Completions API
https://github.com/alanfriedman/chatgpt

chatgpt chatgpt-api openai

Last synced: 2 months ago
JSON representation

Minimal command-line interface for ChatGPT Completions API

Awesome Lists containing this project

README

        

# Minimal ChatGPT Completions CLI

## Setup

1. Generate an [OpenAI API key](https://beta.openai.com/account/api-keys) and write it to a file in the root directory named `openai_api_key`
2. Install the `openai` Python package, following instructions [here](https://beta.openai.com/docs/libraries/python-bindings)

## Usage

Run `./main.py -h` for a list of options. If a prompt isn't provided using `--prompt PROMPT`, you can enter one interactively.

Responses and some metadata are also logged to `chatgpt.log`.

## Compatibility

Tested on Python 3.10.9.