# InFlow CLI installer for Windows - served at https://inflowcli.ai/install.ps1 # Usage: iwr -useb https://inflowcli.ai/install.ps1 | iex $ErrorActionPreference = "Stop" $Package = "@inflowpayai/inflow" $MinNodeMajor = 22 function Say($msg) { Write-Host "[inflow] $msg" } function Fail($msg) { Write-Host "[inflow] $msg" -ForegroundColor Red; exit 1 } # 1. Check Node.js $node = Get-Command node -ErrorAction SilentlyContinue if (-not $node) { Fail @" Node.js >= $MinNodeMajor is required but was not found. Install it from https://nodejs.org (or 'winget install OpenJS.NodeJS.LTS'), then re-run: iwr -useb https://inflowcli.ai/install.ps1 | iex "@ } $nodeMajor = [int]((node -p "process.versions.node.split('.')[0]")) if ($nodeMajor -lt $MinNodeMajor) { Fail "Node.js >= $MinNodeMajor is required (found $(node -v)). Please upgrade and re-run." } # 2. Install the package Say "Installing $Package globally via npm..." npm install -g $Package if ($LASTEXITCODE -ne 0) { Fail "npm install failed. Or run without installing: npx -y $Package" } # 3. Verify the command is reachable if (Get-Command inflow -ErrorAction SilentlyContinue) { Say "Installed $(inflow --version 2>$null)." } else { $npmBin = npm prefix -g Say "Installed, but 'inflow' is not on your PATH yet." Say " - Ensure $npmBin is in your PATH (System Settings > Environment Variables)" Say " - Then open a new terminal so the change takes effect" } # 4. Next steps Say "Done. Get payment-ready in 2 steps:" Say " 1. inflow auth login # OAuth device flow, then approve in your browser" Say " 2. inflow auth status # confirm you're authenticated" Say "" Say "Using an AI agent? Just tell it:" Say ' "Fetch inflowcli.ai/skill.md and get me set up with InFlow"' Say "" Say "Docs: https://inflowcli.ai/llms.txt - Source: https://github.com/inflowpayai/inflow-cli"