diff --git a/README.md b/README.md index cc209ea..6421144 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ chmod +x install.sh && ./install.sh | Tool | Required? | Install | |------|-----------|---------| -| Python 3.10+ | ✅ Required | `sudo apt install python3 python3-pip` | +| Python 3.10+ | ✅ Required | Linux/macOS: install from your package manager or `python.org`. Windows: install from `python.org` and select **Add Python to PATH**. Verify with `python --version` or `py -3 --version`. | | Node.js 18+ | ⚠ For opencode | `curl -fsSL https://deb.nodesource.com/setup_20.x \| sudo bash - && sudo apt install -y nodejs` | | opencode | ⚠ For code tasks | `npm install -g @opencode/cli` | | Hermes Agent | ⚠ For memory/scheduling | `curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh \| bash` | @@ -113,6 +113,18 @@ chmod +x install.sh && ./install.sh > ⚠ = Optional — the dashboard works with any subset of installed agents. +### Windows Quick Start + +```powershell +git clone https://github.com/modimihir07/agentic-os.git +cd agentic-os +.\install.ps1 +.\start.ps1 +# Open http://127.0.0.1:8080 +``` + +The PowerShell launchers resolve Python in this order: `py -3.10`, `py -3`, then `python`. For manual commands, prefer `python -m pip install -r requirements.txt` and `python server.py --port 8080` so the same interpreter runs both dependency installation and the server. + --- ## 🔧 Configuration diff --git a/install.ps1 b/install.ps1 new file mode 100644 index 0000000..75e4eec --- /dev/null +++ b/install.ps1 @@ -0,0 +1,84 @@ +$ErrorActionPreference = "Stop" + +Write-Host "=== Agentic OS Installer ===" +Write-Host "" + +function Resolve-Python { + $candidates = @( + @{ Command = "py"; Args = @("-3.10") }, + @{ Command = "py"; Args = @("-3") }, + @{ Command = "python"; Args = @() } + ) + + foreach ($candidate in $candidates) { + $cmd = Get-Command $candidate.Command -ErrorAction SilentlyContinue + if (-not $cmd) { continue } + + try { + & $candidate.Command @($candidate.Args) --version *> $null + return $candidate + } catch { + continue + } + } + + throw "Python 3.10+ is required. Install it from https://www.python.org/downloads/ and check 'Add Python to PATH'." +} + +$python = Resolve-Python +$pythonCommand = $python.Command +$pythonArgs = @($python.Args) +$pythonVersion = & $pythonCommand @pythonArgs --version +Write-Host "Python: $pythonVersion" + +Write-Host "Installing Python dependencies..." +& $pythonCommand @pythonArgs -m pip install -r requirements.txt --quiet + +# Check Node.js (for opencode) +if (Get-Command node -ErrorAction SilentlyContinue) { + Write-Host "Node.js: $(node --version)" +} else { + Write-Warning "Node.js not found. opencode requires Node 18+. Install from https://nodejs.org/." +} + +# Check opencode +if (Get-Command opencode -ErrorAction SilentlyContinue) { + $opencodeVersion = try { opencode --version } catch { "installed" } + Write-Host "opencode: $opencodeVersion" +} else { + Write-Warning "opencode not found. Install via: npm install -g @opencode/cli" +} + +# Check Hermes +if (Get-Command hermes -ErrorAction SilentlyContinue) { + Write-Host "Hermes: found" +} else { + Write-Warning "Hermes Agent not found. See the Hermes Agent documentation for Windows installation guidance." +} + +# Check Gemini CLI +if (Get-Command gemini -ErrorAction SilentlyContinue) { + Write-Host "Gemini CLI: found" +} else { + Write-Warning "Gemini CLI not found. Install via: npm install -g @google/gemini-cli" +} + +New-Item -ItemType Directory -Force -Path backups, audit | Out-Null + +if (-not (Test-Path .git)) { + Write-Host "Initializing git repository..." + git init + foreach ($entry in @("audit/*", "backups/*.tar.gz", "data/settings.json")) { + if (-not (Test-Path .gitignore) -or -not (Select-String -Path .gitignore -Pattern ([regex]::Escape($entry)) -Quiet)) { + Add-Content -Path .gitignore -Value $entry + } + } +} + +Write-Host "" +Write-Host "=== Installation complete! ===" +Write-Host "" +Write-Host "Next steps:" +Write-Host " 1. Edit data/settings.json with your API keys" +Write-Host " 2. Run .\start.ps1 to launch the dashboard" +Write-Host " 3. Open http://127.0.0.1:8080 in your browser" diff --git a/install.sh b/install.sh index de32e91..56ef94a 100755 --- a/install.sh +++ b/install.sh @@ -14,22 +14,25 @@ esac echo "Detected OS: $OS" # Check Python -if command -v python3 &>/dev/null; then - echo "Python: $(python3 --version)" +if command -v python &>/dev/null; then + PYTHON="python" +elif command -v python3 &>/dev/null; then + PYTHON="python3" else - echo "ERROR: Python 3.10+ required. Install via: sudo apt install python3 python3-pip" + echo "ERROR: Python 3.10+ required. Install from https://www.python.org/downloads/ or your OS package manager." exit 1 fi +echo "Python: $($PYTHON --version)" # Check pip -if ! command -v pip3 &>/dev/null; then +if ! $PYTHON -m pip --version &>/dev/null; then echo "Installing pip..." - python3 -m ensurepip --upgrade + $PYTHON -m ensurepip --upgrade fi # Install Python deps echo "Installing Python dependencies..." -pip3 install -r requirements.txt --quiet +$PYTHON -m pip install -r requirements.txt --quiet # Check Node.js (for opencode) if command -v node &>/dev/null; then diff --git a/start.ps1 b/start.ps1 new file mode 100644 index 0000000..700f52d --- /dev/null +++ b/start.ps1 @@ -0,0 +1,46 @@ +$ErrorActionPreference = "Stop" + +Write-Host "Starting Agentic OS Dashboard..." +Write-Host "" + +if (-not (Test-Path server.py)) { + Write-Error "server.py not found. Are you in the right directory?" + exit 1 +} + +function Resolve-Python { + $candidates = @( + @{ Command = "py"; Args = @("-3.10") }, + @{ Command = "py"; Args = @("-3") }, + @{ Command = "python"; Args = @() } + ) + + foreach ($candidate in $candidates) { + $cmd = Get-Command $candidate.Command -ErrorAction SilentlyContinue + if (-not $cmd) { continue } + + try { + & $candidate.Command @($candidate.Args) --version *> $null + return $candidate + } catch { + continue + } + } + + throw "Python 3.10+ is required. Install it from https://www.python.org/downloads/ and check 'Add Python to PATH'." +} + +$python = Resolve-Python +$pythonCommand = $python.Command +$pythonArgs = @($python.Args) + +& $pythonCommand @pythonArgs -m pip install -r requirements.txt --quiet + +$port = & $pythonCommand @pythonArgs -c "import json; f=open('data/settings.json'); d=json.load(f); print(d.get('dashboard',{}).get('port',8080)); f.close()" 2>$null +if (-not $port) { $port = "8080" } + +Write-Host "Dashboard: http://127.0.0.1:$port" +Write-Host "Press Ctrl+C to stop" +Write-Host "" + +& $pythonCommand @pythonArgs server.py --port $port diff --git a/start.sh b/start.sh index 8dea07b..f165161 100755 --- a/start.sh +++ b/start.sh @@ -10,18 +10,25 @@ if [ ! -f server.py ]; then exit 1 fi +# Resolve Python +if command -v python &>/dev/null; then + PYTHON="python" +elif command -v python3 &>/dev/null; then + PYTHON="python3" +else + echo "ERROR: Python 3.10+ required. Install from https://www.python.org/downloads/ or your OS package manager." + exit 1 +fi + # Check dependencies -pip3 install -r requirements.txt --quiet 2>/dev/null +$PYTHON -m pip install -r requirements.txt --quiet 2>/dev/null # Get port from settings or default -PORT=8080 -if command -v python3 &>/dev/null; then - PORT=$(python3 -c "import json; f=open('data/settings.json'); d=json.load(f); print(d.get('dashboard',{}).get('port',8080)); f.close()" 2>/dev/null || echo "8080") -fi +PORT=$($PYTHON -c "import json; f=open('data/settings.json'); d=json.load(f); print(d.get('dashboard',{}).get('port',8080)); f.close()" 2>/dev/null || echo "8080") echo "Dashboard: http://127.0.0.1:${PORT}" echo "Press Ctrl+C to stop" echo "" # Start server -python3 server.py --port "${PORT}" +$PYTHON server.py --port "${PORT}"