-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
29 lines (22 loc) · 1.49 KB
/
install.ps1
File metadata and controls
29 lines (22 loc) · 1.49 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
# ── RunanywhereAI — Windows One-Line Installer ──────────────────────
# Usage: irm https://raw.githubusercontent.com/RunanywhereAI/RunAnywhereAgent/main/install.ps1 | iex
$ErrorActionPreference = "Stop"
$ConfigUrl = "https://raw.githubusercontent.com/RunanywhereAI/RunAnywhereAgent/main/opencode.json"
Write-Host "`nRunanywhereAI — AI Coding Agent`n" -ForegroundColor Cyan
# ── Get token from user ─────────────────────────────────────────
$Token = Read-Host "Paste your access token"
if ([string]::IsNullOrWhiteSpace($Token)) {
Write-Host "ERROR: Token is required. Get one from your hackathon organizer." -ForegroundColor Red
exit 1
}
if (-not (Get-Command opencode -ErrorAction SilentlyContinue)) {
Write-Host "Installing OpenCode..." -ForegroundColor Green
if (Get-Command npm -ErrorAction SilentlyContinue) { npm i -g opencode-ai@latest }
else { Write-Host "Install Node.js from https://nodejs.org first." -ForegroundColor Red; exit 1 }
}
$dir = Join-Path $env:USERPROFILE ".config\opencode"
if (-not (Test-Path $dir)) { New-Item -ItemType Directory -Path $dir -Force | Out-Null }
Invoke-WebRequest -Uri $ConfigUrl -OutFile (Join-Path $dir "opencode.json")
$env:RUNANYWHEREAI_KEY = $Token
[System.Environment]::SetEnvironmentVariable("RUNANYWHEREAI_KEY", $Token, "User")
Write-Host "`nDone! Open a NEW terminal and run: opencode`n" -ForegroundColor Green