https://github.com/hossbit/comai-linux-assistant
Local AI Linux terminal assistant written in Bash. Explain commands, analyze files and logs, and use local LLMs or OpenAI-compatible APIs.
https://github.com/hossbit/comai-linux-assistant
ai-assistant bash bash-script cli command-line-tool devops linux linux-assistant llama-cpp llm local-ai local-llm log-analysis open-source openai openai-api shell-assistant system-administration terminal terminal-assistant
Last synced: about 11 hours ago
JSON representation
Local AI Linux terminal assistant written in Bash. Explain commands, analyze files and logs, and use local LLMs or OpenAI-compatible APIs.
- Host: GitHub
- URL: https://github.com/hossbit/comai-linux-assistant
- Owner: hossbit
- License: mit
- Created: 2026-06-25T05:55:43.000Z (5 days ago)
- Default Branch: main
- Last Pushed: 2026-06-25T23:39:09.000Z (5 days ago)
- Last Synced: 2026-06-26T01:11:39.723Z (5 days ago)
- Topics: ai-assistant, bash, bash-script, cli, command-line-tool, devops, linux, linux-assistant, llama-cpp, llm, local-ai, local-llm, log-analysis, open-source, openai, openai-api, shell-assistant, system-administration, terminal, terminal-assistant
- Language: Shell
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ComAI - Linux Terminal AI Assistant







[](https://github.com/hossbit/comai-linux-assistant-wiki)
**ComAI** is a Bash-powered AI assistant for your Linux terminal.
Use it to ask Linux questions, explain commands before you run them, inspect
files, scan logs, and talk to local AI, Ollama, or OpenAI without leaving your
shell. ComAI is the client; LocalAI is only one optional backend.
## Why Use It
- Works from any terminal with the simple `comai` command.
- Supports LocalAI, Ollama, LM Studio, llama.cpp server, OpenAI, and other OpenAI-compatible APIs.
- Understands files and logs with `-f`.
- Keeps setup and provider checks visible with `comai status`.
- Installs as a user-space tool under `~/localcomai`.
## Install
One-line install:
```bash
curl -fsSL https://hossbit.github.io/comai/install.sh | bash
```
Custom install directory:
```bash
curl -fsSL https://hossbit.github.io/comai/install.sh | COMAI_INSTALL_DIR="$HOME/apps/comai" bash
```
Manual install:
```bash
git clone https://github.com/hossbit/comai-linux-assistant.git
cd comai-linux-assistant
chmod +x scripts/install.sh
./scripts/install.sh
```
Then run:
```bash
comai status
```
## First Commands
```bash
comai explain chmod 755
comai how do I find files larger than 1GB?
comai do you see any error? -f application.log
comai ollama hi
comai lmstudio hi
comai gpt hi
```
Local mode is the default. Use `comai ollama ...` for Ollama,
`comai lmstudio ...` for LM Studio, and `comai gpt ...` for OpenAI.
## Main Commands
```bash
comai setup # Configure provider, API, and model
comai ask # Ask one question
comai chat # Start an interactive conversation
comai explain # Explain a command, error, or output
comai analyze # Analyze logs, files, or piped output
comai status # Show provider status and connections
comai provider # Show active and available providers
comai models # List models from all providers
comai config # View, get, or edit settings
comai history # Show previous conversations
comai start # Start the optional LocalAI helper service
comai stop # Stop the optional LocalAI helper service
comai restart # Restart the optional LocalAI helper service
```
## Providers
ComAI supports:
- `local`: any OpenAI-compatible local server, default `http://127.0.0.1:11435`
- `ollama`: local Ollama API, default `http://127.0.0.1:11434`
- `lmstudio`: LM Studio local server, default `http://127.0.0.1:1234`
- `openai`: OpenAI API with `OPENAI_API_KEY` or `providers.openai.api_key`
Check providers:
```bash
comai status
comai models
comai provider
```
## Files And Logs
```bash
comai explain this script -f install.sh
comai summarize this config -f nginx.conf
comai is this service healthy? -f service.log
```
ComAI service/status logs are written under:
```bash
~/localcomai/logs/comai.log
```
## Documentation
Full documentation lives in the wiki:
- [Quick Start](https://github.com/hossbit/comai-linux-assistant-wiki/blob/main/Quick-Start.md)
- [Installation](https://github.com/hossbit/comai-linux-assistant-wiki/blob/main/Installation.md)
- [Providers](https://github.com/hossbit/comai-linux-assistant-wiki/blob/main/Providers.md)
- [Configuration](https://github.com/hossbit/comai-linux-assistant-wiki/blob/main/Configuration.md)
- [ComAI + LocalAI](https://github.com/hossbit/comai-linux-assistant-wiki/blob/main/ComAI-and-LocalAI.md)
- [Local AI Service](https://github.com/hossbit/comai-linux-assistant-wiki/blob/main/Local-AI-Service.md)
- [File and Log Analysis](https://github.com/hossbit/comai-linux-assistant-wiki/blob/main/File-and-Log-Analysis.md)
- [Troubleshooting](https://github.com/hossbit/comai-linux-assistant-wiki/blob/main/Troubleshooting.md)
- [Uninstall](https://github.com/hossbit/comai-linux-assistant-wiki/blob/main/Uninstall.md)
## Requirements
```text
bash curl jq find sort head sed awk grep wc tr readlink date systemctl
```
Optional:
```text
file numfmt git
```
## Support