-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·455 lines (381 loc) · 11.3 KB
/
setup.sh
File metadata and controls
executable file
·455 lines (381 loc) · 11.3 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
#!/bin/bash
# macOS Setup Script
# Installs Homebrew, apps, CLI tools, fonts, and links dotfiles
set -u
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
log_info() { echo -e "${BLUE}ℹ${NC} $1"; }
log_success() { echo -e "${GREEN}✓${NC} $1"; }
log_warning() { echo -e "${YELLOW}⚠${NC} $1"; }
log_error() { echo -e "${RED}✗${NC} $1"; }
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DRY_RUN=false
if [[ "${1:-}" == "--dry-run" ]]; then
DRY_RUN=true
log_info "Dry run mode — nothing will be installed"
fi
if [[ "$OSTYPE" != "darwin"* ]]; then
log_error "This script is designed for macOS only."
exit 1
fi
if [[ $(uname -m) != "arm64" ]]; then
log_warning "This script is optimized for Apple Silicon. You're running on $(uname -m)."
fi
log_info "Starting macOS setup..."
# ============================================================================
# Xcode Command Line Tools
# ============================================================================
log_info "Checking for Xcode Command Line Tools..."
if ! xcode-select -p &> /dev/null; then
log_warning "Xcode Command Line Tools not found."
xcode-select --install
log_info "Please complete the installation, then run this script again."
exit 0
else
log_success "Xcode Command Line Tools are installed"
fi
# ============================================================================
# Homebrew
# ============================================================================
log_info "Checking for Homebrew..."
if ! command -v brew &> /dev/null; then
if $DRY_RUN; then
log_warning "WOULD install Homebrew"
else
log_info "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
if [[ $(uname -m) == "arm64" ]]; then
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
log_success "Homebrew installed"
fi
else
log_success "Homebrew is already installed"
fi
if ! $DRY_RUN; then
log_info "Updating Homebrew..."
brew update
fi
# ============================================================================
# Homebrew Taps
# ============================================================================
log_info "Adding Homebrew taps..."
if ! $DRY_RUN; then
brew tap steipete/tap 2>/dev/null || true
brew tap zackbart/tap 2>/dev/null || true
brew tap yakitrak/yakitrak 2>/dev/null || true
brew tap stripe/stripe-cli 2>/dev/null || true
brew tap supabase/tap 2>/dev/null || true
fi
# ============================================================================
# GUI Applications (Homebrew Casks)
# ============================================================================
log_info "Installing GUI applications..."
CASK_APPS=(
# Browsers
"google-chrome"
# Development
"android-studio"
"docker-desktop"
"ghostty"
"lm-studio"
"visual-studio-code"
# AI & Productivity
"claude"
"cmux"
"obsidian"
"notion-calendar"
"superset"
# Utilities
"appcleaner"
"balenaetcher"
"clop"
"cyberduck"
"handy"
"localsend"
"rustdesk"
"send-to-kindle"
"wifiman"
# Media
"anki"
"handbrake-app"
"obs"
"spotify"
"vlc"
# Networking
"mitmproxy"
"mullvad-vpn"
"ngrok"
"termius"
"twingate"
"vb-cable"
# Communication
"discord"
"zoom"
# Database
"beekeeper-studio"
# Gaming
"heroic"
# Virtualization
"utm"
# CLI tools distributed as casks
"claude-code"
"codex"
"cursor-cli"
)
for app in "${CASK_APPS[@]}"; do
if brew list --cask "$app" &> /dev/null 2>&1; then
log_success "$app is already installed"
elif $DRY_RUN; then
log_warning "WOULD install cask: $app"
else
log_info "Installing $app..."
if brew install --cask "$app" 2>&1; then
log_success "$app installed"
else
log_warning "Failed to install $app"
fi
fi
done
log_success "GUI applications complete"
# ============================================================================
# Mac App Store Apps (via mas)
# ============================================================================
log_info "Installing Mac App Store apps..."
if ! command -v mas &> /dev/null; then
if $DRY_RUN; then
log_warning "WOULD install mas (Mac App Store CLI)"
else
brew install mas
fi
fi
# Format: "id:name"
MAS_APPS=(
"937984704:Amphetamine"
"1452453066:Hidden Bar"
"1451685025:WireGuard"
"899247664:TestFlight"
"497799835:Xcode"
)
for entry in "${MAS_APPS[@]}"; do
id="${entry%%:*}"
name="${entry##*:}"
if mas list | grep -q "^$id "; then
log_success "$name is already installed"
elif $DRY_RUN; then
log_warning "WOULD install from App Store: $name ($id)"
else
log_info "Installing $name..."
if mas install "$id" 2>&1; then
log_success "$name installed"
else
log_warning "Failed to install $name (are you signed into the App Store?)"
fi
fi
done
log_success "App Store apps complete"
# ============================================================================
# Fonts
# ============================================================================
log_info "Installing fonts..."
FONTS=(
"font-jetbrains-mono"
"font-jetbrains-mono-nerd-font"
"font-symbols-only-nerd-font"
)
for font in "${FONTS[@]}"; do
if brew list --cask "$font" &> /dev/null 2>&1; then
log_success "$font is already installed"
elif $DRY_RUN; then
log_warning "WOULD install font: $font"
else
log_info "Installing $font..."
brew install --cask "$font" 2>&1 && log_success "$font installed" || log_warning "Failed to install $font"
fi
done
# ============================================================================
# CLI Tools (Homebrew Formulae)
# ============================================================================
log_info "Installing CLI tools..."
CLI_TOOLS=(
# Shell & prompt
"starship"
"zoxide"
"fzf"
"tmux"
# Modern coreutils replacements
"bat"
"eza"
"fd"
"ripgrep"
"difftastic"
# Git
"gh"
"lazygit"
# File managers
"yazi"
"superfile"
# System monitoring
"bottom"
# Docker
"lazydocker"
# Languages & runtimes
"asdf"
"node"
"pnpm"
"go"
"openjdk@17"
"python@3.14"
"uv"
# TypeScript & Python tooling
"typescript"
"typescript-language-server"
"pyright"
# Data
"jq"
"duckdb"
# Media processing
"ffmpeg"
"imagemagick"
"sox"
# Documents
"pandoc"
"poppler"
# Cloud & deploy
"supabase"
"stripe"
"railway"
"firebase-cli"
"sentry-cli"
# Security
"trufflehog"
"gnupg"
"certbot"
# Images & rendering
"chafa"
"resvg"
# Database client
"libpq"
# Utilities
"cloc"
"happy-coder"
"sevenzip"
"opencode"
"mas"
# Tap tools (steipete)
"steipete/tap/imsg"
"steipete/tap/summarize"
# Tap tools (zackbart)
"zackbart/tap/cleenup"
"zackbart/tap/seer"
"zackbart/tap/werk"
# Tap tools (other)
"yakitrak/yakitrak/obsidian-cli"
)
for tool in "${CLI_TOOLS[@]}"; do
if brew list "$tool" &> /dev/null 2>&1; then
log_success "$tool is already installed"
elif $DRY_RUN; then
log_warning "WOULD install formula: $tool"
else
log_info "Installing $tool..."
if brew install "$tool" 2>&1; then
log_success "$tool installed"
else
log_warning "Failed to install $tool"
fi
fi
done
log_success "CLI tools complete"
# ============================================================================
# Global npm Packages
# ============================================================================
log_info "Installing global npm packages..."
NPM_PACKAGES=(
"@dbml/cli"
"@googleworkspace/cli"
"@steipete/bird"
"agent-browser"
"defuddle"
"playwriter"
"skills"
)
for pkg in "${NPM_PACKAGES[@]}"; do
if npm list -g "$pkg" &> /dev/null 2>&1; then
log_success "$pkg is already installed"
elif $DRY_RUN; then
log_warning "WOULD install npm package: $pkg"
else
log_info "Installing $pkg..."
if npm install -g "$pkg" 2>&1; then
log_success "$pkg installed"
else
log_warning "Failed to install $pkg"
fi
fi
done
log_success "npm packages complete"
# ============================================================================
# Dotfiles
# ============================================================================
log_info "Linking dotfiles..."
link_dotfile() {
local src="$1"
local dest="$2"
if [ ! -f "$src" ]; then
log_warning "Source not found: $src"
return
fi
mkdir -p "$(dirname "$dest")"
if [ -L "$dest" ]; then
rm "$dest"
elif [ -f "$dest" ]; then
mv "$dest" "${dest}.bak"
log_warning "Backed up existing $dest to ${dest}.bak"
fi
ln -s "$src" "$dest"
log_success "Linked $dest"
}
if $DRY_RUN; then
log_warning "WOULD link dotfiles/.zshrc -> ~/.zshrc"
log_warning "WOULD link dotfiles/.gitconfig -> ~/.gitconfig"
log_warning "WOULD link dotfiles/starship.toml -> ~/.config/starship.toml"
log_warning "WOULD link dotfiles/ghostty/config -> ~/.config/ghostty/config"
else
link_dotfile "$SCRIPT_DIR/dotfiles/.zshrc" "$HOME/.zshrc"
link_dotfile "$SCRIPT_DIR/dotfiles/.gitconfig" "$HOME/.gitconfig"
link_dotfile "$SCRIPT_DIR/dotfiles/starship.toml" "$HOME/.config/starship.toml"
link_dotfile "$SCRIPT_DIR/dotfiles/ghostty/config" "$HOME/.config/ghostty/config"
fi
# ============================================================================
# Claude Code Skills & Plugins
# ============================================================================
log_info "Claude Code skills and plugins are managed separately."
log_info " - Skills: https://github.com/zackbart/skills"
log_info " - Plugins: https://github.com/zackbart/agent-plugins"
# ============================================================================
# Post-installation
# ============================================================================
if ! $DRY_RUN; then
log_info "Cleaning up Homebrew..."
brew cleanup
fi
echo ""
log_success "Setup complete!"
log_info "Restart your terminal or run 'source ~/.zshrc' to apply shell config."
echo ""
log_warning "Manual installs needed:"
log_warning " - DaVinci Resolve: https://www.blackmagicdesign.com/products/davinciresolve"
log_warning " - Blackmagic RAW: https://www.blackmagicdesign.com/products/blackmagicraw"
log_warning " - Chops: Direct download"
log_warning " - Clearly: https://github.com/Shpigford/clearly"
log_warning " - OpenOats: https://github.com/yazinsai/OpenOats"
log_warning " - OpenUsage: https://github.com/robinebers/openusage"
log_warning " - Unbreakable: Direct download"
log_warning " - Shift: Direct download"
log_warning " - Rust (rustup): https://rustup.rs"
log_warning " - Bun: https://bun.sh"