diff --git a/README.md b/README.md index 5c718720..12ebd14d 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,28 @@ Every choice about your stack is made in one place — an **interactive terminal ## Install -One command takes a fresh machine from nothing to a configured stack. It installs the `ordo` CLI and drops you straight into the setup wizard: +One command takes a fresh machine from nothing to a configured stack — it installs the `ordo` CLI and drops you straight into the interactive setup wizard, **in the same terminal**. Open your normal terminal and run the line for your platform: + +**macOS / Linux** (bash · zsh · or Git Bash on Windows): ```bash curl -fsSL https://raw.githubusercontent.com/AlienWalker1995/Ordo-AI-Stack/main/install.sh | sh ``` -Under the hood the one-liner checks prerequisites (git, Docker + `docker compose` v2, Python 3.11+; warns if there's no NVIDIA GPU), clones the repo to `~/ordo` (override with `ORDO_DIR=`), installs the CLI into a virtualenv, and launches the wizard. That's the only step — everything else is the wizard. +```bash +# no curl? use wget: +wget -qO- https://raw.githubusercontent.com/AlienWalker1995/Ordo-AI-Stack/main/install.sh | sh +``` + +**Windows** (PowerShell): + +```powershell +irm https://raw.githubusercontent.com/AlienWalker1995/Ordo-AI-Stack/main/install.ps1 | iex +``` + +> The Windows line must run in **PowerShell**, not `cmd`. (`curl … | sh` only works inside a POSIX shell — Git Bash or WSL — so on native Windows use the PowerShell one-liner.) + +Either path checks prerequisites (git, Docker + `docker compose` v2, Python 3.11+; warns if there's no NVIDIA GPU), clones the repo (`~/ordo`, or `%USERPROFILE%\ordo` on Windows — override with the `ORDO_DIR` env var), installs the CLI into a virtualenv, and launches the wizard. That's the only step — everything else is the wizard. ### The setup wizard — `ordo init` diff --git a/docs/operator-guide.md b/docs/operator-guide.md index 0b7bf991..e6ab6974 100644 --- a/docs/operator-guide.md +++ b/docs/operator-guide.md @@ -12,15 +12,25 @@ render substrate lives at the repo root (there is no `v2/` directory — there i ## Install & first run -**From a fresh machine — one command installs the CLI and launches the setup wizard:** +**From a fresh machine — one command installs the CLI and launches the setup wizard, in the same +terminal. Run the line for your platform:** ```bash +# macOS / Linux (bash · zsh · or Git Bash on Windows) curl -fsSL https://raw.githubusercontent.com/AlienWalker1995/Ordo-AI-Stack/main/install.sh | sh +# …or without curl: +wget -qO- https://raw.githubusercontent.com/AlienWalker1995/Ordo-AI-Stack/main/install.sh | sh ``` -It checks prerequisites (git, Docker + `docker compose` v2, Python 3.11+; warns if there's no -NVIDIA GPU), clones the repo to `~/ordo` (override with `ORDO_DIR=`), installs `ordo` into a -virtualenv, and runs **`ordo init`** — the interactive wizard that configures the whole stack. +```powershell +# Windows — PowerShell (not cmd; `curl | sh` needs a POSIX shell, so native Windows uses this) +irm https://raw.githubusercontent.com/AlienWalker1995/Ordo-AI-Stack/main/install.ps1 | iex +``` + +Either path checks prerequisites (git, Docker + `docker compose` v2, Python 3.11+; warns if there's +no NVIDIA GPU), clones the repo (`~/ordo`, or `%USERPROFILE%\ordo` on Windows — override with the +`ORDO_DIR` env var), installs `ordo` into a virtualenv, and runs **`ordo init`** — the interactive +wizard that configures the whole stack. **The wizard (`ordo init`) is the setup path.** Every prompt has a sensible default (press **Enter** to accept); it walks you through: diff --git a/install.ps1 b/install.ps1 new file mode 100644 index 00000000..f9b1a445 --- /dev/null +++ b/install.ps1 @@ -0,0 +1,106 @@ +<# + Ordo installer (Windows / PowerShell). + + One command from a fresh machine to the interactive setup wizard: + + irm https://raw.githubusercontent.com/AlienWalker1995/Ordo-AI-Stack/main/install.ps1 | iex + + Mirrors install.sh (macOS/Linux) step-for-step: checks prerequisites, clones the repo, + installs the `ordo` CLI into a .venv, and launches `ordo init`. Because `irm | iex` leaves + the console attached, the wizard runs fully interactively in this same terminal. + + Overrides (set before running): $env:ORDO_DIR = 'D:\ordo' $env:ORDO_REPO_URL = '...' +#> + +#Requires -Version 5.1 +$ErrorActionPreference = 'Stop' + +function Info($m) { Write-Host " $m" -ForegroundColor Cyan } +function Warn($m) { Write-Host " ! $m" -ForegroundColor Yellow } +function Die($m) { Write-Host " x $m" -ForegroundColor Red; exit 1 } +function Have($c) { $null -ne (Get-Command $c -ErrorAction SilentlyContinue) } + +$RepoUrl = if ($env:ORDO_REPO_URL) { $env:ORDO_REPO_URL } else { 'https://github.com/AlienWalker1995/Ordo-AI-Stack.git' } +$DefaultDir = if ($env:ORDO_DIR) { $env:ORDO_DIR } else { Join-Path $HOME 'ordo' } +# irm | iex does NOT consume the console, so stdin stays interactive unless genuinely redirected. +$Interactive = -not [Console]::IsInputRedirected + +Write-Host '' +Write-Host 'Ordo installer' -ForegroundColor Green +Write-Host '--------------------------------------------------' + +# -- 1. Prerequisites --------------------------------------------------------- +Info 'Checking prerequisites' +if (-not (Have git)) { Die 'git not found - install Git for Windows (https://git-scm.com) and re-run.' } +if (-not (Have docker)) { Die 'Docker not found - install Docker Desktop (https://docs.docker.com/get-docker/) and re-run.' } +docker compose version *> $null +if ($LASTEXITCODE -ne 0) { Die "'docker compose' (v2) not found - enable it in Docker Desktop and re-run." } + +$probe = 'import sys; sys.exit(0 if sys.version_info >= (3, 11) else 1)' +$Python = $null +foreach ($cand in @('python', 'py', 'python3')) { + if (-not (Have $cand)) { continue } + if ($cand -eq 'py') { & $cand -3 -c $probe *> $null } else { & $cand -c $probe *> $null } + if ($LASTEXITCODE -eq 0) { $Python = $cand; break } +} +if (-not $Python) { Die 'Python 3.11+ not found - install from https://python.org (tick "Add python.exe to PATH") and re-run.' } + +if (Have nvidia-smi) { + $gpu = (nvidia-smi --query-gpu=name --format=csv,noheader 2>$null | Select-Object -First 1) + Info "NVIDIA GPU detected: $gpu" +} else { + Warn 'nvidia-smi not found - the stack will run CPU-only (no image/video/voice). Continuing.' +} + +# -- 2. Locate or clone the repo --------------------------------------------- +# When downloaded and run as a file we may already be inside a clone; when piped +# through iex there is no script file, so $PSCommandPath is null and we clone. +$ScriptDir = if ($PSCommandPath) { Split-Path -Parent $PSCommandPath } else { $null } +if ($ScriptDir -and (Test-Path (Join-Path $ScriptDir 'pyproject.toml')) -and (Test-Path (Join-Path $ScriptDir 'ordo'))) { + $Target = $ScriptDir + Info "Using existing clone at $Target" +} else { + $Target = $DefaultDir + if ($Interactive) { + $ans = Read-Host "Install directory [$DefaultDir]" + if ($ans) { $Target = $ans } + } + if ((Test-Path (Join-Path $Target '.git')) -and (Test-Path (Join-Path $Target 'pyproject.toml'))) { + Info "Repo already present at $Target - pulling latest" + git -C $Target pull --ff-only + if ($LASTEXITCODE -ne 0) { Warn 'git pull failed (local changes?) - using the existing checkout.' } + } elseif ((Test-Path $Target) -and (Get-ChildItem -Force $Target -ErrorAction SilentlyContinue)) { + Die "$Target exists and is not an Ordo clone - set `$env:ORDO_DIR to another path and re-run." + } else { + Info "Cloning $RepoUrl -> $Target" + git clone --depth 1 $RepoUrl $Target + if ($LASTEXITCODE -ne 0) { Die 'git clone failed.' } + } +} +Set-Location $Target + +# -- 3. Install the ordo CLI into a virtualenv ------------------------------- +Info 'Installing the ordo CLI (virtualenv .venv)' +if (-not (Test-Path '.venv')) { + if ($Python -eq 'py') { & py -3 -m venv .venv } else { & $Python -m venv .venv } +} +$VenvPy = Join-Path $Target '.venv\Scripts\python.exe' +if (-not (Test-Path $VenvPy)) { Die 'failed to create virtualenv - is the Python venv module installed?' } +& $VenvPy -m pip install --quiet --upgrade pip *> $null +& $VenvPy -m pip install --quiet . +if ($LASTEXITCODE -ne 0) { Die 'pip install failed - check the output above.' } + +# -- 4. Run the wizard -------------------------------------------------------- +Info 'Launching the setup wizard' +if ($Interactive) { + # Console is attached (irm | iex keeps it), so the wizard prompts run right here. + & $VenvPy -m ordo init --out out +} else { + Warn 'No interactive console (redirected input) - writing config non-interactively (no bring-up).' + & $VenvPy -m ordo init --yes --out out + Write-Host '' + Write-Host "Config written to $Target\out\. To finish interactively:" + Write-Host " cd `"$Target`"; .\.venv\Scripts\python.exe -m ordo init --out out --force" +} + +Info "Done. Repo: $Target"