{"id":13407939,"url":"https://github.com/nitefood/ai-bash","last_synced_at":"2025-09-08T23:42:42.324Z","repository":{"id":154167635,"uuid":"613133542","full_name":"nitefood/ai-bash","owner":"nitefood","description":"AI - a simple commandline local/remote LLM chat client. Supports any local or remote OpenAI-compatible API endpoint (GPT4o, Gemini, Grok, OpenRouter, Ollama, LM Studio and more), model management, multiple conversations support, automatic topic identification, image generation using Dall-E and stdin piping (sending files to LLM for inspection)","archived":false,"fork":false,"pushed_at":"2025-08-12T01:23:11.000Z","size":96,"stargazers_count":68,"open_issues_count":1,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-12T03:25:05.840Z","etag":null,"topics":["ai","bash","chatbot","chatgpt","chatgpt-4","chatgpt-api","commandline","completions","conversational-ai","dalle2","gemini","gemini-api","gemini-pro","gpt-4","gpt-4o","grok-api","image-generation","openai-api","shell","terminal"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nitefood.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-13T00:31:40.000Z","updated_at":"2025-08-12T01:31:08.000Z","dependencies_parsed_at":"2024-01-07T21:02:08.970Z","dependency_job_id":"7f3ef6e5-2009-42b7-b6bf-b3443948b877","html_url":"https://github.com/nitefood/ai-bash","commit_stats":null,"previous_names":["nitefood/ai-bash","nitefood/ai-bash-gpt"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/nitefood/ai-bash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitefood%2Fai-bash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitefood%2Fai-bash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitefood%2Fai-bash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitefood%2Fai-bash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nitefood","download_url":"https://codeload.github.com/nitefood/ai-bash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitefood%2Fai-bash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231159,"owners_count":25245675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","bash","chatbot","chatgpt","chatgpt-4","chatgpt-api","commandline","completions","conversational-ai","dalle2","gemini","gemini-api","gemini-pro","gpt-4","gpt-4o","grok-api","image-generation","openai-api","shell","terminal"],"created_at":"2024-07-30T20:00:49.659Z","updated_at":"2025-09-08T23:42:42.316Z","avatar_url":"https://github.com/nitefood.png","language":"Shell","funding_links":[],"categories":["\u003ca name=\"ai\"\u003e\u003c/a\u003eAI / ChatGPT","Shell"],"sub_categories":[],"readme":"# AI - a commandline LLM chat client in BASH with conversation/completion and image generation support\n\n## Features:\n\n* **Supports any OpenAI-compatible API endpoint, both local and remote**\n\n  * _[OpenAI](https://platform.openai.com/docs/)_\n  * _[Gemini](https://aistudio.google.com/)_\n  * _[Grok](https://x.ai/api)_\n  * _[HuggingFace](https://huggingface.co/docs/api-inference/index)_\n  * _[OpenRouter](https://openrouter.ai/docs/quick-start)_\n  * _[LM Studio](https://lmstudio.ai/docs/api/openai-api)_\n  * _[Ollama](https://ollama.com/blog/openai-compatibility)_\n  * _and many more_\n\n* **Interactive chat sessions**\n\n* **Multiline input**\n\n* **Image generation support:** *(currently limited to DALL·E 2)*\n  \n  * _image preview grid rendered directly in the terminal_\n  * _generate up to 10 images at a time_\n  * _automatic URL shortening_\n  * _optionally save images and prompt to local disk_\n\n* **Markdown support for replies** (requires [glow](https://github.com/charmbracelet/glow#installation))\n\n* **Single turn Q\u0026A** with optional follow-up conversation\n\n* **Data piping support** (sending file contents to the LLM)\n\n* **Full conversation support**:\n  \n  * _locally store unlimited conversations (in JSON format)_\n  * _quick resume last conversation_\n  * _delete/resume any stored conversation_\n  * _conversation messages replay on resume_\n  * _store current and start new conversation (reset history) during interactive sessions_\n  * _Automatic conversation topic identification and update_\n\n* **Multiple chat models support**:\n\n  * _switch to a different model mid-conversation_\n  * _can freely combine local and remote models_\n  * _a single tool to query any model served through an OpenAI-compatible API endpoint_\n\n* **Multiple system prompt support**:\n\n  * _manage multiple system prompts to alter the base model behavior and persona_\n\n## Full command line options (`ai -h`):\n\n###### Manage models (add/delete/set default):\n\n  `ai -m`\n\n###### Manage system prompts (add/delete/set default):\n\n  `ai -s`\n\n###### Disable markdown rendering:\n\n  `ai -n`\n\n###### Start a new interactive conversation [optionally overriding the default model/system prompt]:\n\n`ai [-m \u003cmodel_name\u003e|-s \u003csysprompt_name\u003e]`\n\n###### Single turn Q\u0026A (will ask you to continue interacting, otherwise quit after answer):\n\n`ai [-m \u003cmodel_name\u003e|-s \u003csysprompt_name\u003e] \"how many planets are there in the solar system?\"`\n\n###### Generate one or more images (default 1, max 10):\n\n`ai -i [num] \"a cute cat\"`\n\n###### Submit data as part of the question:\n\n`cat file.txt | ai [-m \u003cmodel_name\u003e|-s \u003csysprompt_name\u003e] \"can you summarize the contents of this file?\"`\n\n###### List saved conversations:\n\n`ai -l`\n\n###### Continue last conversation:\n\n`ai -c`\n\n###### Continue specific conversation:\n\n`ai -c \u003cconversation_id\u003e`\n\n###### Delete a specific conversation:\n\n`ai -d \u003cconversation_id\u003e`\n\n###### Delete selected conversations:\n\n`ai -d \u003cconversation_id_start\u003e-\u003cconversation_id_end\u003e`\n\n###### Delete all conversations:\n\n`rm \"$HOME/.config/ai-bash/conversations.json\"`\n\n## Usage examples:\n\n##### (Adding a model)\n\n![image](https://github.com/user-attachments/assets/acd404d6-1766-4764-a590-bceb04bb3696)\n\n##### (Listing added models)\n\n![image](https://github.com/user-attachments/assets/feace719-0308-4e6a-8a03-f1f21d941378)\n\n##### (Interaction and conversation resuming)\n\n[![asciicast](https://asciinema.org/a/572784.svg)](https://asciinema.org/a/572784)\n\n##### (Image generation)\n\n[![asciicast](https://asciinema.org/a/572785.svg)](https://asciinema.org/a/572785)\n\n##### (Input piping to stdin)\n\n[![asciicast](https://asciinema.org/a/572786.svg)](https://asciinema.org/a/572786)\n\n## Installation:\n\n###### Prerequisites:\n\n* Install jq, curl, imagemagick, catimg, fzf\n  \n  * for e.g. Ubuntu: `apt -y install jq curl imagemagick catimg fzf`\n\n* Install [glow](https://github.com/charmbracelet/glow#installation) for Markdown rendering support in your terminal\n\n###### Script download:\n\nInstall the script by either cloning this repository or directly downloading to your `$PATH`, e.g.:\n\n```shell\ncurl \"https://raw.githubusercontent.com/nitefood/ai-bash/master/ai\" \u003e /usr/bin/ai \u0026\u0026 chmod 0755 /usr/bin/ai\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitefood%2Fai-bash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnitefood%2Fai-bash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitefood%2Fai-bash/lists"}