{"slug": "comai-an-open-source-linux-assistant-for-troubleshooting-with-local-llms", "title": "ComAI – An open-source Linux assistant for troubleshooting with local LLMs", "summary": "ComAI, an open-source Linux terminal assistant powered by local large language models, has been released on GitHub. The Bash-based tool allows users to explain commands, analyze files and logs, and interact with local AI models, Ollama, or OpenAI directly from the terminal. It supports multiple providers and custom configurations, aiming to streamline troubleshooting and system administration tasks.", "body_md": "**ComAI** is an open-source AI-powered Linux terminal assistant written in Bash.\n\nAsk Linux questions, explain shell commands, analyze configuration files, inspect logs for errors, and interact with local LLMs, Ollama, or OpenAI directly from your terminal.\n\nComAI supports:\n\n- Local AI models through llama.cpp and OpenAI-compatible APIs\n- Ollama models for local chat and file analysis\n- OpenAI and ChatGPT API models\n- Linux command explanations\n- File and configuration analysis\n- Log analysis and error detection\n- Custom model selection\n- Bash-friendly installation and configuration\n\n```\ncomai explain chmod 755\ncomai how do I find files larger than 1GB?\ncomai do you see any error? -f application.log\ncomai ollama explain this script -f script.sh\ncomai gpt explain this nginx configuration -f nginx.conf\n```\n\nLocal mode is the default. Ollama mode runs when the first word after `comai`\n\nis `ollama`\n\n. ChatGPT mode runs when the first word is `gpt`\n\nor `chatgpt`\n\n.\n\nFor local mode, install [hossbit/localai](https://github.com/hossbit/localai) first. ComAI expects it at:\n\n```\n~/ai\n```\n\nIf you only want Ollama or ChatGPT mode, you can skip localai and use\n`comai ollama ...`\n\nor `comai gpt ...`\n\n.\n\n```\ngit clone https://github.com/hossbit/comai-linux-assistant.git\ncd comai-linux-assistant\nchmod +x scripts/install.sh\n./scripts/install.sh\n```\n\nInstalled files go to `~/localcomai`\n\n.\n\nThe installer explains each section before it changes files. It asks where to\ninstall ComAI, uses `~/localcomai`\n\nby default, shows when files already exist,\nand preserves existing config values while adding new default config keys.\n\nCommands:\n\n```\ncomai\ncomi\n```\n\nAsk a Linux question:\n\n```\ncomai what is /etc in linux?\ncomai how this command work -command \"find . -type f -size +100M\"\n```\n\nUse ChatGPT:\n\n```\ncomai gpt hi\ncomai gpt explain chmod 755\n```\n\nUse Ollama:\n\n```\ncomai ollama hi\ncomai ollama explain chmod 755\n```\n\nRead a file:\n\n```\ncomai explain this file -f script.sh\ncomai ollama summarize this file -f README.md\ncomai gpt summarize this file -f llama-swap.log\n```\n\nAsk simple local file/log checks:\n\n```\ncomai newest file\ncomai biggest file here\ncomai do you see any error? -f llama-swap.log\n```\n\nChoose a model for one request:\n\n```\ncomai --model=Qwen2.5-7B-Instruct-Q4_K_M hi\ncomai ollama --model=qwen2.5-coder:7b hi\ncomai gpt --model=gpt-5.5 hi\n```\n\nUse an environment variable:\n\n```\nexport OPENAI_API_KEY=\"your_api_key\"\n```\n\nOr put the key in the installed config:\n\n```\nopenai_api_key: your_api_key\n```\n\nInstalled config:\n\n```\n~/localcomai/config/comai.yaml\n```\n\nDo not commit a real API key to git.\n\nConfig files:\n\n```\nconfig/comai.yaml              # source default\n~/localcomai/config/comai.yaml # installed config\n```\n\nExample:\n\n```\nprovider: local\nai_dir: ~/ai\napi_base_url: http://127.0.0.1\napi_base_port: 11435\nmodel: Qwen2.5-Coder-7B-Instruct-Q4_K_M\ngpt_model: gpt-5.5\nollama_api_base: http://127.0.0.1:11434\nollama_model: qwen2.5-coder:7b\nopenai_api_base: https://api.openai.com\nopenai_api_key:\nmax_tokens: 420\ntimeout: 120\nfile_max_bytes: 24000\ndir_context_max: 120\nerror_regex: error|errors|failed|failure|exception|fatal|panic|timeout|warn|warning|traceback\nerror_intent_regex: error|errors|failed|failure|warning|warnings|problem|problems|issue|issues|wrong|bad|broken|fail|crash|crashed|panic|timeout|traceback|healthy|health|(^|[[:space:]])ok([[:space:]]|$)|okay|check (this )?log|scan (this )?log\n```\n\nWhat the main keys mean:\n\n`provider`\n\n: default provider. Use`local`\n\n,`ollama`\n\n, or`openai`\n\n.`ai_dir`\n\n: where localai is installed. Default is`~/ai`\n\n.`api_base_url`\n\n: local OpenAI-compatible API URL without the port.`api_base_port`\n\n: local OpenAI-compatible API port.`model`\n\n: default local model for`comai hi`\n\n.`gpt_model`\n\n: default OpenAI model for`comai gpt hi`\n\n.`ollama_api_base`\n\n: Ollama API URL. Default is`http://127.0.0.1:11434`\n\n.`ollama_model`\n\n: default Ollama model for`comai ollama hi`\n\n.`openai_api_base`\n\n: OpenAI API URL. Keep this as`https://api.openai.com`\n\nunless you know you need another compatible server.`openai_api_key`\n\n: optional place to store your OpenAI key for ChatGPT mode.`OPENAI_API_KEY`\n\nis safer and overrides this.`max_tokens`\n\n: maximum answer length.`timeout`\n\n: request timeout in seconds.`file_max_bytes`\n\n: maximum bytes read from each`-f`\n\nfile.`dir_context_max`\n\n: maximum current-directory entries sent as context.`error_regex`\n\n: words used by local log/error checks.`error_intent_regex`\n\n: words used to decide whether a question is asking for a log/error check.\n\nUseful overrides:\n\n```\nCOMAI_MODEL=Qwen2.5-7B-Instruct-Q4_K_M comai hi\nCOMAI_PROVIDER=ollama comai hi\nOPENAI_API_KEY=your_api_key comai gpt hi\nCOMAI_MAX_TOKENS=120 comai hi\n```\n\nComAI expects a local OpenAI-compatible server in `~/ai`\n\n.\n\nStart it:\n\n```\nsystemctl --user start comai-localai.service\n```\n\nOr manually:\n\n```\n~/ai/start.sh\n```\n\nCheck local models:\n\n```\ncurl -s http://127.0.0.1:11435/v1/models | jq -r '.data[].id'\n```\n\nStart Ollama, then run:\n\n```\ncomai ollama hi\ncomai ollama summarize this file -f README.md\n```\n\nCheck Ollama models:\n\n```\ncurl -s http://127.0.0.1:11434/api/tags | jq -r '.models[].name'\n```\n\n`comai gpt ...`\n\nsays `429`\n\n: OpenAI rejected the request for rate limit or quota. Check billing, credits, project, or rate limits.\n\n`comai gpt ...`\n\nworks without exporting a key: it is probably reading `openai_api_key`\n\nfrom `~/localcomai/config/comai.yaml`\n\n.\n\n`comai ...`\n\ncannot reach local AI: start `comai-localai.service`\n\nor run `~/ai/start.sh`\n\n.\n\n`comai ollama ...`\n\ncannot reach Ollama: start Ollama and check `ollama_api_base`\n\nin `config/comai.yaml`\n\n.\n\n```\nbash curl jq find sort head sed awk grep wc tr readlink systemctl\n```\n\nOptional:\n\n```\nfile numfmt\n~/localcomai/scripts/uninstall.sh\n```\n\nThis removes ComAI files and leaves `~/ai`\n\nalone.", "url": "https://wpnews.pro/news/comai-an-open-source-linux-assistant-for-troubleshooting-with-local-llms", "canonical_source": "https://github.com/hossbit/comai-linux-assistant", "published_at": "2026-06-26 23:46:50+00:00", "updated_at": "2026-06-27 00:05:09.324588+00:00", "lang": "en", "topics": ["large-language-models", "developer-tools"], "entities": ["ComAI", "Ollama", "OpenAI", "llama.cpp", "ChatGPT", "GitHub", "hossbit/localai", "Qwen2.5-Coder-7B-Instruct-Q4_K_M"], "alternates": {"html": "https://wpnews.pro/news/comai-an-open-source-linux-assistant-for-troubleshooting-with-local-llms", "markdown": "https://wpnews.pro/news/comai-an-open-source-linux-assistant-for-troubleshooting-with-local-llms.md", "text": "https://wpnews.pro/news/comai-an-open-source-linux-assistant-for-troubleshooting-with-local-llms.txt", "jsonld": "https://wpnews.pro/news/comai-an-open-source-linux-assistant-for-troubleshooting-with-local-llms.jsonld"}}