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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file openacli-0.2.tar.gz.

File metadata

  • Download URL: openacli-0.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for openacli-0.2.tar.gz
Algorithm Hash digest
SHA256 8a0dc7422f6e9364e0177e951d8f93c825ea767e54004288389d04ba980e0bcd
MD5 7ef2f5c469228239cd4b11dc20d8aa11
BLAKE2b-256 081e43bb1c87f267cc3f3e1e11e962d4632229a3ae934b40265b4a276f214b71

See more details on using hashes here.

File details

Details for the file openacli-0.2-py3-none-any.whl.

File metadata

  • Download URL: openacli-0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for openacli-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 12a6eb70629b82ca0bda7d03ee626c8f0507fd6d6209f99fd7f3088ad465770c
MD5 99cdeeb006790d4aa3f9a4d528f69f94
BLAKE2b-256 1fe241706aeac6fabf9a3305f1a890f0f6c7cced80846c61858f0639a073b822

See more details on using hashes here.

Supported by

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