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)
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
ai -h
):-4
optional parameter switches to GPT-4 model.ai [-4]
ai [-4] "how many planets are there in the solar system?"
ai -i [num] "a cute cat"
cat file.txt | ai [-4] can you summarize the contents of this file?
ai -l
ai [-4] -c
ai [-4] -c <conversation_id>
ai -d <conversation_id>
ai -d <conversation_id_start>-<conversation_id_end>
rm "$HOME/conversations.json"
Install jq, curl, imagemagick, catimg
apt -y install jq curl imagemagick catimg
Install glow for Markdown rendering support in your terminal
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