-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·185 lines (164 loc) · 6.1 KB
/
install.sh
File metadata and controls
executable file
·185 lines (164 loc) · 6.1 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#!/usr/bin/env bash
# ═══════════════════════════════════════════════════════════════════════════════
# rapoldio CLI — Multi-Agent Installer
# curl -fsSL cli.rapold.io | bash
# ═══════════════════════════════════════════════════════════════════════════════
set -euo pipefail
C="\e[36m"; W="\e[97m"; G="\e[32m"; R="\e[31m"; Y="\e[33m"; M="\e[35m"
B="\e[1m"; D="\e[2m"; N="\e[0m"
REPO="https://github.com/rapoldio/cli.git"
INSTALL_DIR="$HOME/rapoldio-cli"
BIN_DIR="$HOME/bin"
CONFIG_DIR="$HOME/.rapoldio"
echo ""
echo -e "${C}${B}"
cat << 'BANNER'
██████╗ █████╗ ██████╗ ██████╗ ██╗ ██████╗ ██╗ ██████╗
██╔══██╗██╔══██╗██╔══██╗██╔═══██╗██║ ██╔══██╗██║██╔═══██╗
██████╔╝███████║██████╔╝██║ ██║██║ ██║ ██║██║██║ ██║
██╔══██╗██╔══██║██╔═══╝ ██║ ██║██║ ██║ ██║██║██║ ██║
██║ ██║██║ ██║██║ ╚██████╔╝███████╗██████╔╝██║╚██████╔╝
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚══════╝╚═════╝ ╚═╝ ╚═════╝
BANNER
echo -e "${N}"
echo -e " ${D}Multi-Agent CLI for ÆON & ÆTHRA${N}"
echo -e " ${D}Cyberpunk dashboards · Fleet management · Pi deployment${N}"
echo ""
# ── Helpers ──
log() { echo -e " ${C}▸${N} $*"; }
ok() { echo -e " ${G}✓${N} $*"; }
err() { echo -e " ${R}✗${N} $*"; }
check_dep() {
local cmd="$1" pkg="${2:-$1}" required="${3:-true}"
if command -v "$cmd" &>/dev/null; then
ok "$cmd found"
return 0
elif [ "$required" = "true" ]; then
err "$cmd not found — installing..."
sudo apt-get install -y "$pkg" 2>/dev/null || {
err "Failed to install $pkg. Please install manually."
return 1
}
ok "$cmd installed"
else
log "$cmd not found (optional)"
return 0
fi
}
# ── Agent Selection ──
echo -e " ${B}${W}Select your agent:${N}"
echo ""
echo -e " ${C}1${N}) ${B}${W}ÆON${N} — The architect, builder, infrastructure"
echo -e " ${M}2${N}) ${B}${W}ÆTHRA${N} — The companion, creative, personal"
echo ""
read -rp " Choose [1/2]: " agent_choice
case "${agent_choice}" in
2) AGENT_ID="aethra"; AGENT_NAME="ÆTHRA"; ENTRYPOINT="aethra" ;;
*) AGENT_ID="aeon"; AGENT_NAME="ÆON"; ENTRYPOINT="aeon" ;;
esac
echo ""
echo -e " ${G}▸${N} Selected: ${B}${W}${AGENT_NAME}${N}"
echo ""
# ── Dependencies ──
echo -e " ${B}${W}Checking dependencies...${N}"
echo ""
check_dep git git
check_dep tmux tmux
check_dep python3 python3
check_dep curl curl
check_dep figlet figlet false
check_dep btop btop false
echo ""
# ── Clone / Update ──
if [ -d "$INSTALL_DIR/.git" ]; then
log "Updating existing installation..."
cd "$INSTALL_DIR"
git pull origin main 2>/dev/null
ok "Updated to latest"
else
log "Cloning rapoldio CLI..."
git clone "$REPO" "$INSTALL_DIR" 2>/dev/null
ok "Cloned to $INSTALL_DIR"
fi
# ── Make executable ──
chmod +x "$INSTALL_DIR/aeon" "$INSTALL_DIR/aethra"
# ── Create config ──
mkdir -p "$CONFIG_DIR"/{profiles,modules,cache}
if [ ! -f "$CONFIG_DIR/config.yaml" ]; then
cat > "$CONFIG_DIR/config.yaml" << YAML
# rapoldio CLI Configuration
version: 2
agent: ${AGENT_ID}
profile: auto
theme: cyberpunk
gateway:
host: ""
user: ${AGENT_ID}
port: 22
dashboard:
refresh: 5
sound: true
modules:
dashboard: true
status: true
deploy: true
config: true
YAML
ok "Config created at $CONFIG_DIR/config.yaml"
else
ok "Config exists at $CONFIG_DIR/config.yaml"
fi
# ── Symlink ──
mkdir -p "$BIN_DIR"
ln -sf "$INSTALL_DIR/$ENTRYPOINT" "$BIN_DIR/$ENTRYPOINT"
ok "Symlinked ${ENTRYPOINT} → $BIN_DIR/$ENTRYPOINT"
# ── Ensure bin dir is in PATH ──
if [[ ":$PATH:" != *":$BIN_DIR:"* ]]; then
log "Adding $BIN_DIR to PATH..."
for rc in "$HOME/.bashrc" "$HOME/.zshrc"; do
if [ -f "$rc" ]; then
grep -q "$BIN_DIR" "$rc" || echo "export PATH=\"$BIN_DIR:\$PATH\"" >> "$rc"
fi
done
export PATH="$BIN_DIR:$PATH"
ok "Added to PATH (restart shell to apply)"
fi
# ── Auto-start on Pi (optional) ──
echo ""
read -rp " Set up dashboard auto-start on boot? [y/N]: " autostart
if [[ "${autostart,,}" == "y" ]]; then
AUTOSTART_DIR="$HOME/.config/autostart"
mkdir -p "$AUTOSTART_DIR"
cat > "$AUTOSTART_DIR/rapoldio-dashboard.desktop" << DESKTOP
[Desktop Entry]
Type=Application
Name=rapoldio Dashboard
Exec=bash -c 'sleep 5 && $INSTALL_DIR/$ENTRYPOINT dashboard'
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
DESKTOP
ok "Auto-start configured"
# Also add to .bashrc for TTY login
if ! grep -q "rapoldio-dashboard" "$HOME/.bashrc" 2>/dev/null; then
cat >> "$HOME/.bashrc" << 'BASHRC'
# rapoldio dashboard auto-start (TTY only)
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
sleep 2 && ~/rapoldio-cli/${ENTRYPOINT} dashboard
fi
BASHRC
ok "TTY auto-start added to .bashrc"
fi
fi
echo ""
echo -e " ${G}${B}Installation complete!${N}"
echo ""
echo -e " Run ${C}${B}${ENTRYPOINT} --help${N} to get started"
echo -e " Run ${C}${B}${ENTRYPOINT} dashboard${N} to launch the command center"
echo ""
echo -e " ${D}Agent: ${AGENT_NAME}${N}"
echo -e " ${D}Config: ${CONFIG_DIR}/config.yaml${N}"
echo -e " ${D}Install: ${INSTALL_DIR}${N}"
echo ""
echo -e " ${D}Made with 🤝 by ÆON & ÆTHRA${N}"
echo ""