{"id":35324316,"url":"https://github.com/nirodg/oh-my-ai","last_synced_at":"2026-04-07T16:31:26.220Z","repository":{"id":324987487,"uuid":"1099324894","full_name":"nirodg/oh-my-ai","owner":"nirodg","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-18T23:50:25.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-19T01:13:18.817Z","etag":null,"topics":["bash","linux","llm","ollama","shellscri","zsh"],"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/nirodg.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-18T21:19:07.000Z","updated_at":"2025-11-18T23:52:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nirodg/oh-my-ai","commit_stats":null,"previous_names":["nirodg/oh-my-ai"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nirodg/oh-my-ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirodg%2Foh-my-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirodg%2Foh-my-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirodg%2Foh-my-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirodg%2Foh-my-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nirodg","download_url":"https://codeload.github.com/nirodg/oh-my-ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirodg%2Foh-my-ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31520418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bash","linux","llm","ollama","shellscri","zsh"],"created_at":"2025-12-31T01:03:09.592Z","updated_at":"2026-04-07T16:31:26.212Z","avatar_url":"https://github.com/nirodg.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# 🤖 Oh My AI - Your Intelligent Shell Assistant\n\n\u003cdiv align=\"center\"\u003e\n\n![AI Assistant](https://img.shields.io/badge/AI-Powered-blue?style=for-the-badge\u0026logo=ai)\n![Shell](https://img.shields.io/badge/Shell-Bash%2FZsh-green?style=for-the-badge\u0026logo=gnu-bash)\n![Ollama](https://img.shields.io/badge/Powered%20by-Ollama-orange?style=for-the-badge)\n\n**Transform your terminal into an AI-powered workspace!**  \n*Understand your environment, analyze files, debug commands, and get intelligent assistance right in your shell.*\n\n[Features](#-features) • [Installation](#-installation) • [Usage](#-usage) • [Download](#-download)\n\n\u003c/div\u003e\n\n## 🚀 What Does Oh My AI Do?\n\nOh My AI is a **smart shell assistant** that integrates directly with your terminal to provide context-aware AI assistance. Here's what it actually does:\n\n### 🎯 Core Functionality\n\n**🧠 Intelligent Command Assistance**\n- Ask natural language questions about your code and files\n- Get explanations for previous commands\n- Debug failed commands with context-aware analysis\n- Receive safe command suggestions for common tasks\n\n**📁 File \u0026 Code Analysis** \n- Read and analyze any file in your current workspace\n- Compare multiple files and highlight differences\n- Understand what scripts and configuration files do\n- Get code explanations and summaries\n\n**🔍 Context Awareness**\n- Automatically reads your command history for context\n- Understands your current directory and files\n- Detects git repositories and provides git context\n- Knows your system environment and shell type\n\n**🛡️ Safety First**\n- All commands are validated for safety before execution\n- Prevents dangerous operations like `rm -rf /`\n- Locks execution to your current workspace directory\n- Requires confirmation before executing suggested commands\n\n## 📥 Download \u0026 Install\n\n### Option 1: One-Line Auto Install (Recommended)\n```bash\ncurl -s https://raw.githubusercontent.com/nirodg/oh-my-ai/main/install-ai.sh | bash\n```\n\n### Option 2: Direct Download \u0026 Manual Install\n```bash\n# Download the main script\ncurl -s -L https://raw.githubusercontent.com/nirodg/oh-my-ai/main/oh-my-ai.sh -o ~/.local/bin/ai.sh\n\n# Make it executable\nchmod +x ~/.local/bin/ai.sh\n\n# Add to your shell (choose one)\necho \"source ~/.local/bin/ai.sh\" \u003e\u003e ~/.bashrc    # For bash\necho \"source ~/.local/bin/ai.sh\" \u003e\u003e ~/.zshrc     # For zsh\n\n# Reload your shell\nsource ~/.bashrc   # or source ~/.zshrc\n```\n\n### Option 3: Download Individual Files\n- **Main Script** - The core AI assistant  \n- **Installer** - Automated installation script\n\n---\n\n## ⚙️ Prerequisites\n\n### Required: Ollama\nOh My AI requires Ollama to be installed and running:\n\n```bash\ncurl -fsSL https://ollama.ai/install.sh | sh\nollama serve\nollama pull llama3.2\n```\n\n---\n\n## 🎮 How to Use\n\n### Basic Usage\n```bash\nai \u003cyour question or request\u003e\n```\n\n### Real Examples\n\n### Two-Tier Intent Detection\n#### 1. Deterministic Detection (Fast \u0026 Accurate)\nUses pattern matching for obvious cases - no LLM needed:\n```\n# File operations (100% accurate)\nai what does script.sh do?          → READFILE (file exists in query)\nai compare old.py new.py            → COMPARE (2+ files + \"compare\")\nai show me config.json              → READFILE (file + \"show me\")\n\n# Command building (keyword-based)\nai create a backup script           → BUILD (starts with \"create\")\nai find all .log files              → BUILD (starts with \"find\")\n\n# History operations (pattern-based)\nai explain the last command         → EXPLAIN (\"explain\" + \"last command\")\nai why did that fail?               → DEBUG (\"why\" + \"that\")\n\n# Workflow analysis\nai what have I been working on?     → ANALYZE (\"what have i been\")\n```\n#### 2. LLM Detection (Only When Needed)\nFor ambiguous queries, uses Ollama:\n```\nai help me with this error          → LLM decides (DEBUG vs CHAT)\nai can you check something?         → LLM decides intent\nai script.sh issues                 → LLM decides (READFILE vs DEBUG)\n```\n##### 🔍 Smart File Detection\nAutomatically finds files in queries\n```\nai what does delete.me do?          → Finds \"delete.me\" exists\nai compare \"config old.txt\" new.cfg → Handles spaces/quotes\nai show me script.sh and test.py    → Extracts both files\n```\n###✅ Flawless Command Flow\nIntent → Action Mapping\n\n1. **READFILE** → Read file, ask AI to analyze it\n2. **COMPARE** → Read multiple files, ask AI to compare\n3. **BUILD** → Generate command, confirm, execute safely\n4. **EXPLAIN** → Get last command from history, explain it\n5. **DEBUG** → Get failed command, diagnose issue\n6. **ANALYZE** → Analyze command history patterns\n7. **CHAT** → General conversation with context\n\n#### Safety Guarantees\n```\n# All BUILD commands require confirmation\nai create a backup\n🔨 Building command...\nSuggested: tar -czf backup.tar.gz *\nConfirm? (y/N): \n\n# Dangerous commands are blocked\nBlocked patterns: rm -rf /, dd if=, mkfs, fork bombs, etc.\nBlocked operations: cd /, sudo, su\nAll operations locked to $WORK_DIR\n```\n\n###🎨 User Experience\n####Clear Feedback\n```\n🤖 ➜ ai what does script.sh do\n🤖 Processing...\n→ Detected intent: READFILE\n📖 Reading: script.sh\n\n[AI analyzes file...]\n```\n#### Transparent Intent\n```\n🤖 ➜ ai create backup script\n🤖 Processing...\n→ Detected intent: BUILD\n🔨 Building command...\n\nSuggested: tar -czf backup_$(date +%Y%m%d).tar.gz *.txt\nExecute? (y/N):\n```\n\n\n####🚀 Performance\n- **Fast**: Deterministic detection = instant (no LLM call)\n- **Accurate**: Pattern matching catches 80% of cases correctly\n- **Smart**: LLM handles ambiguous cases perfectly\n- **Efficient**: Only one LLM call per command (not multiple)\n\n#### Test cases\n```\n# File operations\nai what does script.sh do?          ✓ READFILE\nai show me config.json              ✓ READFILE  \nai analyze delete.me                ✓ READFILE\nai compare old.py new.py            ✓ COMPARE\n\n# Command building\nai create a backup                  ✓ BUILD\nai find large files                 ✓ BUILD\nai make a script to compress logs   ✓ BUILD\n\n# History operations  \nai explain the last command         ✓ EXPLAIN\nai what did that do?                ✓ EXPLAIN\nai why did that fail?               ✓ DEBUG\nai fix the error                    ✓ DEBUG\n\n# Workflow\nai what have I been working on?     ✓ ANALYZE\nai my recent activity               ✓ ANALYZE\n\n# Chat\nai how do pipes work?               ✓ CHAT\nai explain grep                     ✓ CHAT\n```\n\n---\n\n## ✨ Key Features\n### 🔍 Smart Intent Detection\n- Detects filenames  \n- Understands command-building  \n- Automatically enters debug mode when needed  \n- Explains commands with natural language\n\n### 🎨 Enhanced Zsh Experience\n- Tab completion  \n- Smart AI suggestions  \n- Colorful prompts  \n\n### 🔒 Built-in Safety\n- Validates commands  \n- Prevents directory escape  \n- Blocks dangerous patterns  \n- Asks for confirmation  \n- Checks file sizes  \n\n### 🐳 Docker Support\nIf you don't have Ollama installed, it can deploy via Docker automatically.\n\n---\n\n## 🛠️ Configuration\n\n### Environment Variables\n```bash\nexport OLLAMA_MODEL=\"llama3.2\"\nexport OLLAMA_HOST=\"http://localhost:11434\"\n```\n\n### Persistent Config (`~/.ai_sh_config`)\n```bash\nexport OLLAMA_HOST=\"http://localhost:11434\"\nexport OLLAMA_MODEL=\"llama3.2\"\n```\n\n---\n\n## ❓ Troubleshooting\n\n### \"Ollama not found\"\n```bash\ncurl -fsSL https://ollama.ai/install.sh | sh\n```\n\n### \"Command not found\"\n```bash\necho 'export PATH=\"$HOME/.local/bin:$PATH\"' \u003e\u003e ~/.bashrc\nsource ~/.bashrc\n```\n\n### \"Permission denied\"\n```bash\nchmod +x ~/.local/bin/ai.sh\n```\n\n---\n\n## 📁 Project Structure\n```\noh-my-ai/\n├── oh-my-ai.sh\n├── install-ai.sh\n└── README.md\n```\n\n---\n\n## 👨‍💻 Developer\n\n**Brage Dorin**  \nGitHub: @nirodg  \nRepository: https://github.com/nirodg/oh-my-ai\n\n---\n\n## 📄 License\n\nMIT License - see LICENSE file.\n\n\u003cdiv align=\"center\"\u003e\n\nReady to supercharge your terminal? 🚀  \n⬆ Back to Top\n\n\u003c/div\u003e\n\n## 📥 Direct Download Links\n- Download Main Script  \n- Download Installer\n\n```bash\nwget https://raw.githubusercontent.com/nirodg/oh-my-ai/main/oh-my-ai.sh\ncurl -O https://raw.githubusercontent.com/nirodg/oh-my-ai/main/oh-my-ai.sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnirodg%2Foh-my-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnirodg%2Foh-my-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnirodg%2Foh-my-ai/lists"}