{"id":30223633,"url":"https://github.com/simonstnn/shellai","last_synced_at":"2025-08-14T12:47:56.356Z","repository":{"id":306812495,"uuid":"1025097380","full_name":"SimonStnn/ShellAI","owner":"SimonStnn","description":"Natural language to safe bash commands. ShellAI turns plain-text instructions into explainable, testable shell scripts.","archived":false,"fork":false,"pushed_at":"2025-07-27T18:07:35.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-27T20:23:38.502Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SimonStnn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2025-07-23T18:05:07.000Z","updated_at":"2025-07-27T18:07:39.000Z","dependencies_parsed_at":"2025-07-27T20:35:24.452Z","dependency_job_id":null,"html_url":"https://github.com/SimonStnn/ShellAI","commit_stats":null,"previous_names":["simonstnn/shellai"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/SimonStnn/ShellAI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonStnn%2FShellAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonStnn%2FShellAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonStnn%2FShellAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonStnn%2FShellAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimonStnn","download_url":"https://codeload.github.com/SimonStnn/ShellAI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonStnn%2FShellAI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270422667,"owners_count":24580835,"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-08-14T02:00:10.309Z","response_time":75,"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":[],"created_at":"2025-08-14T12:47:54.292Z","updated_at":"2025-08-14T12:47:56.331Z","avatar_url":"https://github.com/SimonStnn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ShellAI\r\n\r\nNatural language to safe bash commands. ShellAI turns plain-text instructions into explainable, testable shell scripts and provides natural language querying of your system information.\r\n\r\n## 🚀 Features\r\n\r\n- **Natural Language System Queries**: Ask questions about your system in plain English\r\n- **Comprehensive System Info Collection**: Automatically gather system information for AI analysis\r\n- **LLM-Powered Responses**: Uses LlamaIndex + Ollama for intelligent responses\r\n- **Command-Line Interface**: Easy-to-use CLI for all operations\r\n- **Extensible**: Add custom system commands and queries\r\n\r\n## 🧱 Project Structure\r\n\r\n```\r\nShellAI/\r\n├── shellai/                    # Main package\r\n│   ├── __init__.py\r\n│   ├── cli.py                  # Command-line interface\r\n│   ├── collect_info.py         # System information collector\r\n│   ├── ask.py                  # Natural language query engine\r\n│   └── train.py                # Training utilities\r\n├── examples/                   # Standalone examples\r\n│   ├── collect_info.py         # Minimal info collector\r\n│   └── ask.py                  # Minimal query interface\r\n├── system_info/               # Generated system data (after running collect)\r\n│   ├── os.txt\r\n│   ├── disk.txt\r\n│   ├── memory.txt\r\n│   └── ...\r\n├── requirements.txt\r\n├── setup.py\r\n└── README.md\r\n```\r\n\r\n## ✅ Requirements\r\n\r\n- **Python 3.10+**\r\n- **Ollama** (for LLM functionality)\r\n- **LlamaIndex** (installed automatically)\r\n\r\n## 🔧 Installation\r\n\r\n### Option 1: Install from source (recommended)\r\n\r\n```bash\r\n# Clone the repository\r\ngit clone \u003crepository-url\u003e\r\ncd ShellAI\r\n\r\n# Install in development mode\r\npip install -e .[dev]\r\n\r\n# Or install dependencies manually\r\npip install -r requirements.txt\r\n```\r\n\r\n### Option 2: Install Ollama\r\n\r\n```bash\r\n# Install Ollama (visit https://ollama.ai for installation instructions)\r\n# Then pull a model:\r\nollama pull mistral\r\n```\r\n\r\n## 🚀 Quick Start\r\n\r\n### 1. Check Setup\r\n\r\n```bash\r\nshellai setup\r\n```\r\n\r\nThis will verify that all dependencies are installed and Ollama is running.\r\n\r\n### 2. Collect System Information\r\n\r\n```bash\r\nshellai collect\r\n```\r\n\r\nThis gathers comprehensive system information including:\r\n- OS details (`uname -a`)\r\n- Disk usage (`df -h`) \r\n- Memory info (`free -m`)\r\n- Running processes (`ps aux`)\r\n- Network configuration (`ip addr`)\r\n- CPU information (`lscpu`)\r\n- And more...\r\n\r\n### 3. Ask Questions About Your System\r\n\r\n```bash\r\nshellai ask\r\n```\r\n\r\nStart an interactive session where you can ask natural language questions like:\r\n- \"How much free RAM do I have?\"\r\n- \"What processes are using the most CPU?\"\r\n- \"Show me disk usage\"\r\n- \"What's my network configuration?\"\r\n\r\n### 4. Single Question Mode\r\n\r\n```bash\r\nshellai ask --question \"How much free disk space do I have?\"\r\n```\r\n\r\n## 📋 CLI Commands\r\n\r\n### Core Commands\r\n\r\n```bash\r\n# Collect system information\r\nshellai collect [--output-dir DIR] [--custom-command name:command]\r\n\r\n# Ask questions (interactive)\r\nshellai ask [--model MODEL] [--system-info-dir DIR]\r\n\r\n# Ask single question\r\nshellai ask --question \"your question here\"\r\n\r\n# Check status of collected info\r\nshellai status [--system-info-dir DIR]\r\n\r\n# Verify setup\r\nshellai setup\r\n```\r\n\r\n### Examples\r\n\r\n```bash\r\n# Collect info with custom commands\r\nshellai collect --custom-command \"docker:docker ps -a\" --custom-command \"logs:tail -100 /var/log/syslog\"\r\n\r\n# Use different Ollama model\r\nshellai ask --model llama2\r\n\r\n# Use different system info directory\r\nshellai ask --system-info-dir /path/to/custom/info\r\n```\r\n\r\n## 🛠 Standalone Usage\r\n\r\nIf you prefer minimal standalone scripts, use the examples:\r\n\r\n```bash\r\n# Collect system info (minimal version)\r\npython3 examples/collect_info.py\r\n\r\n# Ask questions (minimal version)  \r\npython3 examples/ask.py\r\n```\r\n\r\n## 🎯 Example Usage\r\n\r\n```bash\r\n$ shellai collect\r\n🔍 Collecting system information...\r\n  📋 Running: uname -a\r\n  ✅ Saved: os.txt\r\n  📋 Running: df -h\r\n  ✅ Saved: disk.txt\r\n  ...\r\n✅ Collection complete!\r\n\r\n$ shellai ask\r\n🤖 Initializing with model: mistral\r\n📚 Loading system information...\r\n📄 Loaded 10 system info files\r\n🔍 Creating search index...\r\n✅ Ready to answer questions!\r\n\r\n❓ Ask about your system: How much free RAM do I have?\r\n🤔 Thinking about: How much free RAM do I have?\r\n\r\n💡 Based on your system information, you have 2.1 GB of free RAM available \r\nout of 8.0 GB total memory. Your memory usage is currently at about 74%.\r\n\r\n❓ Ask about your system: What processes are using the most CPU?\r\n🤔 Thinking about: What processes are using the most CPU?\r\n\r\n💡 According to your process list, the top CPU-consuming processes are:\r\n1. python3 (12.5% CPU)\r\n2. firefox (8.2% CPU) \r\n3. code (5.1% CPU)\r\n...\r\n```\r\n\r\n## 🔧 Advanced Usage\r\n\r\n### Custom System Commands\r\n\r\nAdd your own system information commands:\r\n\r\n```bash\r\nshellai collect --custom-command \"docker:docker ps -a\" \\\r\n                --custom-command \"services:systemctl --failed\" \\\r\n                --custom-command \"logs:journalctl -n 50\"\r\n```\r\n\r\n### Different Models\r\n\r\nUse different Ollama models:\r\n\r\n```bash\r\n# List available models\r\nollama list\r\n\r\n# Use specific model\r\nshellai ask --model llama2\r\nshellai ask --model codellama\r\n```\r\n\r\n### API Usage\r\n\r\nUse ShellAI programmatically:\r\n\r\n```python\r\nfrom shellai import SystemInfoCollector, SystemQueryEngine\r\n\r\n# Collect info\r\ncollector = SystemInfoCollector(\"my_system_info\")\r\ncollector.collect_all()\r\n\r\n# Query system\r\nengine = SystemQueryEngine(\"my_system_info\", model=\"mistral\")\r\nengine.initialize()\r\nresponse = engine.query(\"How much disk space is available?\")\r\nprint(response)\r\n```\r\n\r\n## 🐛 Troubleshooting\r\n\r\n### Ollama Issues\r\n\r\n```bash\r\n# Check if Ollama is running\r\nollama list\r\n\r\n# Start Ollama service\r\nollama serve\r\n\r\n# Pull required model\r\nollama pull mistral\r\n```\r\n\r\n### Missing System Info\r\n\r\n```bash\r\n# Re-collect system information\r\nshellai collect\r\n\r\n# Check what was collected\r\nshellai status\r\n```\r\n\r\n### Python Dependencies\r\n\r\n```bash\r\n# Reinstall dependencies\r\npip install -e .[dev]\r\n\r\n# Or install manually\r\npip install llama-index llama-index-llms-ollama\r\n```\r\n\r\n## 🤝 Contributing\r\n\r\n1. Fork the repository\r\n2. Create a feature branch\r\n3. Make your changes\r\n4. Run tests: `pytest`\r\n5. Format code: `black shellai tests`\r\n6. Submit a pull request\r\n\r\n## 📄 License\r\n\r\nThis project is licensed under the MIT License - see the LICENSE file for details.\r\n\r\n## 🙏 Acknowledgments\r\n\r\n- [LlamaIndex](https://github.com/jerryjliu/llama_index) for the RAG framework\r\n- [Ollama](https://ollama.ai) for local LLM hosting\r\n- The open-source community for inspiration and tools\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonstnn%2Fshellai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonstnn%2Fshellai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonstnn%2Fshellai/lists"}