mirror of
https://github.com/nad4-su/setup_mac.git
synced 2026-08-12 23:13:24 +09:00
- Add VSCode (brew cask), Node.js, Claude Code CLI (npm) installation - Add VSCode Claude extension auto-install with code CLI fallback - Fix save_configs.sh missing RECTANGLE_SETTINGS_DIR variable - Fix Rectangle config: support both plist and JSON (RectangleConfig.json) - Fix ZSH plugin paths for Intel Mac using $(brew --prefix) - Fix iTerm2 Dynamic Profile JSON assembly (safe wrapping) - Fix GUID extraction regex for flexible whitespace - Fix set -e compatibility for plutil failure handling - Add mkdir -p for Stats settings dir in save_configs.sh - Add vim swap file patterns to .gitignore - Update README.md with Claude Code docs, checklist, troubleshooting - Simplify iTerm2 launch logic Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
287 lines
6.5 KiB
Markdown
287 lines
6.5 KiB
Markdown
# NAD4 Mac 초기 설정 스크립트
|
||
|
||
Mac 개발 환경을 자동으로 설정하는 스크립트입니다.
|
||
|
||
## 📦 설치 항목
|
||
|
||
### 개발 도구
|
||
- Homebrew
|
||
- Node.js
|
||
- iTerm2
|
||
- Oh My Zsh (agnoster 멀티라인 테마)
|
||
- zsh-syntax-highlighting / zsh-autosuggestions
|
||
- **VSCode** + Claude 확장
|
||
- **Claude Code CLI**
|
||
- Cursor (에디터)
|
||
|
||
### 유틸리티
|
||
- **Stats**: 시스템 모니터 (CPU, Memory, Network 등)
|
||
- **Rectangle**: 윈도우 관리 (무료 Magnet 대안)
|
||
- **AppCleaner**: 앱 완전 삭제 도구
|
||
|
||
### 폰트
|
||
- D2Coding
|
||
- D2Coding Nerd Font
|
||
|
||
### 애플리케이션
|
||
- Notion
|
||
- Discord
|
||
- Slack
|
||
- Google Chrome
|
||
- Telegram
|
||
- IINA (동영상 플레이어)
|
||
- Tunnelblick (VPN)
|
||
|
||
|
||
## 🚀 사용 방법
|
||
|
||
### 초기 설치
|
||
```bash
|
||
# 1. 저장소 클론
|
||
cd ~/workspace
|
||
git clone <repository-url> nad4
|
||
|
||
# 2. 스크립트 실행
|
||
cd nad4/setup_mac
|
||
chmod +x setup_mac.sh
|
||
./setup_mac.sh
|
||
```
|
||
|
||
### 다른 Mac에서 설정 동기화
|
||
```bash
|
||
# 1. 저장소 클론
|
||
cd ~/workspace
|
||
git clone <repository-url> nad4
|
||
|
||
# 2. 스크립트 실행 (기존 설정 적용)
|
||
cd nad4/setup_mac
|
||
chmod +x setup_mac.sh
|
||
./setup_mac.sh
|
||
```
|
||
|
||
## 📁 프로젝트 구조
|
||
```
|
||
setup_mac/
|
||
├── setup_mac.sh # 메인 설치 스크립트
|
||
├── save_configs.sh # 설정 저장 스크립트
|
||
├── .gitignore
|
||
├── iterm2-settings/
|
||
│ └── profile.json # iTerm2 프로파일
|
||
├── stats-settings/
|
||
│ └── Stats.plist # Stats 설정
|
||
├── rectangle-settings/
|
||
│ └── RectangleConfig.json # Rectangle 설정
|
||
└── README.md
|
||
```
|
||
|
||
## ⚙️ 설정 내용
|
||
|
||
### iTerm2 프로파일
|
||
- **이름**: nad4-profile
|
||
- **폰트**: D2Coding 13pt
|
||
- **색상**: 다크 테마
|
||
- **Status Bar**: CPU, 메모리, 네트워크, 배터리, 호스트명
|
||
- **크기**: 100 columns × 25 rows
|
||
|
||
### ZSH 테마
|
||
- **테마**: agnoster (멀티라인)
|
||
- **플러그인**: syntax-highlighting, autosuggestions
|
||
|
||
### Claude Code
|
||
- **CLI**: `npm install -g @anthropic-ai/claude-code` 로 자동 설치
|
||
- **VSCode 확장**: `code --install-extension` 으로 자동 설치
|
||
- 최초 실행 시 Anthropic API 키 설정 필요
|
||
|
||
### Stats 설정
|
||
- 자동으로 사용자 정의 설정 적용
|
||
- 메뉴바 위젯 자동 구성
|
||
- Launch at login 자동 설정
|
||
|
||
## 🔄 설정 업데이트
|
||
|
||
### 간편한 방법 (save_configs.sh 사용)
|
||
```bash
|
||
cd ~/workspace/nad4/setup_mac
|
||
|
||
# 1. Stats에서 원하는 설정 변경
|
||
# 2. iTerm2에서 프로파일 수정 (선택사항)
|
||
|
||
# 3. 설정 저장 스크립트 실행
|
||
./save_configs.sh
|
||
```
|
||
|
||
### 수동 방법
|
||
|
||
#### iTerm2 프로파일 변경 사항 저장
|
||
```bash
|
||
# 1. iTerm2에서 프로파일 수정 후 Export
|
||
# iTerm2 > Settings > Profiles > Other Actions... > Save Profile as JSON
|
||
|
||
# 2. 파일을 저장소로 이동
|
||
cd ~/workspace/nad4/setup_mac
|
||
mv ~/Downloads/nad4-profile.json iterm2-settings/profile.json
|
||
|
||
# 3. Git 커밋
|
||
git add iterm2-settings/profile.json
|
||
git commit -m "Update iTerm2 profile"
|
||
git push
|
||
```
|
||
|
||
#### Stats 설정 변경 사항 저장
|
||
```bash
|
||
# 1. Stats에서 원하는 설정 변경
|
||
# Settings에서 위젯, 색상, 업데이트 간격 등 조정
|
||
|
||
# 2. 설정 파일 저장소로 복사
|
||
cd ~/workspace/nad4/setup_mac
|
||
cp ~/Library/Preferences/eu.exelban.Stats.plist stats-settings/Stats.plist
|
||
|
||
# 3. Git 커밋
|
||
git add stats-settings/Stats.plist
|
||
git commit -m "Update Stats configuration"
|
||
git push
|
||
```
|
||
|
||
## 📋 설치 후 체크리스트
|
||
|
||
### iTerm2 설정
|
||
- [ ] iTerm2 > Settings > Profiles
|
||
- [ ] 'nad4-profile' 선택
|
||
- [ ] Other Actions... > Set as Default
|
||
- [ ] 새 창 열어서 설정 확인
|
||
|
||
### Stats 설정
|
||
- [ ] 메뉴바에서 Stats 위젯 표시 확인
|
||
- [ ] Settings > General > Launch at login 확인
|
||
- [ ] CPU, Memory 등 위젯 정상 작동 확인
|
||
|
||
### ZSH 확인
|
||
- [ ] 새 터미널에서 `echo $ZSH_THEME` → agnoster
|
||
- [ ] `type build_prompt` → 함수 정의 확인
|
||
- [ ] 프롬프트 2줄로 표시 확인
|
||
- [ ] Syntax highlighting 작동 확인
|
||
- [ ] Autosuggestions 작동 확인
|
||
|
||
### Claude Code 확인
|
||
- [ ] `claude --version` → 버전 출력 확인
|
||
- [ ] `claude` → 최초 실행 시 API 키 설정
|
||
- [ ] VSCode Extensions (⌘⇧X) → Claude 확장 설치 확인
|
||
|
||
## 🛠️ 문제 해결
|
||
|
||
### iTerm2 프로파일이 적용되지 않는 경우
|
||
```bash
|
||
# 1. 프로파일 파일 확인
|
||
ls -la ~/Library/Application\ Support/iTerm2/DynamicProfiles/
|
||
|
||
# 2. iTerm2 재시작
|
||
killall iTerm2
|
||
open -a iTerm2
|
||
```
|
||
|
||
### Stats 설정이 적용되지 않는 경우
|
||
```bash
|
||
# 1. Stats 완전 종료
|
||
killall Stats
|
||
|
||
# 2. 설정 파일 재적용
|
||
cd ~/workspace/nad4/setup_mac
|
||
cp stats-settings/Stats.plist ~/Library/Preferences/eu.exelban.Stats.plist
|
||
|
||
# 3. Stats 재시작
|
||
open -a Stats
|
||
```
|
||
|
||
### ZSH 테마 에러
|
||
```bash
|
||
# 백업에서 복원
|
||
cp ~/.zshrc.backup_YYYYMMDD_HHMMSS ~/.zshrc
|
||
exec zsh
|
||
```
|
||
|
||
### Claude Code CLI가 동작하지 않는 경우
|
||
```bash
|
||
# Node.js 확인
|
||
node --version
|
||
|
||
# Claude Code 재설치
|
||
npm install -g @anthropic-ai/claude-code
|
||
|
||
# API 키 재설정
|
||
claude config
|
||
```
|
||
|
||
### VSCode Claude 확장이 설치되지 않는 경우
|
||
```bash
|
||
# code 명령 설치 (VSCode 실행 후)
|
||
# ⌘⇧P → 'Shell Command: Install code command in PATH'
|
||
|
||
# 확장 수동 설치
|
||
code --install-extension anthropic.claude-code
|
||
```
|
||
|
||
### 폰트가 표시되지 않는 경우
|
||
```bash
|
||
# 폰트 재설치
|
||
brew reinstall --cask font-d2coding
|
||
brew reinstall --cask font-d2coding-nerd-font
|
||
|
||
# 폰트 캐시 삭제
|
||
sudo atsutil databases -remove
|
||
```
|
||
|
||
## 📦 설정 백업 및 복원
|
||
|
||
### 전체 설정 백업
|
||
```bash
|
||
cd ~/workspace/nad4/setup_mac
|
||
./save_configs.sh
|
||
```
|
||
|
||
### 전체 설정 복원
|
||
```bash
|
||
cd ~/workspace/nad4/setup_mac
|
||
|
||
# Git에서 최신 설정 가져오기
|
||
git pull
|
||
|
||
# 스크립트 실행 (자동으로 모든 설정 복원)
|
||
./setup_mac.sh
|
||
```
|
||
|
||
## 📚 참고 자료
|
||
|
||
- [Homebrew](https://brew.sh/)
|
||
- [iTerm2](https://iterm2.com/)
|
||
- [Oh My Zsh](https://ohmyz.sh/)
|
||
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code)
|
||
- [VSCode](https://code.visualstudio.com/)
|
||
- [Stats](https://github.com/exelban/stats)
|
||
- [Rectangle](https://rectangleapp.com/)
|
||
- [D2Coding Font](https://github.com/naver/d2codingfont)
|
||
|
||
## 💡 팁
|
||
|
||
### 빠른 설정 동기화
|
||
```bash
|
||
# 다른 Mac에서 5분 안에 모든 설정 복원
|
||
cd ~/workspace
|
||
git clone <repository-url> nad4
|
||
cd nad4/setup_mac
|
||
chmod +x setup_mac.sh
|
||
./setup_mac.sh
|
||
|
||
# 완료! iTerm2 재시작하면 모든 설정 적용됨
|
||
```
|
||
|
||
### 정기적인 설정 백업
|
||
```bash
|
||
# 매주 일요일 오후 6시에 설정 백업 (선택사항)
|
||
# crontab -e 후 아래 줄 추가:
|
||
0 18 * * 0 cd ~/workspace/nad4/setup_mac && ./save_configs.sh --auto
|
||
```
|
||
|
||
## 📝 라이선스
|
||
|
||
MIT License
|