-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
60 lines (50 loc) · 1.75 KB
/
Copy pathinstall.sh
File metadata and controls
60 lines (50 loc) · 1.75 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
#!/usr/bin/env bash
# AgentiCode installer — downloads prebuilt binary for your platform
# Usage: curl -fsSL https://raw.githubusercontent.com/kyaky/agenticode/master/install.sh | bash
set -euo pipefail
REPO="kyaky/agenticode"
NAME="agenticode"
INSTALL_DIR="${AGENTICODE_INSTALL_DIR:-${XDG_BIN_DIR:-$HOME/.local/bin}}"
# Detect platform
case "$(uname -s)" in
Linux*) PLATFORM="linux" ;;
Darwin*) PLATFORM="darwin" ;;
MINGW*|MSYS*|CYGWIN*) PLATFORM="windows" ;;
*) echo "Unsupported OS: $(uname -s)"; exit 1 ;;
esac
# Detect architecture
case "$(uname -m)" in
x86_64|amd64) ARCH="x64" ;;
arm64|aarch64) ARCH="arm64" ;;
*) echo "Unsupported architecture: $(uname -m)"; exit 1 ;;
esac
SUFFIX=""
[ "$PLATFORM" = "windows" ] && SUFFIX=".exe"
BINARY="${NAME}-${PLATFORM}-${ARCH}${SUFFIX}"
# Get latest release URL
echo "Detecting latest AgentiCode release..."
RELEASE_URL="https://github.com/${REPO}/releases/latest/download/${BINARY}"
# Create install directory
mkdir -p "$INSTALL_DIR"
# Download
echo "Downloading ${BINARY}..."
curl -fsSL -o "${INSTALL_DIR}/${NAME}${SUFFIX}" "$RELEASE_URL"
chmod +x "${INSTALL_DIR}/${NAME}${SUFFIX}"
# Add to PATH if needed
if ! echo "$PATH" | grep -q "$INSTALL_DIR"; then
SHELL_CONFIG=""
case "$SHELL" in
*/zsh) SHELL_CONFIG="$HOME/.zshrc" ;;
*/bash) SHELL_CONFIG="$HOME/.bashrc" ;;
*/fish) SHELL_CONFIG="$HOME/.config/fish/config.fish" ;;
esac
if [ -n "$SHELL_CONFIG" ]; then
echo "" >> "$SHELL_CONFIG"
echo "# AgentiCode" >> "$SHELL_CONFIG"
echo "export PATH=\"${INSTALL_DIR}:\$PATH\"" >> "$SHELL_CONFIG"
echo "Added ${INSTALL_DIR} to PATH in ${SHELL_CONFIG}"
fi
fi
echo ""
echo "AgentiCode installed to ${INSTALL_DIR}/${NAME}${SUFFIX}"
echo "Restart your terminal, then run: agenticode"