Files
setup_mac/README.md
T
2026-04-06 02:05:38 +09:00

303 lines
7.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# NAD4 Mac 초기 설정 스크립트
Mac 개발 환경을 자동으로 설정하는 스크립트입니다.
이제 이 저장소는 기본 개발 환경뿐 아니라 shared Codex 환경까지 함께 세팅합니다.
## 📦 설치 항목
### 개발 도구
- Homebrew
- Node.js
- iTerm2
- Oh My Zsh (agnoster 멀티라인 테마)
- zsh-syntax-highlighting / zsh-autosuggestions
- **VSCode** + Claude 확장
- **Claude Code CLI**
- Cursor (에디터)
- **Codex shared workspace bootstrap**
### 유틸리티
- **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 https://github.com/nad4-su/setup_mac.git
# 2. 스크립트 실행
cd setup_mac
chmod +x setup_mac.sh
./setup_mac.sh
```
### 다른 Mac에서 설정 동기화
```bash
# 1. 저장소 클론
cd ~/workspace
git clone https://github.com/nad4-su/setup_mac.git
# 2. 스크립트 실행 (기존 설정 적용)
cd 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 키 설정 필요
### Codex 공유 환경
- `https://github.com/nad4-su/codex``~/workspace/codex` 로 자동 clone
- `bootstrap-codex.sh` 자동 실행
- `~/workspace/AGENTS.md` 등 공통 링크 자동 구성
- `harness-diagnostics`, `gstack` 등 Codex skill 자동 bootstrap
### 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 확장 설치 확인
### Codex 확인
- [ ] `ls -l ~/workspace/AGENTS.md` → codex 경로로 링크 확인
- [ ] `ls ~/.codex/skills | grep harness-diagnostics`
- [ ] `ls ~/.codex/skills | grep gstack-review`
- [ ] `test -f ~/.codex/config.toml`
## 🛠️ 문제 해결
### 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/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)
- [Codex Shared Repo](https://github.com/nad4-su/codex)
- [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