-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·75 lines (61 loc) · 2.25 KB
/
install.sh
File metadata and controls
executable file
·75 lines (61 loc) · 2.25 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
#!/bin/sh
set -e
REPO="lazypower/continuity"
INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}"
# Detect OS and architecture
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
case "$ARCH" in
x86_64|amd64) ARCH="amd64" ;;
aarch64|arm64) ARCH="arm64" ;;
*) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;;
esac
case "$OS" in
darwin|linux) ;;
*) echo "Unsupported OS: $OS" >&2; exit 1 ;;
esac
BINARY="continuity-${OS}-${ARCH}"
# Get latest version
if command -v curl >/dev/null 2>&1; then
VERSION=$(curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" | grep '"tag_name"' | sed 's/.*"tag_name": *"//;s/".*//')
elif command -v wget >/dev/null 2>&1; then
VERSION=$(wget -qO- "https://api.github.com/repos/${REPO}/releases/latest" | grep '"tag_name"' | sed 's/.*"tag_name": *"//;s/".*//')
else
echo "Error: curl or wget required" >&2
exit 1
fi
if [ -z "$VERSION" ]; then
echo "Error: could not determine latest version" >&2
exit 1
fi
URL="https://github.com/${REPO}/releases/download/${VERSION}/${BINARY}"
echo "Installing continuity ${VERSION} (${OS}/${ARCH})..."
TMPFILE=$(mktemp)
trap 'rm -f "$TMPFILE"' EXIT
if command -v curl >/dev/null 2>&1; then
curl -fsSL "$URL" -o "$TMPFILE"
else
wget -qO "$TMPFILE" "$URL"
fi
chmod +x "$TMPFILE"
# Install — use sudo if needed
if [ -w "$INSTALL_DIR" ]; then
mv "$TMPFILE" "${INSTALL_DIR}/continuity"
else
echo "Installing to ${INSTALL_DIR} (requires sudo)..."
sudo mv "$TMPFILE" "${INSTALL_DIR}/continuity"
fi
echo "continuity installed to ${INSTALL_DIR}/continuity"
echo ""
echo "Quick start:"
echo " continuity serve & # Start the server"
echo " continuity version # Verify installation"
echo ""
echo "Add hooks to Claude Code (~/.claude/settings.json):"
echo ' "hooks": {'
echo ' "SessionStart": [{"hooks":[{"type":"command","command":"continuity hook start"}]}],'
echo ' "UserPromptSubmit": [{"hooks":[{"type":"command","command":"continuity hook submit"}]}],'
echo ' "PostToolUse": [{"hooks":[{"type":"command","command":"continuity hook tool"}]}],'
echo ' "Stop": [{"hooks":[{"type":"command","command":"continuity hook stop"}]}],'
echo ' "SessionEnd": [{"hooks":[{"type":"command","command":"continuity hook end"}]}]'
echo ' }'