Home

Awesome

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

Features:

Full command line options (ai -h):

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 <conversation_id>

Delete a specific conversation:

ai -d <conversation_id>

Delete selected conversations:

ai -d <conversation_id_start>-<conversation_id_end>

Delete all conversations:

rm "$HOME/conversations.json"

Usage examples:

(Interaction and conversation resuming)

asciicast

(Image generation)

asciicast

(Input piping to stdin)

asciicast

Installation:

Prerequisites:
Script download:

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

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