aegiscode 5.1.5 → 5.1.7
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/bin/cli.js +355 -355
- package/package.json +1 -1
- package/scripts/install-alacritty.ps1 +149 -0
- package/scripts/install-alacritty.sh +162 -0
package/package.json
CHANGED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
<#
|
|
2
|
+
.SYNOPSIS
|
|
3
|
+
Install Alacritty terminal and create a desktop shortcut for AEGIS CLI.
|
|
4
|
+
.DESCRIPTION
|
|
5
|
+
Installs Alacritty via winget (preferred) or Chocolatey, then creates a
|
|
6
|
+
desktop shortcut that launches Alacritty with aegis-cli.
|
|
7
|
+
#>
|
|
8
|
+
|
|
9
|
+
$ErrorActionPreference = "Stop"
|
|
10
|
+
$Host.UI.RawUI.WindowTitle = "AEGIS CLI Installer"
|
|
11
|
+
|
|
12
|
+
function Write-Step { Write-Host "→ $($args[0])" -ForegroundColor Cyan }
|
|
13
|
+
function Write-OK { Write-Host "✓ $($args[0])" -ForegroundColor Green }
|
|
14
|
+
function Write-Warn { Write-Host "⚠ $($args[0])" -ForegroundColor Yellow }
|
|
15
|
+
function Write-Err { Write-Host "✗ $($args[0])" -ForegroundColor Red; exit 1 }
|
|
16
|
+
|
|
17
|
+
# ── Admin check ───────────────────────────────────────
|
|
18
|
+
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
|
|
19
|
+
|
|
20
|
+
# ── Install Alacritty ─────────────────────────────────
|
|
21
|
+
function Install-Alacritty {
|
|
22
|
+
if (Get-Command alacritty -ErrorAction SilentlyContinue) {
|
|
23
|
+
$ver = & alacritty --version 2>$null
|
|
24
|
+
Write-OK "Alacritty already installed ($ver)"
|
|
25
|
+
return
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
Write-Step "Installing Alacritty..."
|
|
29
|
+
|
|
30
|
+
# Try winget first
|
|
31
|
+
if (Get-Command winget -ErrorAction SilentlyContinue) {
|
|
32
|
+
Write-Step "Using winget..."
|
|
33
|
+
try {
|
|
34
|
+
& winget install --id Alacritty.Alacritty --silent --accept-package-agreements --accept-source-agreements 2>&1 | Out-Null
|
|
35
|
+
refreshenv 2>$null
|
|
36
|
+
if (Get-Command alacritty -ErrorAction SilentlyContinue) {
|
|
37
|
+
Write-OK "Alacritty installed via winget"
|
|
38
|
+
return
|
|
39
|
+
}
|
|
40
|
+
} catch {
|
|
41
|
+
Write-Warn "winget failed, trying Chocolatey..."
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
# Fallback: Chocolatey
|
|
46
|
+
if (Get-Command choco -ErrorAction SilentlyContinue) {
|
|
47
|
+
Write-Step "Using Chocolatey..."
|
|
48
|
+
& choco install alacritty -y 2>&1 | Out-Null
|
|
49
|
+
refreshenv 2>$null
|
|
50
|
+
if (Get-Command alacritty -ErrorAction SilentlyContinue) {
|
|
51
|
+
Write-OK "Alacritty installed via Chocolatey"
|
|
52
|
+
return
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
# Last resort: scoop
|
|
57
|
+
if (Get-Command scoop -ErrorAction SilentlyContinue) {
|
|
58
|
+
Write-Step "Using Scoop..."
|
|
59
|
+
& scoop install alacritty 2>&1 | Out-Null
|
|
60
|
+
if (Get-Command alacritty -ErrorAction SilentlyContinue) {
|
|
61
|
+
Write-OK "Alacritty installed via Scoop"
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (!$isAdmin) {
|
|
67
|
+
Write-Warn "Not running as admin. Prompting for elevation..."
|
|
68
|
+
Start-Process powershell -Verb RunAs -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`""
|
|
69
|
+
exit
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
Write-Err "Could not install Alacritty. Install manually: winget install --id Alacritty.Alacritty"
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
# ── Find AEGIS CLI binary ────────────────────────────
|
|
76
|
+
function Find-AegisBin {
|
|
77
|
+
$paths = @(
|
|
78
|
+
"$env:APPDATA\npm\aegis.cmd",
|
|
79
|
+
"$env:APPDATA\npm\aegis-cli.cmd",
|
|
80
|
+
"$env:LOCALAPPDATA\npm\aegis.cmd",
|
|
81
|
+
"$env:LOCALAPPDATA\npm\aegis-cli.cmd",
|
|
82
|
+
"$env:USERPROFILE\.npm-global\aegis.cmd"
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
foreach ($p in $paths) {
|
|
86
|
+
if (Test-Path $p) { return $p }
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
# Try PATH
|
|
90
|
+
$onPath = Get-Command aegis -ErrorAction SilentlyContinue
|
|
91
|
+
if ($onPath) { return $onPath.Source }
|
|
92
|
+
|
|
93
|
+
$onPath = Get-Command aegis-cli -ErrorAction SilentlyContinue
|
|
94
|
+
if ($onPath) { return $onPath.Source }
|
|
95
|
+
|
|
96
|
+
return $null
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
# ── Create desktop shortcut ──────────────────────────
|
|
100
|
+
function Create-DesktopShortcut {
|
|
101
|
+
param([string]$Target)
|
|
102
|
+
|
|
103
|
+
$WScriptShell = New-Object -ComObject WScript.Shell
|
|
104
|
+
$desktop = [Environment]::GetFolderPath("Desktop")
|
|
105
|
+
$shortcutPath = Join-Path $desktop "AEGIS CLI.lnk"
|
|
106
|
+
$shortcut = $WScriptShell.CreateShortcut($shortcutPath)
|
|
107
|
+
|
|
108
|
+
# Alacritty binary path
|
|
109
|
+
$alacrittyPath = "$env:LOCALAPPDATA\alacritty\Alacritty.exe"
|
|
110
|
+
if (!(Test-Path $alacrittyPath)) {
|
|
111
|
+
$alacrittyPath = "C:\Program Files\Alacritty\Alacritty.exe"
|
|
112
|
+
}
|
|
113
|
+
if (!(Test-Path $alacrittyPath)) {
|
|
114
|
+
$alacrittyPath = (Get-Command alacritty -ErrorAction SilentlyContinue).Source
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
$shortcut.TargetPath = $alacrittyPath
|
|
118
|
+
$shortcut.Arguments = "-e `"$Target`""
|
|
119
|
+
$shortcut.Description = "Launch Alacritty with ÆGIS Code CLI"
|
|
120
|
+
$shortcut.IconLocation = "$env:SystemRoot\System32\shell32.dll,6"
|
|
121
|
+
$shortcut.WorkingDirectory = $env:USERPROFILE
|
|
122
|
+
$shortcut.Save()
|
|
123
|
+
|
|
124
|
+
Write-OK "Desktop shortcut created: $shortcutPath"
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
# ── Main ──────────────────────────────────────────────
|
|
128
|
+
Write-Host ""
|
|
129
|
+
Write-Host " ━━━ AEGIS CLI — Alacritty Installer ━━━" -ForegroundColor Cyan
|
|
130
|
+
Write-Host ""
|
|
131
|
+
|
|
132
|
+
Install-Alacritty
|
|
133
|
+
|
|
134
|
+
$aegisBin = Find-AegisBin
|
|
135
|
+
if (-not $aegisBin) {
|
|
136
|
+
Write-Warn "AEGIS CLI not found on PATH. Installing via npm..."
|
|
137
|
+
npm install -g aegiscode 2>&1 | Out-Null
|
|
138
|
+
$aegisBin = Find-AegisBin
|
|
139
|
+
if (-not $aegisBin) {
|
|
140
|
+
Write-Err "Could not find AEGIS CLI. Run: npm install -g aegiscode"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
Create-DesktopShortcut -Target $aegisBin
|
|
145
|
+
|
|
146
|
+
Write-Host ""
|
|
147
|
+
Write-OK "Done! Double-click the 'AEGIS CLI' shortcut on your desktop."
|
|
148
|
+
Write-Host " (If Alacritty was just installed, you may need to log out/in first.)"
|
|
149
|
+
Write-Host ""
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# ── Colors ──────────────────────────────────────────────
|
|
5
|
+
RED='\033[0;31m'; GREEN='\033[0;32m'; CYAN='\033[0;36m'
|
|
6
|
+
YELLOW='\033[1;33m'; NC='\033[0m'
|
|
7
|
+
log() { echo -e "${CYAN}→${NC} $1"; }
|
|
8
|
+
ok() { echo -e "${GREEN}✓${NC} $1"; }
|
|
9
|
+
warn() { echo -e "${YELLOW}⚠${NC} $1"; }
|
|
10
|
+
err() { echo -e "${RED}✗${NC} $1"; exit 1; }
|
|
11
|
+
|
|
12
|
+
# ── Detect platform ──────────────────────────────────────
|
|
13
|
+
OS="$(uname -s)"
|
|
14
|
+
ARCH="$(uname -m)"
|
|
15
|
+
|
|
16
|
+
install_alacritty_linux() {
|
|
17
|
+
if command -v alacritty &>/dev/null; then
|
|
18
|
+
ok "Alacritty already installed ($(alacritty --version))"
|
|
19
|
+
return 0
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
log "Installing Alacritty..."
|
|
23
|
+
|
|
24
|
+
# Detect package manager
|
|
25
|
+
if command -v apt-get &>/dev/null; then
|
|
26
|
+
sudo apt-get update -qq && sudo apt-get install -y -qq alacritty
|
|
27
|
+
elif command -v pacman &>/dev/null; then
|
|
28
|
+
sudo pacman -S --noconfirm alacritty
|
|
29
|
+
elif command -v dnf &>/dev/null; then
|
|
30
|
+
sudo dnf install -y alacritty
|
|
31
|
+
elif command -v zypper &>/dev/null; then
|
|
32
|
+
sudo zypper install -y alacritty
|
|
33
|
+
elif command -v snap &>/dev/null; then
|
|
34
|
+
sudo snap install alacritty --classic
|
|
35
|
+
else
|
|
36
|
+
warn "No known package manager. Trying cargo..."
|
|
37
|
+
if command -v cargo &>/dev/null; then
|
|
38
|
+
cargo install alacritty
|
|
39
|
+
else
|
|
40
|
+
err "Could not install Alacritty. Install manually: https://alacritty.org"
|
|
41
|
+
fi
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
if command -v alacritty &>/dev/null; then
|
|
45
|
+
ok "Alacritty installed ($(alacritty --version))"
|
|
46
|
+
else
|
|
47
|
+
warn "Alacritty installed but not on PATH — you may need to log out/in"
|
|
48
|
+
fi
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
install_alacritty_macos() {
|
|
52
|
+
if command -v alacritty &>/dev/null; then
|
|
53
|
+
ok "Alacritty already installed ($(alacritty --version))"
|
|
54
|
+
return 0
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
if ! command -v brew &>/dev/null; then
|
|
58
|
+
log "Installing Homebrew first..."
|
|
59
|
+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
log "Installing Alacritty via Homebrew..."
|
|
63
|
+
brew install --cask alacritty
|
|
64
|
+
ok "Alacritty installed"
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
# ── Create desktop launcher ──────────────────────────────────
|
|
68
|
+
create_launcher_linux() {
|
|
69
|
+
local launcher_dir="$HOME/.local/share/applications"
|
|
70
|
+
local desktop_path="$HOME/Desktop/aegis-cli.desktop"
|
|
71
|
+
mkdir -p "$launcher_dir"
|
|
72
|
+
|
|
73
|
+
# Find the aegis binary
|
|
74
|
+
local aegis_bin
|
|
75
|
+
aegis_bin="$(command -v aegis || command -v aegis-cli || echo "$HOME/.npm-global/bin/aegis")"
|
|
76
|
+
|
|
77
|
+
cat > /tmp/aegis-cli.desktop << DESKTOP_EOF
|
|
78
|
+
[Desktop Entry]
|
|
79
|
+
Version=1.0
|
|
80
|
+
Name=ÆGIS CLI Terminal
|
|
81
|
+
Comment=Launch Alacritty with ÆGIS Code CLI
|
|
82
|
+
Exec=alacritty -e $aegis_bin
|
|
83
|
+
Icon=utilities-terminal
|
|
84
|
+
Terminal=false
|
|
85
|
+
Type=Application
|
|
86
|
+
Categories=Development;Utility;
|
|
87
|
+
StartupWMClass=Alacritty
|
|
88
|
+
DESKTOP_EOF
|
|
89
|
+
|
|
90
|
+
cp /tmp/aegis-cli.desktop "$launcher_dir/aegis-cli.desktop"
|
|
91
|
+
chmod +x "$launcher_dir/aegis-cli.desktop"
|
|
92
|
+
|
|
93
|
+
# Also put on Desktop if it exists
|
|
94
|
+
if [ -d "$HOME/Desktop" ]; then
|
|
95
|
+
cp /tmp/aegis-cli.desktop "$desktop_path"
|
|
96
|
+
chmod +x "$desktop_path"
|
|
97
|
+
ok "Launcher placed on Desktop: $desktop_path"
|
|
98
|
+
fi
|
|
99
|
+
|
|
100
|
+
# Update desktop database so it shows in app menus
|
|
101
|
+
if command -v update-desktop-database &>/dev/null; then
|
|
102
|
+
update-desktop-database "$launcher_dir" 2>/dev/null || true
|
|
103
|
+
fi
|
|
104
|
+
|
|
105
|
+
ok "Desktop launcher created: ÆGIS CLI Terminal"
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
create_launcher_macos() {
|
|
109
|
+
local app_dir="$HOME/Desktop/AEGIS CLI.app"
|
|
110
|
+
local aegis_bin
|
|
111
|
+
aegis_bin="$(command -v aegis || command -v aegis-cli || echo "/opt/homebrew/bin/aegis")"
|
|
112
|
+
local alacritty_bin="/Applications/Alacritty.app/Contents/MacOS/alacritty"
|
|
113
|
+
|
|
114
|
+
# Create macOS .app bundle on desktop
|
|
115
|
+
mkdir -p "$app_dir/Contents/MacOS"
|
|
116
|
+
cat > "$app_dir/Contents/Info.plist" << PLIST_EOF
|
|
117
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
118
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
119
|
+
<plist version="1.0">
|
|
120
|
+
<dict>
|
|
121
|
+
<key>CFBundleExecutable</key>
|
|
122
|
+
<string>aegis-launcher</string>
|
|
123
|
+
<key>CFBundleName</key>
|
|
124
|
+
<string>ÆGIS CLI</string>
|
|
125
|
+
<key>CFBundleIdentifier</key>
|
|
126
|
+
<string>org.aegiscli.launcher</string>
|
|
127
|
+
<key>CFBundlePackageType</key>
|
|
128
|
+
<string>APPL</string>
|
|
129
|
+
</dict>
|
|
130
|
+
</plist>
|
|
131
|
+
PLIST_EOF
|
|
132
|
+
|
|
133
|
+
cat > "$app_dir/Contents/MacOS/aegis-launcher" << LAUNCHER_SH
|
|
134
|
+
#!/bin/bash
|
|
135
|
+
exec "$alacritty_bin" -e "$aegis_bin"
|
|
136
|
+
LAUNCHER_SH
|
|
137
|
+
chmod +x "$app_dir/Contents/MacOS/aegis-launcher"
|
|
138
|
+
ok "macOS app created: $app_dir"
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
# ── Main ──────────────────────────────────────────────
|
|
142
|
+
echo ""
|
|
143
|
+
echo " ${CYAN}━━━ AEGIS CLI — Alacritty Installer ━━━${NC}"
|
|
144
|
+
echo ""
|
|
145
|
+
|
|
146
|
+
case "$OS" in
|
|
147
|
+
Linux)
|
|
148
|
+
install_alacritty_linux
|
|
149
|
+
create_launcher_linux
|
|
150
|
+
;;
|
|
151
|
+
Darwin)
|
|
152
|
+
install_alacritty_macos
|
|
153
|
+
create_launcher_macos
|
|
154
|
+
;;
|
|
155
|
+
*)
|
|
156
|
+
err "Unsupported OS: $OS"
|
|
157
|
+
;;
|
|
158
|
+
esac
|
|
159
|
+
|
|
160
|
+
echo ""
|
|
161
|
+
ok "Done! Double-click the desktop icon to launch Alacritty + AEGIS CLI."
|
|
162
|
+
echo ""
|