Metadata-Version: 2.1
Name: openacli
Version: 0.2
Summary: OpenAI CLI Interface
Home-page: https://github.com/cdrew3/openacli
Author: Chris Drew
Author-email: chris.drew.cd@gmail.com
License: MIT
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp (==3.8.3)
Requires-Dist: aiosignal (==1.3.1)
Requires-Dist: async-timeout (==4.0.2)
Requires-Dist: attrs (==22.2.0)
Requires-Dist: certifi (==2022.12.7)
Requires-Dist: charset-normalizer (==2.1.1)
Requires-Dist: colorama (==0.4.3)
Requires-Dist: frozenlist (==1.3.3)
Requires-Dist: getch (==1.0)
Requires-Dist: idna (==3.4)
Requires-Dist: multidict (==6.0.4)
Requires-Dist: openai (==0.26.4)
Requires-Dist: pillow (==9.4.0)
Requires-Dist: requests (==2.28.2)
Requires-Dist: smartinput (==1.0.8)
Requires-Dist: tqdm (==4.64.1)
Requires-Dist: urllib3 (==1.26.14)
Requires-Dist: yarl (==1.8.2)

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

## Installation
```bash
> pip install openacli
```

## Usage
You'll need an [OpenAI API key](https://platform.openai.com/account/api-keys) to use this library.

### Chat
```bash
> oacli
me> "<prompt with quotes>"
ai> <some response>
```

### Image
```bash
> oacli -i "<some prompt with quotes>"
```
Python Pillow will bring up and image

### Prompt
```bash
> 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](https://user-images.githubusercontent.com/10888829/216837899-63139026-4653-4f83-817a-c8d0c39ca0e6.png)

### Image
![image](https://user-images.githubusercontent.com/10888829/216837652-99a70fa4-88f0-498b-ac1b-2a3703e90353.png)

### Prompt
![image](https://user-images.githubusercontent.com/10888829/216837814-468a2097-9e4f-46b5-b661-2cb3fd2d258f.png)



