-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·128 lines (112 loc) · 6.39 KB
/
install.sh
File metadata and controls
executable file
·128 lines (112 loc) · 6.39 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/usr/bin/env bash
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Shipwright — One-Command Installer ║
# ║ ║
# ║ Usage: ./install.sh [--repair] [--deploy] [--no-claude-md] ║
# ║ ║
# ║ This is the single entry point. It checks prerequisites, then ║
# ║ delegates to `shipwright init` which handles everything: ║
# ║ tmux config + overlay + TPM + plugins ║
# ║ CLI symlinks (sw, shipwright) + PATH ║
# ║ Claude Code settings + hooks + CLAUDE.md ║
# ║ Team & pipeline templates + shell completions ║
# ║ iTerm2 fixes + doctor validation ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# ─── Colors ──────────────────────────────────────────────────────────────────
CYAN='\033[38;2;0;212;255m'
GREEN='\033[38;2;34;197;94m'
YELLOW='\033[38;2;250;204;21m'
RED='\033[38;2;239;68;68m'
DIM='\033[2m'
BOLD='\033[1m'
RESET='\033[0m'
# ─── Banner ──────────────────────────────────────────────────────────────────
echo ""
echo -e "${CYAN}╔═══════════════════════════════════════════════════════════╗${RESET}"
echo -e "${CYAN}║${RESET} ${BOLD}Shipwright${RESET} ${CYAN}║${RESET}"
echo -e "${CYAN}║${RESET} ${DIM}One-command installer for Claude Code agent teams${RESET} ${CYAN}║${RESET}"
echo -e "${CYAN}╚═══════════════════════════════════════════════════════════╝${RESET}"
echo ""
# ─── Help ────────────────────────────────────────────────────────────────────
for arg in "$@"; do
case "$arg" in
--help|-h)
echo "Usage: ./install.sh [options]"
echo ""
echo "Options (passed through to shipwright init):"
echo " --repair Force clean reinstall of tmux config, plugins, and adapters"
echo " --deploy Detect deploy platform and generate pipeline template"
echo " --platform PLATFORM Skip detection, use specified platform (vercel|fly|railway|docker)"
echo " --no-claude-md Skip creating .claude/CLAUDE.md"
echo " --help, -h Show this help"
echo ""
echo "One-liner from source:"
echo " git clone https://github.com/sethdford/shipwright.git && cd shipwright && ./install.sh"
echo ""
echo "Remote install (latest release):"
echo " curl -fsSL https://raw.githubusercontent.com/sethdford/shipwright/main/scripts/install-remote.sh | bash"
exit 0
;;
esac
done
# ─── Prerequisite Check ─────────────────────────────────────────────────────
MISSING=()
if command -v tmux &>/dev/null; then
echo -e "${GREEN}✓${RESET} tmux $(tmux -V | grep -oE '[0-9]+\.[0-9a-z]+')"
else
MISSING+=("tmux — brew install tmux")
fi
if command -v git &>/dev/null; then
echo -e "${GREEN}✓${RESET} git $(git --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')"
else
MISSING+=("git")
fi
if command -v node &>/dev/null; then
NODE_MAJOR="$(node -v | tr -d 'v' | cut -d. -f1)"
if [[ "$NODE_MAJOR" -ge 20 ]]; then
echo -e "${GREEN}✓${RESET} Node.js $(node -v | tr -d 'v')"
else
echo -e "${YELLOW}!${RESET} Node.js $(node -v) (20+ recommended)"
fi
else
MISSING+=("node — https://nodejs.org")
fi
if command -v jq &>/dev/null; then
echo -e "${GREEN}✓${RESET} jq $(jq --version 2>/dev/null | tr -d 'jq-')"
else
MISSING+=("jq — brew install jq")
fi
if command -v claude &>/dev/null || [[ -x "$HOME/.local/bin/claude" ]]; then
echo -e "${GREEN}✓${RESET} Claude Code CLI"
else
echo -e "${YELLOW}!${RESET} Claude Code CLI not found (install later: npm i -g @anthropic-ai/claude-code)"
fi
if command -v gh &>/dev/null; then
echo -e "${GREEN}✓${RESET} gh CLI $(gh --version 2>/dev/null | head -1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')"
else
echo -e "${YELLOW}!${RESET} gh CLI not found (optional: brew install gh)"
fi
if command -v bun &>/dev/null || [[ -x "$HOME/.bun/bin/bun" ]]; then
BUN_CMD="${HOME}/.bun/bin/bun"
command -v bun &>/dev/null && BUN_CMD="bun"
echo -e "${GREEN}✓${RESET} Bun $($BUN_CMD --version 2>/dev/null || echo "installed")"
else
echo -e "${YELLOW}!${RESET} Bun not found — required for ${BOLD}shipwright dashboard${RESET}"
echo -e " ${DIM}Install: curl -fsSL https://bun.sh/install | bash${RESET}"
fi
echo ""
if [[ ${#MISSING[@]} -gt 0 ]]; then
echo -e "${RED}${BOLD}Missing required tools:${RESET}"
for m in "${MISSING[@]}"; do
echo -e " ${RED}✗${RESET} $m"
done
echo ""
echo -e "Install the above and re-run: ${BOLD}./install.sh${RESET}"
exit 1
fi
echo -e "${GREEN}✓${RESET} ${BOLD}All prerequisites met${RESET}"
echo ""
# ─── Delegate to shipwright init ─────────────────────────────────────────────
exec "$SCRIPT_DIR/scripts/sw-init.sh" "$@"