-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·54 lines (45 loc) · 1.27 KB
/
install.sh
File metadata and controls
executable file
·54 lines (45 loc) · 1.27 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
#!/bin/bash
set -e
REPO="https://github.com/DengShiyingA/Sentinel.git"
INSTALL_DIR="$HOME/.sentinel/cli"
echo ""
echo " 🛡️ Sentinel Installer"
echo ""
# Check Node.js
if ! command -v node &>/dev/null; then
echo " ✗ Node.js not found. Install from https://nodejs.org (v20+)"
exit 1
fi
NODE_VER=$(node -e "console.log(process.versions.node.split('.')[0])")
if [ "$NODE_VER" -lt 18 ]; then
echo " ✗ Node.js v18+ required (found v$NODE_VER)"
exit 1
fi
# Clone or update
if [ -d "$INSTALL_DIR/.git" ]; then
echo " ↻ Updating existing install..."
git -C "$INSTALL_DIR" pull --quiet
else
echo " ↓ Downloading Sentinel..."
rm -rf "$INSTALL_DIR"
git clone --quiet --depth 1 "$REPO" "$INSTALL_DIR"
fi
# Build CLI
echo " ⚙ Building CLI..."
cd "$INSTALL_DIR/packages/sentinel-cli"
npm install --silent
npm run build --silent
# Link globally
npm link --silent 2>/dev/null || sudo npm link --silent
# Inject Claude Code hook
echo " 🔗 Installing Claude Code hook..."
sentinel install
echo ""
echo " ✅ Done! Sentinel installed."
echo ""
echo " Usage:"
echo " sentinel run # start with Claude Code (recommended)"
echo " sentinel start # start hook server only"
echo ""
echo " Open Sentinel on your iPhone → scan the QR code to connect."
echo ""