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: 3 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)
- Host: GitHub
- URL: https://github.com/nitefood/ai-bash-gpt
- Owner: nitefood
- Created: 2023-03-13T00:31:40.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-12T21:36:41.000Z (over 1 year ago)
- Last Synced: 2024-07-31T20:28:38.873Z (5 months ago)
- Topics: ai, bash, chatbot, chatgpt, chatgpt-4, chatgpt-api, commandline, completions, conversational-ai, dalle2, image-generation, shell, terminal
- Language: Shell
- Homepage:
- Size: 25.4 KB
- Stars: 43
- Watchers: 5
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-cli-apps - AI - A command-line ChatGPT client in BASH with conversation/completion support. (<a name="ai"></a>AI / ChatGPT)
- awesome-cli-apps-in-a-csv - AI - A command-line ChatGPT client in BASH with conversation/completion support. (<a name="ai"></a>AI / ChatGPT)
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
```