-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·86 lines (72 loc) · 2.18 KB
/
install.sh
File metadata and controls
executable file
·86 lines (72 loc) · 2.18 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
#!/usr/bin/env bash
set -euo pipefail
REPO="nka11/semantic-code-mcp"
BINARY="semantic-code-mcp"
INSTALL_DIR="${HOME}/.local/bin"
# Use VERSION env var or default to "latest"
VERSION="${VERSION:-latest}"
# Detect OS
OS="$(uname -s)"
case "${OS}" in
Linux) OS_TARGET="unknown-linux-gnu" ;;
Darwin) OS_TARGET="apple-darwin" ;;
*)
echo "Error: Unsupported OS '${OS}'. Please download manually from:"
echo " https://github.com/${REPO}/releases"
exit 1
;;
esac
# Detect architecture
ARCH="$(uname -m)"
case "${ARCH}" in
x86_64|amd64) ARCH_TARGET="x86_64" ;;
aarch64|arm64) ARCH_TARGET="aarch64" ;;
*)
echo "Error: Unsupported architecture '${ARCH}'. Please download manually from:"
echo " https://github.com/${REPO}/releases"
exit 1
;;
esac
TARGET="${ARCH_TARGET}-${OS_TARGET}"
ASSET="${BINARY}-${TARGET}.tar.gz"
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
echo "Installing ${BINARY} (${VERSION}) for ${TARGET}..."
echo "Downloading from: ${DOWNLOAD_URL}"
# Create install directory
mkdir -p "${INSTALL_DIR}"
# Download and extract
TMPDIR="$(mktemp -d)"
trap 'rm -rf "${TMPDIR}"' EXIT
if ! curl -fsSL "${DOWNLOAD_URL}" -o "${TMPDIR}/${ASSET}"; then
echo "Error: Download failed. Check that the release exists:"
echo " https://github.com/${REPO}/releases"
exit 1
fi
tar xzf "${TMPDIR}/${ASSET}" -C "${TMPDIR}"
install -m 755 "${TMPDIR}/${BINARY}" "${INSTALL_DIR}/${BINARY}"
echo ""
echo "Installed ${BINARY} to ${INSTALL_DIR}/${BINARY}"
# Check if install dir is in PATH
if ! echo "${PATH}" | tr ':' '\n' | grep -qx "${INSTALL_DIR}"; then
echo ""
echo "WARNING: ${INSTALL_DIR} is not in your PATH."
echo "Add it with:"
echo " export PATH=\"${INSTALL_DIR}:\${PATH}\""
echo ""
echo "To make it permanent, add the line above to your ~/.bashrc or ~/.zshrc"
fi
echo ""
echo "Configure in ~/.claude.json:"
echo ' {'
echo ' "mcpServers": {'
echo ' "semantic-code-mcp": {'
echo " \"command\": \"${INSTALL_DIR}/${BINARY}\""
echo ' }'
echo ' }'
echo ' }'
echo ""
echo "Done!"