-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
53 lines (43 loc) · 1.58 KB
/
install.ps1
File metadata and controls
53 lines (43 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# OpenAnalyst CLI Installer — Windows PowerShell
# Usage: irm https://raw.githubusercontent.com/OpenAnalystInc/cli/main/install.ps1 | iex
$ErrorActionPreference = "Continue"
try { [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 } catch {}
Write-Host ""
Write-Host " OpenAnalyst CLI" -ForegroundColor DarkCyan
Write-Host " The Universal AI Agent for Your Terminal" -ForegroundColor DarkGray
Write-Host ""
# Check for Node.js
$NodeVersion = $null
try { $NodeVersion = (node --version 2>$null) } catch {}
if (-not $NodeVersion) {
Write-Host " Node.js is required but not found." -ForegroundColor Red
Write-Host " Install from: https://nodejs.org/" -ForegroundColor DarkGray
Write-Host ""
exit 1
}
Write-Host " Node.js $NodeVersion detected" -ForegroundColor DarkGray
# Install via npm
Write-Host ""
Write-Host " Installing..." -ForegroundColor White -NoNewline
try {
npm install -g @openanalystinc/openanalyst-cli@latest 2>&1 | Out-Null
Write-Host " done" -ForegroundColor Green
} catch {
Write-Host " failed" -ForegroundColor Red
Write-Host " Try manually: npm install -g @openanalystinc/openanalyst-cli" -ForegroundColor DarkGray
exit 1
}
# Verify
$Version = $null
try { $Version = (openanalyst --version 2>$null) } catch {}
Write-Host ""
if ($Version) {
Write-Host " $([char]0x2713) $Version" -ForegroundColor Green
} else {
Write-Host " $([char]0x2713) Installed" -ForegroundColor Green
}
Write-Host ""
Write-Host " To get started:" -ForegroundColor White
Write-Host ""
Write-Host " openanalyst" -ForegroundColor Cyan
Write-Host ""