macos-setup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesemacOS Starter - Setup Skill
macOS Starter - 开发环境配置工具
From Zero to Hero - AI-powered macOS development environment configuration
从零基础到精通 - 基于AI的macOS开发环境配置
Quick Reference
快速参考
| Command | Description |
|---|---|
| Full interactive setup wizard |
| Quick setup with defaults |
| Use fullstack preset |
| Preview without installing |
| 命令 | 描述 |
|---|---|
| 完整交互式配置向导 |
| 使用默认配置快速搭建 |
| 使用全栈预设配置 |
| 预览安装计划不执行实际安装 |
Skill Capabilities
工具功能
0. Network Proxy Check (前置步骤)
0. 网络代理检查(前置步骤)
在开始安装前,必须确保网络可以访问 Google 和 GitHub:
bash
check_network() {
echo "=== Network Connectivity Check ==="
echo ""
# Test GitHub
echo "Testing GitHub..."
if curl -s --connect-timeout 5 https://github.com > /dev/null 2>&1; then
echo "✅ GitHub: accessible"
else
echo "❌ GitHub: not accessible"
NEED_PROXY=true
fi
# Test Google (for some Homebrew dependencies)
echo "Testing Google..."
if curl -s --connect-timeout 5 https://www.google.com > /dev/null 2>&1; then
echo "✅ Google: accessible"
else
echo "❌ Google: not accessible"
NEED_PROXY=true
fi
# Test Homebrew
echo "Testing Homebrew..."
if curl -s --connect-timeout 5 https://raw.githubusercontent.com > /dev/null 2>&1; then
echo "✅ Homebrew sources: accessible"
else
echo "❌ Homebrew sources: not accessible"
NEED_PROXY=true
fi
if [ "$NEED_PROXY" = true ]; then
echo ""
echo "⚠️ Network issues detected. Proxy configuration required."
return 1
fi
echo ""
echo "✅ Network OK - Ready to proceed"
return 0
}代理配置流程:
- 询问用户代理信息:
yaml
questions:
- id: proxy_needed
question: "Do you need to configure a network proxy to access GitHub/Google?"
options:
- label: "Yes, I have a proxy"
description: "Configure HTTP/HTTPS proxy"
- label: "No, direct connection works"
description: "Skip proxy configuration"
- id: proxy_config
question: "Please provide your proxy configuration:"
condition: "proxy_needed == 'Yes'"
inputs:
- label: "Proxy URL"
placeholder: "http://127.0.0.1:7890"
example: "http://127.0.0.1:7890 or socks5://127.0.0.1:1080"- 设置临时环境变量:
bash
setup_proxy() {
local proxy_url="$1"
if [ -n "$proxy_url" ]; then
echo "Setting proxy: $proxy_url"
export http_proxy="$proxy_url"
export https_proxy="$proxy_url"
export HTTP_PROXY="$proxy_url"
export HTTPS_PROXY="$proxy_url"
export ALL_PROXY="$proxy_url"
# For Git
git config --global http.proxy "$proxy_url"
git config --global https.proxy "$proxy_url"
echo "✅ Proxy configured for this session"
echo ""
echo "To make permanent, add to ~/.zshrc:"
echo " export http_proxy=\"$proxy_url\""
echo " export https_proxy=\"$proxy_url\""
fi
}- 验证代理是否工作:
bash
verify_proxy() {
echo "Verifying proxy configuration..."
if curl -s --connect-timeout 5 https://github.com > /dev/null 2>&1; then
echo "✅ GitHub accessible via proxy"
else
echo "❌ GitHub still not accessible"
return 1
fi
if curl -s --connect-timeout 5 https://www.google.com > /dev/null 2>&1; then
echo "✅ Google accessible via proxy"
else
echo "❌ Google still not accessible"
return 1
fi
echo "✅ Proxy verification passed"
return 0
}在开始安装前,必须确保网络可以访问 Google 和 GitHub:
bash
check_network() {
echo "=== Network Connectivity Check ==="
echo ""
# Test GitHub
echo "Testing GitHub..."
if curl -s --connect-timeout 5 https://github.com > /dev/null 2>&1; then
echo "✅ GitHub: accessible"
else
echo "❌ GitHub: not accessible"
NEED_PROXY=true
fi
# Test Google (for some Homebrew dependencies)
echo "Testing Google..."
if curl -s --connect-timeout 5 https://www.google.com > /dev/null 2>&1; then
echo "✅ Google: accessible"
else
echo "❌ Google: not accessible"
NEED_PROXY=true
fi
# Test Homebrew
echo "Testing Homebrew..."
if curl -s --connect-timeout 5 https://raw.githubusercontent.com > /dev/null 2>&1; then
echo "✅ Homebrew sources: accessible"
else
echo "❌ Homebrew sources: not accessible"
NEED_PROXY=true
fi
if [ "$NEED_PROXY" = true ]; then
echo ""
echo "⚠️ Network issues detected. Proxy configuration required."
return 1
fi
echo ""
echo "✅ Network OK - Ready to proceed"
return 0
}代理配置流程:
- 询问用户代理信息:
yaml
questions:
- id: proxy_needed
question: "Do you need to configure a network proxy to access GitHub/Google?"
options:
- label: "Yes, I have a proxy"
description: "Configure HTTP/HTTPS proxy"
- label: "No, direct connection works"
description: "Skip proxy configuration"
- id: proxy_config
question: "Please provide your proxy configuration:"
condition: "proxy_needed == 'Yes'"
inputs:
- label: "Proxy URL"
placeholder: "http://127.0.0.1:7890"
example: "http://127.0.0.1:7890 or socks5://127.0.0.1:1080"- 设置临时环境变量:
bash
setup_proxy() {
local proxy_url="$1"
if [ -n "$proxy_url" ]; then
echo "Setting proxy: $proxy_url"
export http_proxy="$proxy_url"
export https_proxy="$proxy_url"
export HTTP_PROXY="$proxy_url"
export HTTPS_PROXY="$proxy_url"
export ALL_PROXY="$proxy_url"
# For Git
git config --global http.proxy "$proxy_url"
git config --global https.proxy "$proxy_url"
echo "✅ Proxy configured for this session"
echo ""
echo "To make permanent, add to ~/.zshrc:"
echo " export http_proxy=\"$proxy_url\""
echo " export https_proxy=\"$proxy_url\""
fi
}- 验证代理是否工作:
bash
verify_proxy() {
echo "Verifying proxy configuration..."
if curl -s --connect-timeout 5 https://github.com > /dev/null 2>&1; then
echo "✅ GitHub accessible via proxy"
else
echo "❌ GitHub still not accessible"
return 1
fi
if curl -s --connect-timeout 5 https://www.google.com > /dev/null 2>&1; then
echo "✅ Google accessible via proxy"
else
echo "❌ Google still not accessible"
return 1
fi
echo "✅ Proxy verification passed"
return 0
}1. System Detection
1. 系统检测
Detect installed software and versions:
bash
undefined检测已安装的软件及其版本:
bash
undefinedCore tools detection script
Core tools detection script
detect_installed() {
echo "=== System Detection ==="
# Homebrew
if command -v brew &>/dev/null; then
echo "✅ Homebrew: $(brew --version | head -1)"
else
echo "❌ Homebrew: not installed"
fi
# Shell
echo "✅ Shell: $SHELL"
[ -d "$HOME/.oh-my-zsh" ] && echo "✅ Oh-My-Zsh: installed"
command -v starship &>/dev/null && echo "✅ Starship: installed"
# Git
command -v git &>/dev/null && echo "✅ Git: $(git --version)"
command -v gh &>/dev/null && echo "✅ GitHub CLI: installed"
command -v delta &>/dev/null && echo "✅ Delta: installed"
# Modern CLI
command -v eza &>/dev/null && echo "✅ eza: installed"
command -v bat &>/dev/null && echo "✅ bat: installed"
command -v fd &>/dev/null && echo "✅ fd: installed"
command -v rg &>/dev/null && echo "✅ ripgrep: installed"
# Languages
command -v fnm &>/dev/null && echo "✅ fnm: installed"
command -v node &>/dev/null && echo "✅ Node.js: $(node --version)"
command -v pnpm &>/dev/null && echo "✅ pnpm: installed"
command -v uv &>/dev/null && echo "✅ uv: installed"
command -v python3 &>/dev/null && echo "✅ Python: $(python3 --version)"
command -v goenv &>/dev/null && echo "✅ goenv: installed"
command -v go &>/dev/null && echo "✅ Go: $(go version)"
# Container
command -v docker &>/dev/null && echo "✅ Docker: installed"
command -v kubectl &>/dev/null && echo "✅ kubectl: installed"
command -v helm &>/dev/null && echo "✅ Helm: installed"
command -v k9s &>/dev/null && echo "✅ k9s: installed"
# Applications
[ -d "/Applications/Raycast.app" ] && echo "✅ Raycast: installed"
[ -d "/Applications/Warp.app" ] && echo "✅ Warp: installed"
[ -d "/Applications/Visual Studio Code.app" ] && echo "✅ VS Code: installed"
[ -d "/Applications/OrbStack.app" ] && echo "✅ OrbStack: installed"
# Vibe Coding Tools
echo ""
echo "--- Vibe Coding Tools ---"
command -v claude &>/dev/null && echo "✅ Claude Code: $(claude --version 2>/dev/null | head -1 || echo 'installed')" || echo "❌ Claude Code"
command -v ccline &>/dev/null && echo "✅ CCometixLine: installed" || echo "❌ CCometixLine"
[ -d "/Applications/Cursor.app" ] && echo "✅ Cursor: installed" || echo "❌ Cursor"
command -v opencode &>/dev/null && echo "✅ OpenCode: installed" || echo "❌ OpenCode"
[ -d "/Applications/Cherry Studio.app" ] && echo "✅ Cherry Studio: installed" || echo "❌ Cherry Studio"
[ -d "/Applications/LM Studio.app" ] && echo "✅ LM Studio: installed" || echo "❌ LM Studio"}
undefineddetect_installed() {
echo "=== System Detection ==="
# Homebrew
if command -v brew &>/dev/null; then
echo "✅ Homebrew: $(brew --version | head -1)"
else
echo "❌ Homebrew: not installed"
fi
# Shell
echo "✅ Shell: $SHELL"
[ -d "$HOME/.oh-my-zsh" ] && echo "✅ Oh-My-Zsh: installed"
command -v starship &>/dev/null && echo "✅ Starship: installed"
# Git
command -v git &>/dev/null && echo "✅ Git: $(git --version)"
command -v gh &>/dev/null && echo "✅ GitHub CLI: installed"
command -v delta &>/dev/null && echo "✅ Delta: installed"
# Modern CLI
command -v eza &>/dev/null && echo "✅ eza: installed"
command -v bat &>/dev/null && echo "✅ bat: installed"
command -v fd &>/dev/null && echo "✅ fd: installed"
command -v rg &>/dev/null && echo "✅ ripgrep: installed"
# Languages
command -v fnm &>/dev/null && echo "✅ fnm: installed"
command -v node &>/dev/null && echo "✅ Node.js: $(node --version)"
command -v pnpm &>/dev/null && echo "✅ pnpm: installed"
command -v uv &>/dev/null && echo "✅ uv: installed"
command -v python3 &>/dev/null && echo "✅ Python: $(python3 --version)"
command -v goenv &>/dev/null && echo "✅ goenv: installed"
command -v go &>/dev/null && echo "✅ Go: $(go version)"
# Container
command -v docker &>/dev/null && echo "✅ Docker: installed"
command -v kubectl &>/dev/null && echo "✅ kubectl: installed"
command -v helm &>/dev/null && echo "✅ Helm: installed"
command -v k9s &>/dev/null && echo "✅ k9s: installed"
# Applications
[ -d "/Applications/Raycast.app" ] && echo "✅ Raycast: installed"
[ -d "/Applications/Warp.app" ] && echo "✅ Warp: installed"
[ -d "/Applications/Visual Studio Code.app" ] && echo "✅ VS Code: installed"
[ -d "/Applications/OrbStack.app" ] && echo "✅ OrbStack: installed"
# Vibe Coding Tools
echo ""
echo "--- Vibe Coding Tools ---"
command -v claude &>/dev/null && echo "✅ Claude Code: $(claude --version 2>/dev/null | head -1 || echo 'installed')" || echo "❌ Claude Code"
command -v ccline &>/dev/null && echo "✅ CCometixLine: installed" || echo "❌ CCometixLine"
[ -d "/Applications/Cursor.app" ] && echo "✅ Cursor: installed" || echo "❌ Cursor"
command -v opencode &>/dev/null && echo "✅ OpenCode: installed" || echo "❌ OpenCode"
[ -d "/Applications/Cherry Studio.app" ] && echo "✅ Cherry Studio: installed" || echo "❌ Cherry Studio"
[ -d "/Applications/LM Studio.app" ] && echo "✅ LM Studio: installed" || echo "❌ LM Studio"}
undefined2. Interactive Q&A Flow
2. 交互式问答流程
Use tool with structured questions:
AskUserQuestionyaml
questions:
- id: role
question: "What best describes your primary development role?"
options:
- label: "Fullstack Developer"
description: "React/Vue + Node.js + Database"
- label: "Frontend Developer"
description: "React/Vue/Svelte + UI/Design tools"
- label: "Backend Developer"
description: "Go/Python/Java + APIs + Infrastructure"
- label: "Data/ML Engineer"
description: "Python + Jupyter + ML frameworks"
- label: "DevOps/Platform"
description: "K8s + Terraform + CI/CD"
- id: languages
question: "Which programming languages do you need?"
multiSelect: true
options:
- label: "JavaScript/TypeScript"
description: "fnm + Node.js LTS + pnpm"
- label: "Python"
description: "uv + Python 3.12"
- label: "Go"
description: "goenv + latest Go"
- label: "Rust"
description: "rustup + stable"
- id: containers
question: "Do you need container and Kubernetes tools?"
options:
- label: "Full K8s setup"
description: "OrbStack + kubectl + helm + k9s + stern"
- label: "Docker only"
description: "OrbStack for containers"
- label: "Skip"
description: "No container tools"
- id: vibe_coding
question: "Which additional Vibe Coding tools do you need?"
multiSelect: true
note: "We assume you already have at least one AI coding tool installed to use this project."
detection: |
command -v claude &>/dev/null && echo "✅ Claude Code installed"
command -v ccline &>/dev/null && echo "✅ CCometixLine installed"
[ -d "/Applications/Cursor.app" ] && echo "✅ Cursor installed"
command -v opencode &>/dev/null && echo "✅ OpenCode installed"
[ -d "/Applications/Cherry Studio.app" ] && echo "✅ Cherry Studio installed"
options:
- label: "Claude Code"
description: "Anthropic's official agentic CLI"
skip_if: "command -v claude &>/dev/null"
- label: "CCometixLine"
description: "Claude Code statusline enhancer (Git, model, context)"
skip_if: "command -v ccline &>/dev/null"
requires: "Node.js"
- label: "Cursor"
description: "AI-first code editor"
skip_if: "[ -d '/Applications/Cursor.app' ]"
- label: "OpenCode"
description: "Open-source terminal AI assistant"
skip_if: "command -v opencode &>/dev/null"
- label: "Cherry Studio"
description: "AI desktop client with multi-model support"
skip_if: "[ -d '/Applications/Cherry Studio.app' ]"
- id: apps
question: "Which collaboration apps?"
multiSelect: true
options:
- label: "Work (CN)"
description: "Lark + DingTalk + WeCom"
- label: "International"
description: "Slack + Discord + WhatsApp"
- label: "Meetings"
description: "Tencent Meeting + Zoom"
- id: macos
question: "macOS optimizations?"
multiSelect: true
options:
- label: "Dock"
description: "Hide recent apps, faster animations"
- label: "Keyboard"
description: "Faster repeat, disable auto-correct"
- label: "Finder"
description: "Show hidden files, path bar"
- label: "Screenshots"
description: "Save to ~/Pictures/Screenshots"使用工具进行结构化问答:
AskUserQuestionyaml
questions:
- id: role
question: "What best describes your primary development role?"
options:
- label: "Fullstack Developer"
description: "React/Vue + Node.js + Database"
- label: "Frontend Developer"
description: "React/Vue/Svelte + UI/Design tools"
- label: "Backend Developer"
description:"Go/Python/Java + APIs + Infrastructure"
- label: "Data/ML Engineer"
description: "Python + Jupyter + ML frameworks"
- label: "DevOps/Platform"
description: "K8s + Terraform + CI/CD"
- id: languages
question: "Which programming languages do you need?"
multiSelect: true
options:
- label: "JavaScript/TypeScript"
description: "fnm + Node.js LTS + pnpm"
- label: "Python"
description: "uv + Python 3.12"
- label: "Go"
description: "goenv + latest Go"
- label: "Rust"
description: "rustup + stable"
- id: containers
question: "Do you need container and Kubernetes tools?"
options:
- label: "Full K8s setup"
description: "OrbStack + kubectl + helm + k9s + stern"
- label: "Docker only"
description: "OrbStack for containers"
- label: "Skip"
description: "No container tools"
- id: vibe_coding
question: "Which additional Vibe Coding tools do you need?"
multiSelect: true
note: "We assume you already have at least one AI coding tool installed to use this project."
detection: |
command -v claude &>/dev/null && echo "✅ Claude Code installed"
command -v ccline &>/dev/null && echo "✅ CCometixLine installed"
[ -d "/Applications/Cursor.app" ] && echo "✅ Cursor installed"
command -v opencode &>/dev/null && echo "✅ OpenCode installed"
[ -d "/Applications/Cherry Studio.app" ] && echo "✅ Cherry Studio installed"
options:
- label: "Claude Code"
description: "Anthropic's official agentic CLI"
skip_if: "command -v claude &>/dev/null"
- label: "CCometixLine"
description: "Claude Code statusline enhancer (Git, model, context)"
skip_if: "command -v ccline &>/dev/null"
requires: "Node.js"
- label: "Cursor"
description: "AI-first code editor"
skip_if: "[ -d '/Applications/Cursor.app' ]"
- label: "OpenCode"
description: "Open-source terminal AI assistant"
skip_if: "command -v opencode &>/dev/null"
- label: "Cherry Studio"
description: "AI desktop client with multi-model support"
skip_if: "[ -d '/Applications/Cherry Studio.app' ]"
- id: apps
question: "Which collaboration apps?"
multiSelect: true
options:
- label: "Work (CN)"
description: "Lark + DingTalk + WeCom"
- label: "International"
description: "Slack + Discord + WhatsApp"
- label: "Meetings"
description: "Tencent Meeting + Zoom"
- id: macos
question: "macOS optimizations?"
multiSelect: true
options:
- label: "Dock"
description: "Hide recent apps, faster animations"
- label: "Keyboard"
description: "Faster repeat, disable auto-correct"
- label: "Finder"
description: "Show hidden files, path bar"
- label: "Screenshots"
description: "Save to ~/Pictures/Screenshots"3. Plan Generation
3. 安装计划生成
Generate structured installation plan based on answers:
markdown
undefined根据用户回答生成结构化安装计划:
markdown
undefinedGenerated Plan for: [User Name]
Generated Plan for: [User Name]
Phase 1: Prerequisites
Phase 1: Prerequisites
- Xcode Command Line Tools
- Homebrew
- Xcode Command Line Tools
- Homebrew
Phase 2: CLI Tools
Phase 2: CLI Tools
| Package | Purpose | Command |
|---|---|---|
| git | Version control | |
| gh | GitHub CLI | |
| delta | Better diffs | |
| starship | Modern prompt | |
| eza | ls replacement | |
| bat | cat replacement | |
| fd | find replacement | |
| ripgrep | grep replacement | |
| Package | Purpose | Command |
|---|---|---|
| git | Version control | |
| gh | GitHub CLI | |
| delta | Better diffs | |
| starship | Modern prompt | |
| eza | ls replacement | |
| bat | cat replacement | |
| fd | find replacement | |
| ripgrep | grep replacement | |
Phase 3: Language Environments
Phase 3: Language Environments
| Language | Manager | Setup Command |
|---|---|---|
| Node.js | fnm | |
| Python | uv | |
| Go | goenv | |
| Language | Manager | Setup Command |
|---|---|---|
| Node.js | fnm | |
| Python | uv | |
| Go | goenv | |
Phase 4: Applications
Phase 4: Applications
| App | Purpose | Command |
|---|---|---|
| Raycast | Launcher + window mgmt | |
| Warp | Modern terminal | |
| OrbStack | Docker/K8s | |
| App | Purpose | Command |
|---|---|---|
| Raycast | Launcher + window mgmt | |
| Warp | Modern terminal | |
| OrbStack | Docker/K8s | |
Phase 5: Vibe Coding Tools
Phase 5: Vibe Coding Tools
Note: Skip already installed tools
| Tool | Purpose | Command | Skip If |
|---|---|---|---|
| Claude Code | Anthropic agentic CLI | | |
| CCometixLine | Claude Code statusline | | |
| Cursor | AI-first code editor | | App exists |
| OpenCode | Open-source terminal AI | | |
| Cherry Studio | Multi-model AI client | | App exists |
Note: Skip already installed tools
| Tool | Purpose | Command | Skip If |
|---|---|---|---|
| Claude Code | Anthropic agentic CLI | | |
| CCometixLine | Claude Code statusline | | |
| Cursor | AI-first code editor | | App exists |
| OpenCode | Open-source terminal AI | | |
| Cherry Studio | Multi-model AI client | | App exists |
Phase 6: Fonts
Phase 6: Fonts
| Font | Purpose |
|---|---|
| JetBrains Mono Nerd Font | Terminal icons |
| Fira Code | Ligatures |
| Inter | UI font |
| Font | Purpose |
|---|---|
| JetBrains Mono Nerd Font | Terminal icons |
| Fira Code | Ligatures |
| Inter | UI font |
Phase 7: Shell Configuration
Phase 7: Shell Configuration
- Zsh plugins (autosuggestions, syntax-highlighting)
- Starship prompt
- Modern CLI aliases
- Zsh plugins (autosuggestions, syntax-highlighting)
- Starship prompt
- Modern CLI aliases
Phase 8: macOS Defaults
Phase 8: macOS Defaults
- Dock optimization
- Keyboard settings
- Finder preferences
undefined- Dock optimization
- Keyboard settings
- Finder preferences
undefined4. Execution Engine
4. 执行引擎
Execute plan with progress tracking:
bash
undefined执行安装计划并跟踪进度:
bash
undefinedExample execution with progress
Example execution with progress
execute_phase() {
local phase=$1
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "📦 Phase $phase"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
}
execute_phase() {
local phase=$1
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "📦 Phase $phase"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
}
Phase 1: CLI Tools
Phase 1: CLI Tools
execute_phase "1: CLI Tools"
brew install git gh delta starship
brew install eza bat fd ripgrep sd dust procs bottom
brew install tree wget curl jq yq
execute_phase "1: CLI Tools"
brew install git gh delta starship
brew install eza bat fd ripgrep sd dust procs bottom
brew install tree wget curl jq yq
Phase 2: Languages
Phase 2: Languages
execute_phase "2: Language Environments"
brew install fnm uv goenv go
fnm install --lts
fnm default lts-latest
npm install -g pnpm
execute_phase "2: Language Environments"
brew install fnm uv goenv go
fnm install --lts
fnm default lts-latest
npm install -g pnpm
Phase 3: Apps
Phase 3: Apps
execute_phase "3: Applications"
brew install --cask raycast warp orbstack
execute_phase "3: Applications"
brew install --cask raycast warp orbstack
Phase 4: Vibe Coding (with skip detection)
Phase 4: Vibe Coding (with skip detection)
execute_phase "4: Vibe Coding Tools"
execute_phase "4: Vibe Coding Tools"
Claude Code
Claude Code
if ! command -v claude &>/dev/null; then
echo "📦 Installing Claude Code..."
brew install --cask claude-code
else
echo "⏭️ Claude Code already installed, skipping"
fi
if ! command -v claude &>/dev/null; then
echo "📦 Installing Claude Code..."
brew install --cask claude-code
else
echo "⏭️ Claude Code already installed, skipping"
fi
CCometixLine (requires Node.js)
CCometixLine (requires Node.js)
if ! command -v ccline &>/dev/null; then
if command -v npm &>/dev/null; then
echo "📦 Installing CCometixLine..."
npm install -g @cometix/ccline
echo "💡 Configure: Add to ~/.claude/settings.json:"
echo ' {"statusLine": {"type": "command", "command": "ccline"}}'
else
echo "⚠️ CCometixLine requires Node.js, install fnm/node first"
fi
else
echo "⏭️ CCometixLine already installed, skipping"
fi
if ! command -v ccline &>/dev/null; then
if command -v npm &>/dev/null; then
echo "📦 Installing CCometixLine..."
npm install -g @cometix/ccline
echo "💡 Configure: Add to ~/.claude/settings.json:"
echo ' {"statusLine": {"type": "command", "command": "ccline"}}'
else
echo "⚠️ CCometixLine requires Node.js, install fnm/node first"
fi
else
echo "⏭️ CCometixLine already installed, skipping"
fi
Cursor
Cursor
if [ ! -d "/Applications/Cursor.app" ]; then
echo "📦 Installing Cursor..."
brew install --cask cursor
else
echo "⏭️ Cursor already installed, skipping"
fi
if [ ! -d "/Applications/Cursor.app" ]; then
echo "📦 Installing Cursor..."
brew install --cask cursor
else
echo "⏭️ Cursor already installed, skipping"
fi
OpenCode
OpenCode
if ! command -v opencode &>/dev/null; then
echo "📦 Installing OpenCode..."
brew install opencode
else
echo "⏭️ OpenCode already installed, skipping"
fi
if ! command -v opencode &>/dev/null; then
echo "📦 Installing OpenCode..."
brew install opencode
else
echo "⏭️ OpenCode already installed, skipping"
fi
Cherry Studio
Cherry Studio
if [ ! -d "/Applications/Cherry Studio.app" ]; then
echo "📦 Installing Cherry Studio..."
brew install --cask cherry-studio
else
echo "⏭️ Cherry Studio already installed, skipping"
fi
if [ ! -d "/Applications/Cherry Studio.app" ]; then
echo "📦 Installing Cherry Studio..."
brew install --cask cherry-studio
else
echo "⏭️ Cherry Studio already installed, skipping"
fi
Phase 5: Fonts
Phase 5: Fonts
execute_phase "5: Fonts"
brew install --cask font-jetbrains-mono-nerd-font
brew install --cask font-fira-code font-inter
execute_phase "5: Fonts"
brew install --cask font-jetbrains-mono-nerd-font
brew install --cask font-fira-code font-inter
Phase 6: Shell
Phase 6: Shell
execute_phase "6: Shell Configuration"
execute_phase "6: Shell Configuration"
Install zsh plugins...
Install zsh plugins...
Configure starship...
Configure starship...
Phase 7: macOS
Phase 7: macOS
execute_phase "7: macOS Optimization"
defaults write com.apple.dock show-recents -bool false
defaults write NSGlobalDomain KeyRepeat -int 2
execute_phase "7: macOS Optimization"
defaults write com.apple.dock show-recents -bool false
defaults write NSGlobalDomain KeyRepeat -int 2
...
...
echo "✅ Setup complete!"
---echo "✅ Setup complete!"
---Presets
预设配置
fullstack
fullstack
yaml
name: Fullstack Developer
languages: [javascript, python]
containers: full
apps: [raycast, warp, cursor, orbstack, notion]
macos: [dock, keyboard]yaml
name: Fullstack Developer
languages: [javascript, python]
containers: full
apps: [raycast, warp, cursor, orbstack, notion]
macos: [dock, keyboard]frontend
frontend
yaml
name: Frontend Developer
languages: [javascript]
containers: docker
apps: [raycast, cursor, figma]
macos: [dock, keyboard]yaml
name: Frontend Developer
languages: [javascript]
containers: docker
apps: [raycast, cursor, figma]
macos: [dock, keyboard]backend
backend
yaml
name: Backend Developer
languages: [go, python]
containers: full
cloud: [aws]
apps: [raycast, warp, cursor, orbstack]
macos: [dock, keyboard, finder]yaml
name: Backend Developer
languages: [go, python]
containers: full
cloud: [aws]
apps: [raycast, warp, cursor, orbstack]
macos: [dock, keyboard, finder]data
data
yaml
name: Data/ML Engineer
languages: [python]
containers: docker
apps: [cursor, jupyter]
macos: [keyboard]yaml
name: Data/ML Engineer
languages: [python]
containers: docker
apps: [cursor, jupyter]
macos: [keyboard]devops
devops
yaml
name: DevOps Engineer
languages: [go, python]
containers: full
cloud: [aws, gcp]
apps: [raycast, warp, orbstack]
macos: [dock, keyboard, finder]yaml
name: DevOps Engineer
languages: [go, python]
containers: full
cloud: [aws, gcp]
apps: [raycast, warp, orbstack]
macos: [dock, keyboard, finder]Configuration Files
配置文件
This skill references:
- - Detailed preset configurations
presets.md - - Complete package registry
packages.md - - Homebrew bundle
../../scripts/Brewfile - - Configuration templates
../../configs/
本工具引用以下文件:
- - 详细预设配置
presets.md - - 完整包注册表
packages.md - - Homebrew 包清单
../../scripts/Brewfile - - 配置模板
../../configs/
Best Practices
最佳实践
- Always detect first - Never reinstall what exists
- Ask, don't assume - User preferences matter
- Show before doing - Display plan before execution
- Progress tracking - Use TodoWrite for visibility
- Verify after - Confirm installations succeeded
- Non-destructive - Never remove existing tools
- 先检测再操作 - 绝不重复安装已存在的工具
- 询问而非假设 - 用户偏好至关重要
- 执行前展示计划 - 在执行前显示安装计划
- 进度跟踪 - 使用TodoWrite提升可见性
- 安装后验证 - 确认安装成功
- 非破坏性操作 - 绝不移除现有工具
Error Handling
错误处理
bash
undefinedbash
undefinedRetry failed installations
Retry failed installations
retry_install() {
local cmd=$1
local max_attempts=3
local attempt=1
while [ $attempt -le $max_attempts ]; do
if eval "$cmd"; then
return 0
fi
echo "⚠️ Attempt $attempt failed, retrying..."
((attempt++))
sleep 2
done
echo "❌ Failed after $max_attempts attempts"
return 1}
---retry_install() {
local cmd=$1
local max_attempts=3
local attempt=1
while [ $attempt -le $max_attempts ]; do
if eval "$cmd"; then
return 0
fi
echo "⚠️ Attempt $attempt failed, retrying..."
((attempt++))
sleep 2
done
echo "❌ Failed after $max_attempts attempts"
return 1}
---Trigger Keywords
触发关键词
This skill activates on:
/new-macos-setup- "setup macos"
- "configure mac"
- "new mac setup"
- "dev environment"
- "install development tools"
本工具在以下关键词触发:
/new-macos-setup- "setup macos"
- "configure mac"
- "new mac setup"
- "dev environment"
- "install development tools"