-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·62 lines (52 loc) · 1.9 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·62 lines (52 loc) · 1.9 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
#!/usr/bin/env bash
#
# agentic-dev-setup bootstrapper.
#
# ./setup.sh install / configure everything (idempotent)
# ./setup.sh wezterm tmux only those tools
# ./setup.sh --list show available tools
#
# Safe to re-run. Each tool's logic lives in scripts/<tool>.sh.
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export REPO_ROOT
# shellcheck source=scripts/lib.sh
source "$REPO_ROOT/scripts/lib.sh"
# Install order follows the video's arc: ship -> crew onboarding -> tools.
# axi/lavish install their guidance skills globally; their executable (PromptScript)
# parts run per-project / on demand via npx (see docs/tools/{axi,lavish}.md).
TOOLS=(wezterm tmux nvim memory skills local-skills pi axi lavish no-mistakes treehouse gnhf firstmate)
usage() { sed -n '2,12p' "$0" | sed 's/^# \{0,1\}//'; }
ensure_homebrew() {
step "Homebrew"
if have brew; then ok "Homebrew present ($(brew --version | head -1))"; return; fi
info "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Apple Silicon path
[ -x /opt/homebrew/bin/brew ] && eval "$(/opt/homebrew/bin/brew shellenv)"
}
run_tool() {
local t="$1" script="$REPO_ROOT/scripts/${1}.sh"
local fn="install_${t//-/_}" # hyphens aren't legal in bash fn names
if [ ! -f "$script" ]; then warn "no installer for '$t' yet (scripts/${t}.sh missing) — skipping"; return; fi
step "$t"
# shellcheck disable=SC1090
source "$script"
"$fn"
}
main() {
case "${1:-}" in
-h|--help) usage; exit 0 ;;
--list) printf '%s\n' "${TOOLS[@]}"; exit 0 ;;
esac
ensure_homebrew
if [ "$#" -eq 0 ]; then
info "Installing all tools: ${TOOLS[*]}"
for t in "${TOOLS[@]}"; do run_tool "$t"; done
else
for t in "$@"; do run_tool "$t"; done
fi
step "Done"
ok "Setup complete. Open a new terminal to pick up shell changes."
}
main "$@"