-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinstall.sh
More file actions
110 lines (95 loc) · 5.52 KB
/
Copy pathinstall.sh
File metadata and controls
110 lines (95 loc) · 5.52 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/env bash
# ─────────────────────────────────────────────────────────────────
# Neuron OS — installer for Linux and macOS
# Usage: curl -fsSL https://raw.githubusercontent.com/KunjShah95/neuron-os/main/install.sh | bash
# Options: NEURON_VERSION=0.2.1 NEURON_INSTALL_DIR=/usr/local/bin bash install.sh
#
# Windows users: run PowerShell as Admin and paste:
# irm https://raw.githubusercontent.com/KunjShah95/neuron-os/main/install.ps1 | iex
#
# No curl? Prefer npx:
# npx neuron-aegis
# ─────────────────────────────────────────────────────────────────
set -euo pipefail
REPO="KunjShah95/neuron-os"
BINARY_NAME="aegis"
VERSION="${NEURON_VERSION:-latest}"
INSTALL_DIR="${NEURON_INSTALL_DIR:-${HOME}/.local/bin}"
TMP_DIR="$(mktemp -d)"
trap 'rm -rf "$TMP_DIR"' EXIT
# ── Helpers ──────────────────────────────────────────────────────
log() { printf '\033[1;34m▸\033[0m %s\n' "$*"; }
ok() { printf '\033[1;32m✓\033[0m %s\n' "$*"; }
warn() { printf '\033[1;33m!\033[0m %s\n' "$*" >&2; }
die() { printf '\033[1;31m✗\033[0m %s\n' "$*" >&2; exit 1; }
# ── Banner ───────────────────────────────────────────────────────
echo ""
printf '\033[1;36m █████╗ ███████╗ ██████╗ ██╗███████╗\033[0m\n'
printf '\033[1;36m ██╔══██╗██╔════╝██╔════╝ ██║██╔════╝\033[0m\n'
printf '\033[1;36m ███████║█████╗ ██║ ███╗██║███████╗\033[0m\n'
printf '\033[1;36m ██╔══██║██╔══╝ ██║ ██║██║╚════██║\033[0m\n'
printf '\033[1;36m ██║ ██║███████╗╚██████╔╝██║███████║\033[0m\n'
printf '\033[1;36m ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝╚══════╝\033[0m\n'
echo ""
printf '\033[1;37m The Operating System for Autonomous AI Agents\033[0m\n'
printf '\033[2;37m GitHub: https://github.com/%s\033[0m\n' "$REPO"
echo ""
# ── Detect OS + arch ────────────────────────────────────────────
uname_s="$(uname -s)"
uname_m="$(uname -m)"
case "$uname_s" in
Linux*) os="linux" ;;
Darwin*) os="darwin" ;;
*) die "Unsupported OS: $uname_s. Windows users, run:\n irm https://raw.githubusercontent.com/$REPO/main/install.ps1 | iex\n Or use npx: npx neuron-aegis" ;;
esac
case "$uname_m" in
x86_64|amd64) arch="x64" ;;
aarch64|arm64) arch="arm64" ;;
*) die "Unsupported architecture: $uname_m" ;;
esac
asset="${BINARY_NAME}-${os}-${arch}"
# ── Resolve download URL ────────────────────────────────────────
if [ "$VERSION" = "latest" ]; then
download_url="https://github.com/${REPO}/releases/latest/download/${asset}"
else
download_url="https://github.com/${REPO}/releases/download/${VERSION}/${asset}"
fi
# ── Install ─────────────────────────────────────────────────────
log "Installing ${BINARY_NAME} ${VERSION} for ${os}/${arch}"
log "Target: ${INSTALL_DIR}/${BINARY_NAME}"
mkdir -p "$INSTALL_DIR"
curl -fL --retry 3 --connect-timeout 15 -o "$TMP_DIR/$asset" "$download_url" \
|| die "Download failed. Check that release $VERSION exists for $os/$arch.\n Alternatively: npx neuron-aegis"
chmod +x "$TMP_DIR/$asset"
mv "$TMP_DIR/$asset" "$INSTALL_DIR/$BINARY_NAME"
ok "Installed ${BINARY_NAME} to ${INSTALL_DIR}/${BINARY_NAME}"
# ── PATH hint ───────────────────────────────────────────────────
case ":$PATH:" in
*":${INSTALL_DIR}:"*) ;;
*)
warn "${INSTALL_DIR} is not in your PATH."
warn "Add this to your shell profile (~/.bashrc, ~/.zshrc, etc.):"
warn " export PATH=\"${INSTALL_DIR}:\$PATH\""
;;
esac
# ── Verify ──────────────────────────────────────────────────────
if command -v "$BINARY_NAME" >/dev/null 2>&1; then
installed_version="$("$BINARY_NAME" --version 2>/dev/null || echo 'unknown')"
ok "Run: ${BINARY_NAME} --version → ${installed_version}"
else
log "Restart your shell or source your profile, then run: ${BINARY_NAME} --version"
fi
# ── Next steps ──────────────────────────────────────────────────
echo ""
echo " ── Quick start ──"
echo ""
echo " Generate your first agent:"
echo " aegis"
echo ""
echo " Or dive straight in:"
echo " aegis status # system overview"
echo " aegis chat # streaming AI chat"
echo " aegis dashboard # live agent monitor"
echo " aegis serve # REST API server"
echo ""
ok "Done. Welcome to Neuron OS."