# AiSH - AI-Driven Shell Assistant AiSH 🌟 An intelligent shell assistant powered by AI **AiSH** (AI Shell) is a modular, interactive command-line tool that leverages AI to execute single commands, answer questions, and perform autonomous multi-step tasks on your system. Built with Python, it integrates with the Groq API (with Ollama support planned) and features a fancy, emoji-enhanced UI with command history and verbose mode. ## Features - **Single Commands**: Execute simple shell commands (e.g., `list home dir contents` → `ls ~`). - **Autonomous Tasks**: Perform complex tasks step-by-step (e.g., `create a hello.txt with "hello world" written`). - **Questions**: Answer queries without execution (e.g., `what is your model`). - **Verbose Mode**: Display executed commands with `/verbose`. - **Fancy UI**: Terminal-safe emojis (🌟, šŸš€, āœ…) and structured formatting. - **History Navigation**: Use ↑↓ for previous commands, ←→ for editing, and auto-suggestions. - **Modular Design**: Separate modules for AI queries, system info, and task management. ## Requirements - Python 3.6+ - Dependencies (listed in `requirements.txt`): ``` colorama==0.4.6 psutil==5.9.8 requests==2.31.0 groq==0.5.0 python-dotenv==1.0.1 prompt_toolkit==3.0.47 ``` ## Setup 1. **Clone the Repository**: ```bash git clone cd aish ``` 2. **Install Dependencies**: ```bash pip install -r requirements.txt ``` 3. **Set Up Environment Variables**: - Create a `.env` file in the project root: ```bash GROQ_API_KEY=your_groq_api_key_here ``` - (Optional) For Ollama (not yet active): ``` OLLAMA_METHOD=cli OLLAMA_API_URL=http://localhost:11434/api/generate OLLAMA_MODEL=deepseek-r1:1.5b ``` 4. **Run AiSH**: ```bash python3 aish.py ``` ## Usage Start AiSH and interact via the prompt: ``` === 🌟 AiSH v0.1 === šŸ’» OS : Linux 5.15.0-73-generic āš™ļø CPU : 4 cores @ 12.5% šŸ“¦ RAM : 7923 MB total, 3456 MB free Type '/help' for commands. Use ↑↓ for history, ←→ to edit, Ctrl+C to exit/stop. 🌟 AiSH> ``` ### Commands - **AiSH Commands**: Prefix with `/` - `/help`: Show available commands. - `/system`: Display system info. - `/verbose`: Toggle verbose mode (shows executed commands). - `/exit` or `/quit`: Exit AiSH. - **Direct Shell Execution**: Prefix with `!` - `!ls`: Runs `ls` directly. - **Normal Input**: AI interprets your intent - `list home dir contents`: Executes `ls ~`. - `what is your model`: Answers with text. - `create a hello.txt with "hello world" written`: Autonomous task. ### Examples 1. **Single Command**: ``` 🌟 AiSH> list home dir contents ``` 2. **Autonomous Task with Verbose**: ``` 🌟 AiSH> /verbose šŸ“¢ Verbose mode enabled 🌟 AiSH> create a hello.txt with "hello world" written šŸš€ Starting task: create a hello.txt with "hello world" written šŸ“¢ Executing: echo "hello world" > hello.txt āœ… Task completed ``` 3. **Question**: ``` 🌟 AiSH> what is your model ā„¹ļø I’m powered by deepseek-r1-distill-llama-70b via Groq ``` ## Project Structure ``` . ā”œā”€ā”€ ai_interface.py # AI query logic (Groq + Ollama) ā”œā”€ā”€ aish.py # Main shell application ā”œā”€ā”€ README.md # This file ā”œā”€ā”€ requirements.txt # Dependencies ā”œā”€ā”€ system_info.py # System information utilities ā”œā”€ā”€ task_manager.py # Autonomous task processing ā”œā”€ā”€ TASKS.txt # Task notes (if applicable) └── utils.py # Command execution utilities ``` ## Contributing Feel free to fork, submit PRs, or report issues! Future plans include: - Full Ollama integration. - Configuration via `.aishrc`. - Enhanced intent classification. ## License MIT License - Free to use, modify, and distribute. ### **Notes** - **Branding**: Used `AiSH` consistently as the logo/name. - **Emojis**: Kept terminal-safe emojis (🌟, šŸš€, etc.) from the code for a cohesive look. - **Setup**: Included `.env` setup for Groq API key, with placeholders for Ollama. - **Examples**: Mirrored the fancy UI output from your tests.