@geekbeer/minion 2.43.3 → 2.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/win/minion-cli.ps1 +73 -17
package/package.json
CHANGED
package/win/minion-cli.ps1
CHANGED
|
@@ -218,8 +218,8 @@ function Restart-MinionProcess {
|
|
|
218
218
|
# ============================================================
|
|
219
219
|
|
|
220
220
|
function Invoke-Setup {
|
|
221
|
-
$totalSteps =
|
|
222
|
-
if ($SetupTunnel) { $totalSteps =
|
|
221
|
+
$totalSteps = 10
|
|
222
|
+
if ($SetupTunnel) { $totalSteps = 11 }
|
|
223
223
|
|
|
224
224
|
# Minionization warning
|
|
225
225
|
Write-Host ""
|
|
@@ -308,8 +308,64 @@ function Invoke-Setup {
|
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
# Step 2: Install Claude Code
|
|
312
|
-
Write-Step 2 $totalSteps "
|
|
311
|
+
# Step 2: Install Git (required by Claude Code for git-bash)
|
|
312
|
+
Write-Step 2 $totalSteps "Checking Git (git-bash)..."
|
|
313
|
+
$gitBashPath = $null
|
|
314
|
+
if (Test-CommandExists 'git') {
|
|
315
|
+
$gitVersion = & git --version 2>$null
|
|
316
|
+
Write-Detail "Git already installed ($gitVersion)"
|
|
317
|
+
# Detect bash.exe path from git installation
|
|
318
|
+
$gitExe = (Get-Command git).Source
|
|
319
|
+
$gitDir = Split-Path (Split-Path $gitExe)
|
|
320
|
+
$candidateBash = Join-Path $gitDir 'bin\bash.exe'
|
|
321
|
+
if (Test-Path $candidateBash) { $gitBashPath = $candidateBash }
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
Write-Host " Installing Git via winget..."
|
|
325
|
+
try {
|
|
326
|
+
& winget install --id Git.Git --accept-package-agreements --accept-source-agreements
|
|
327
|
+
# Refresh PATH
|
|
328
|
+
$env:PATH = [System.Environment]::GetEnvironmentVariable('PATH', 'Machine') + ';' + [System.Environment]::GetEnvironmentVariable('PATH', 'User')
|
|
329
|
+
if (Test-CommandExists 'git') {
|
|
330
|
+
Write-Detail "Git installed successfully"
|
|
331
|
+
$gitExe = (Get-Command git).Source
|
|
332
|
+
$gitDir = Split-Path (Split-Path $gitExe)
|
|
333
|
+
$candidateBash = Join-Path $gitDir 'bin\bash.exe'
|
|
334
|
+
if (Test-Path $candidateBash) { $gitBashPath = $candidateBash }
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
337
|
+
Write-Warn "Git installed but not in PATH. Please restart this terminal."
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
catch {
|
|
341
|
+
Write-Warn "Failed to install Git. Please install manually from https://git-scm.com/downloads/win"
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
# Fallback: search common install paths
|
|
345
|
+
if (-not $gitBashPath) {
|
|
346
|
+
$commonPaths = @(
|
|
347
|
+
'C:\Program Files\Git\bin\bash.exe',
|
|
348
|
+
'C:\Program Files (x86)\Git\bin\bash.exe',
|
|
349
|
+
(Join-Path $env:LOCALAPPDATA 'Programs\Git\bin\bash.exe')
|
|
350
|
+
)
|
|
351
|
+
foreach ($p in $commonPaths) {
|
|
352
|
+
if (Test-Path $p) { $gitBashPath = $p; break }
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
if ($gitBashPath) {
|
|
356
|
+
Write-Detail "git-bash found: $gitBashPath"
|
|
357
|
+
# Set CLAUDE_CODE_GIT_BASH_PATH for the current user (persists across sessions)
|
|
358
|
+
[Environment]::SetEnvironmentVariable('CLAUDE_CODE_GIT_BASH_PATH', $gitBashPath, 'User')
|
|
359
|
+
$env:CLAUDE_CODE_GIT_BASH_PATH = $gitBashPath
|
|
360
|
+
Write-Detail "CLAUDE_CODE_GIT_BASH_PATH set for current user"
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
Write-Warn "git-bash not found. Claude Code may not work."
|
|
364
|
+
Write-Host " Install Git from https://git-scm.com/downloads/win and re-run setup." -ForegroundColor Gray
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
# Step 3: Install Claude Code CLI
|
|
368
|
+
Write-Step 3 $totalSteps "Installing Claude Code..."
|
|
313
369
|
if (Test-CommandExists 'claude') {
|
|
314
370
|
$claudeVersion = & claude --version 2>$null
|
|
315
371
|
Write-Detail "Claude Code already installed ($claudeVersion)"
|
|
@@ -330,8 +386,8 @@ function Invoke-Setup {
|
|
|
330
386
|
Write-Host " Please run 'claude' in a terminal to complete the authentication process." -ForegroundColor Yellow
|
|
331
387
|
Write-Host ""
|
|
332
388
|
|
|
333
|
-
# Step
|
|
334
|
-
Write-Step
|
|
389
|
+
# Step 4: Create config directory and .env
|
|
390
|
+
Write-Step 4 $totalSteps "Creating config directory and .env..."
|
|
335
391
|
New-Item -Path $DataDir -ItemType Directory -Force | Out-Null
|
|
336
392
|
New-Item -Path $LogDir -ItemType Directory -Force | Out-Null
|
|
337
393
|
$envValues = @{
|
|
@@ -344,8 +400,8 @@ function Invoke-Setup {
|
|
|
344
400
|
Write-EnvFile $EnvFile $envValues
|
|
345
401
|
Write-Detail "$EnvFile generated"
|
|
346
402
|
|
|
347
|
-
# Step
|
|
348
|
-
Write-Step
|
|
403
|
+
# Step 5: Install node-pty (required for Windows terminal management)
|
|
404
|
+
Write-Step 5 $totalSteps "Installing terminal support (node-pty)..."
|
|
349
405
|
$npmRoot = & npm root -g 2>$null
|
|
350
406
|
$minionPkgDir = Join-Path $npmRoot '@geekbeer\minion'
|
|
351
407
|
if (Test-Path $minionPkgDir) {
|
|
@@ -383,8 +439,8 @@ function Invoke-Setup {
|
|
|
383
439
|
Write-Host " Please run: npm install -g @geekbeer/minion"
|
|
384
440
|
}
|
|
385
441
|
|
|
386
|
-
# Step
|
|
387
|
-
Write-Step
|
|
442
|
+
# Step 6: Generate start-agent.ps1 and register auto-start
|
|
443
|
+
Write-Step 6 $totalSteps "Registering auto-start..."
|
|
388
444
|
$serverJs = Join-Path $minionPkgDir 'win\server.js'
|
|
389
445
|
if (-not (Test-Path $serverJs)) {
|
|
390
446
|
$serverJs = Join-Path $minionPkgDir 'win' 'server.js'
|
|
@@ -560,8 +616,8 @@ Remove-Item `$PidFile -Force -ErrorAction SilentlyContinue
|
|
|
560
616
|
$shortcut.Save()
|
|
561
617
|
Write-Detail "Startup shortcut created: $shortcutPath"
|
|
562
618
|
|
|
563
|
-
# Step
|
|
564
|
-
Write-Step
|
|
619
|
+
# Step 7: Disable screensaver, lock screen, and sleep
|
|
620
|
+
Write-Step 7 $totalSteps "Disabling screensaver, lock screen, and sleep..."
|
|
565
621
|
# Screensaver off
|
|
566
622
|
Set-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name ScreenSaveActive -Value '0'
|
|
567
623
|
Set-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name ScreenSaveTimeOut -Value '0'
|
|
@@ -577,8 +633,8 @@ Remove-Item `$PidFile -Force -ErrorAction SilentlyContinue
|
|
|
577
633
|
& powercfg -change -monitor-timeout-dc 0 2>$null
|
|
578
634
|
Write-Detail "Sleep and monitor timeout disabled"
|
|
579
635
|
|
|
580
|
-
# Step
|
|
581
|
-
Write-Step
|
|
636
|
+
# Step 8: Install TightVNC Server
|
|
637
|
+
Write-Step 8 $totalSteps "Setting up TightVNC Server..."
|
|
582
638
|
$vncSystemPath = 'C:\Program Files\TightVNC\tvnserver.exe'
|
|
583
639
|
$vncPortableDir = Join-Path $DataDir 'tightvnc'
|
|
584
640
|
$vncPortablePath = Join-Path $vncPortableDir 'PFiles\TightVNC\tvnserver.exe'
|
|
@@ -637,8 +693,8 @@ Remove-Item `$PidFile -Force -ErrorAction SilentlyContinue
|
|
|
637
693
|
Write-Detail "TightVNC configured: localhost-only, no VNC password (auth via HQ proxy)"
|
|
638
694
|
}
|
|
639
695
|
|
|
640
|
-
# Step
|
|
641
|
-
Write-Step
|
|
696
|
+
# Step 9: Setup websockify (WebSocket proxy for VNC)
|
|
697
|
+
Write-Step 9 $totalSteps "Setting up websockify..."
|
|
642
698
|
if (Get-WebsockifyCommand) {
|
|
643
699
|
Write-Detail "websockify already installed"
|
|
644
700
|
}
|
|
@@ -694,7 +750,7 @@ Remove-Item `$PidFile -Force -ErrorAction SilentlyContinue
|
|
|
694
750
|
}
|
|
695
751
|
}
|
|
696
752
|
|
|
697
|
-
# Step
|
|
753
|
+
# Step 10 (optional): Cloudflare Tunnel
|
|
698
754
|
if ($SetupTunnel) {
|
|
699
755
|
$currentStep = $totalSteps - 1
|
|
700
756
|
Write-Step $currentStep $totalSteps "Setting up Cloudflare Tunnel..."
|