Repository navigation
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·68 lines (59 loc) · 1.77 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·68 lines (59 loc) · 1.77 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
#!/usr/bin/env bash
# install.sh — Build and install squad binaries from source
set -euo pipefail
BOLD="\033[1m"
GREEN="\033[32m"
YELLOW="\033[33m"
RED="\033[31m"
RESET="\033[0m"
info() { echo -e "${BOLD}${GREEN}✓${RESET} $*"; }
warning() { echo -e "${BOLD}${YELLOW}⚠${RESET} $*"; }
error() { echo -e "${BOLD}${RED}✗${RESET} $*" >&2; exit 1; }
echo -e "${BOLD}squad installer${RESET}"
echo ""
# 1. Require cargo
if ! command -v cargo &>/dev/null; then
error "cargo not found. Install Rust from https://rustup.rs then re-run this script."
fi
CARGO_VERSION=$(cargo --version)
info "Found $CARGO_VERSION"
# 2. Build & install
echo ""
echo "Installing squad …"
cargo install --path "$(dirname "$0")" --locked
# 3. Install slash commands for detected AI tools
echo ""
echo "Installing /squad slash command for detected AI tools…"
squad setup || warning "squad setup failed (non-fatal)"
# 4. PATH check (renumbered)
CARGO_BIN="$HOME/.cargo/bin"
case ":${PATH}:" in
*":${CARGO_BIN}:"*)
info "$CARGO_BIN is already in PATH"
;;
*)
warning "$CARGO_BIN is not in your PATH."
echo ""
echo " Add the following line to your shell profile (~/.bashrc, ~/.zshrc, etc.):"
echo ""
echo ' export PATH="$HOME/.cargo/bin:$PATH"'
echo ""
echo " Then restart your shell or run: source ~/.zshrc"
;;
esac
# 5. Success message
echo ""
info "Installation complete!"
echo ""
echo -e "${BOLD}Quick Start:${RESET}"
echo ""
echo " 1. Go to your project directory:"
echo " cd my-project"
echo ""
echo " 2. Initialize a squad workspace:"
echo " squad init"
echo ""
echo " 3. In any AI CLI terminal, use the slash command:"
echo " /squad manager"
echo ""
echo " Run 'squad help' for all commands."