diff --git a/README.md b/README.md index eb98698..802e993 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,115 @@ # ShellGenius -AI-Powered Local Shell Script Assistant using Ollama +AI-Powered Local Shell Script Assistant using Ollama. + +## Overview + +ShellGenius is a CLI tool that uses local LLMs (Ollama) to generate, explain, and refactor shell scripts interactively. Developers can describe what they want in natural language, and the tool generates safe, commented shell commands with explanations. ## Features -- Generate shell scripts using natural language -- Review and explain existing scripts -- Interactive REPL mode -- Local privacy - all processing done locally via Ollama -- Support for multiple shell types (bash, zsh, sh) +- **Natural Language to Shell Generation**: Convert natural language descriptions into shell commands +- **Interactive TUI Interface**: Rich terminal UI with navigation, command history, and suggestions +- **Script Explanation Mode**: Parse and explain existing shell scripts line-by-line +- **Safe Refactoring Suggestions**: Analyze scripts and suggest safer alternatives +- **Command History Learning**: Learn from your command history for personalized suggestions +- **Multi-Shell Support**: Support for bash, zsh, and sh scripts ## Installation ```bash -pip install shellgenius +# Install from source +pip install . + +# Install with dev dependencies +pip install -e ".[dev]" +``` + +## Requirements + +- Python 3.10+ +- Ollama running locally (https://ollama.ai) +- Recommended models: codellama, llama2, mistral + +## Configuration + +ShellGenius uses a `config.yaml` file for configuration. See `.env.example` for environment variables. + +```yaml +ollama: + host: "localhost:11434" + model: "codellama" + timeout: 120 + +safety: + level: "moderate" + warn_patterns: + - "rm -rf" + - "chmod 777" + - "sudo su" ``` ## Usage -### Generate a script +### Interactive Mode ```bash -shellgenius generate "Create a backup script for /data directory" +shellgenius ``` -### Review a script +### Generate Shell Commands ```bash -shellgenius review script.sh +shellgenius generate "find all Python files modified in the last 24 hours" ``` -### Interactive REPL +### Explain a Script ```bash -shellgenius repl +shellgenius explain script.sh ``` -## Configuration +### Refactor with Safety Checks -Configure Ollama host and model in `~/.config/shellgenius/config.yaml` or via environment variables. +```bash +shellgenius refactor script.sh --suggestions +``` + +## Commands + +| Command | Description | +|---------|-------------| +| `shellgenius` | Start interactive TUI | +| `shellgenius generate ` | Generate shell commands | +| `shellgenius explain