Ecosyste.ms: Awesome

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

https://github.com/nitefood/ai-bash-gpt

AI - a commandline ChatGPT (3.5/4) client featuring multiple conversations support, automatic topic identification, image generation and stdin piping (sending files to ChatGPT for inspection)
https://github.com/nitefood/ai-bash-gpt

ai bash chatbot chatgpt chatgpt-4 chatgpt-api commandline completions conversational-ai dalle2 image-generation shell terminal

Last synced: about 2 months ago
JSON representation

AI - a commandline ChatGPT (3.5/4) client featuring multiple conversations support, automatic topic identification, image generation and stdin piping (sending files to ChatGPT for inspection)

Lists

README

        

# AI - a commandline ChatGPT (3.5/4) client in BASH with conversation/completion and image generation support

## Features:

* **Interactive chat sessions** with OpenAI `gpt-3.5-turbo` and `gpt-4` completion API endpoint models (aka ChatGPT/ChatGPT4) -- *note: ChatGPT4 currently requires an API key from a paid OpenAI plan to work*

* **Multiline input**

* **Image generation support:**

* image preview grid rendered directly in the terminal

* generate up to 10 images at a time

* automatic URL shortening

* optionally save images and prompt to local disk

* **Markdown support for replies** (requires [glow](https://github.com/charmbracelet/glow#installation))

* **One shot Q&A** with optional follow-up conversation

* **Data piping support** (sending file contents to ChatGPT)

* **Full conversation support**:

* locally store unlimited conversations (in JSON format)

* quick resume last conversation

* delete/resume any stored conversation

* conversation messages replay on resume

* store current and start new conversation (reset history) during interactive sessions

* Automatic conversation topic identification and update

## Full command line options (`ai -h`):

* *Note: the `-4` optional parameter switches to GPT-4 model.*

###### Start a new interactive conversation:

`ai [-4]`

###### One shot Q&A (will ask you to continue interacting, otherwise quit after answer):

`ai [-4] "how many planets are there in the solar system?"`

###### Generate one or more images (default 1, max 10):

`ai -i [num] "a cute cat"`

###### Submit data as part of the question:

`cat file.txt | ai [-4] can you summarize the contents of this file?`

###### List saved conversations:

`ai -l`

###### Continue last conversation:

`ai [-4] -c`

###### Continue specific conversation:

`ai [-4] -c `

###### Delete a specific conversation:

`ai -d `

###### Delete selected conversations:

`ai -d -`

###### Delete all conversations:

`rm "$HOME/conversations.json"`

## Usage examples:

##### (Interaction and conversation resuming)

[![asciicast](https://asciinema.org/a/572784.svg)](https://asciinema.org/a/572784)

##### (Image generation)

[![asciicast](https://asciinema.org/a/572785.svg)](https://asciinema.org/a/572785)

##### (Input piping to stdin)

[![asciicast](https://asciinema.org/a/572786.svg)](https://asciinema.org/a/572786)

## Installation:

###### Prerequisites:

* Install jq, curl, imagemagick, catimg

* for e.g. Ubuntu: `apt -y install jq curl imagemagick catimg`

* Install [glow](https://github.com/charmbracelet/glow#installation) for Markdown rendering support in your terminal

###### Script download:

Install the script by either cloning this repository or directly downloading to your `$PATH`, e.g.:

```shell
curl "https://raw.githubusercontent.com/nitefood/ai-bash-gpt/master/ai" > /usr/bin/ai && chmod 0755 /usr/bin/ai
```