Skip to main content

OpenAI CLI Interface

Project description

OpenAclI

Wanted a tool to use OpenAI on the command line. Also supports showing images.

Installation

> pip install openacli

Usage

You'll need an OpenAI API key to use this library.

Chat

> oacli
me> "<prompt with quotes>"
ai> <some response>

Image

> oacli -i "<some prompt with quotes>"

Python Pillow will bring up and image

Prompt

> oacli "<some prompt with quotes>"
<response from OpenAI>

Settings

Several configuration settings are exposed through environment variables. If they aren't provided, the defaults below will be applied.

# OpenAI Settings
OPENAI_DEFAULT_ENGINE="text-davinci-003"
OPENAI_DEFAULT_TEMPERATURE=.5
OPENAI_DEFAULT_FREQUENCY_PENALTY=0
OPENAI_DEFAULT_PRESENCE_PENALTY=0
OPENAI_DEFAULT_MAX_TOKENS=2048
OPENAI_DEFAULT_IMAGE_NUMBER=1
OPENAI_DEFAULT_IMAGE_SIZE="1024x1024"

# OAclI Settings
OACLI_INPUT_COLOR=Green
OACLI_OUTPUT_COLOR=Red

Examples

Chat

image

Image

image

Prompt

image

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openacli-0.2.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

openacli-0.2-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page