AI - a commandline LLM chat client in BASH with conversation/completion and image generation support
-
Supports any OpenAI-compatible API endpoint, both local and remote e.g. OpenAI, Gemini, LM Studio, Ollama, and more
-
Interactive chat sessions
-
Multiline input
-
Image generation support: (currently limited to DALL·E 2)
-
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)
-
Single turn Q&A with optional follow-up conversation
-
Data piping support (sending file contents to the LLM)
-
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
-
-
Multiple chat models support:
- switch to a different model mid-conversation
- can freely combine local (open source) and remote (closed) models
- a single tool to query any model served through an OpenAI-compatible API endpoint
ai -m
ai [-m <modelname>]
ai [-m <modelname>] "how many planets are there in the solar system?"
ai -i [num] "a cute cat"
cat file.txt | ai [-m <modelname>] can you summarize the contents of this file?
ai -l
ai -c
ai -c <conversation_id>
ai -d <conversation_id>
ai -d <conversation_id_start>-<conversation_id_end>
rm "$HOME/.config/ai-bash/conversations.json"
-
Install jq, curl, imagemagick, catimg
- for e.g. Ubuntu:
apt -y install jq curl imagemagick catimg
- for e.g. Ubuntu:
-
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/master/ai" > /usr/bin/ai && chmod 0755 /usr/bin/ai