From f94c7f027951741f2cfea758e72ce0cddf735f7a Mon Sep 17 00:00:00 2001 From: Yoowatney Date: Fri, 13 Feb 2026 11:28:42 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Bitwarden=20=EC=B6=94=EA=B0=80,=20?= =?UTF-8?q?=ED=95=9C=EA=B8=80=20backtick=20=EB=A7=A4=ED=95=91,=20statuslin?= =?UTF-8?q?e=20=EA=B0=9C=EC=84=A0,=20Obsidian=20=EC=85=8B=EC=97=85=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Brewfile에 bitwarden, bitwarden-cli 추가 - Karabiner에 한글 입력 시 ₩ → ` 매핑 룰 추가 - Claude statusline에 Firebase 환경, gcloud 계정 정보 표시 추가 - session-env hook에 디버깅 로그 추가 - Obsidian vault symlink 셋업 스크립트 추가 Co-Authored-By: Claude Opus 4.6 --- Brewfile | 2 ++ macos/karabiner/karabiner.json | 27 ++++++++++++++ scripts/setup-obsidian-vault.sh | 37 +++++++++++++++++++ tools/claude/hooks/session-env.sh | 4 +++ tools/claude/statusline-command.sh | 58 ++++++++++++++++++------------ 5 files changed, 105 insertions(+), 23 deletions(-) create mode 100755 scripts/setup-obsidian-vault.sh diff --git a/Brewfile b/Brewfile index dc4d59f..cdbc67f 100644 --- a/Brewfile +++ b/Brewfile @@ -15,6 +15,7 @@ tap "xo/xo" brew "readline", link: true brew "awscli" brew "bat" +brew "bitwarden-cli" brew "broot" brew "p11-kit" brew "unbound" @@ -97,6 +98,7 @@ cask "obsidian" cask "todoist-app" cask "karabiner-elements" cask "rectangle" +cask "bitwarden" cask "clipy" cask "gureumkim" diff --git a/macos/karabiner/karabiner.json b/macos/karabiner/karabiner.json index 8e9e6f9..adbe012 100644 --- a/macos/karabiner/karabiner.json +++ b/macos/karabiner/karabiner.json @@ -3,6 +3,33 @@ { "complex_modifications": { "rules": [ + { + "description": "₩ to ` (backtick) for Korean input", + "manipulators": [ + { + "type": "basic", + "from": { + "key_code": "grave_accent_and_tilde" + }, + "to": [ + { + "key_code": "grave_accent_and_tilde", + "modifiers": ["option"] + } + ], + "conditions": [ + { + "type": "input_source_if", + "input_sources": [ + { + "language": "ko" + } + ] + } + ] + } + ] + }, { "description": "Map ctrl + [ to escape", "manipulators": [ diff --git a/scripts/setup-obsidian-vault.sh b/scripts/setup-obsidian-vault.sh new file mode 100755 index 0000000..3d2896b --- /dev/null +++ b/scripts/setup-obsidian-vault.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# setup-obsidian-vault.sh +# 새 기기에서 Obsidian vault symlink 설정 + +VAULT_PATH="$HOME/Library/Mobile Documents/iCloud~md~obsidian/Documents/obsidian-munice" +MUNICE_PATH="$HOME/work/munice" + +# Vault 존재 확인 +if [ ! -d "$VAULT_PATH" ]; then + echo "Error: Obsidian vault not found at $VAULT_PATH" + echo "Please sync iCloud first." + exit 1 +fi + +# symlink 생성 함수 +create_symlink() { + local target=$1 + local link=$2 + + if [ -L "$link" ]; then + echo "Symlink already exists: $link" + elif [ -d "$link" ]; then + echo "Warning: $link is a directory. Skipping." + echo " Remove it manually if you want to create symlink." + else + ln -s "$target" "$link" + echo "Created: $link -> $target" + fi +} + +# symlink 설정 +create_symlink "$VAULT_PATH/api" "$MUNICE_PATH/nightly_api/docs" +create_symlink "$VAULT_PATH/cloud-functions" "$MUNICE_PATH/cloud-functions/docs" +create_symlink "$VAULT_PATH/terraform" "$MUNICE_PATH/terraform/docs" +create_symlink "$VAULT_PATH/backlog" "$MUNICE_PATH/docs" + +echo "Done! Obsidian vault symlinks configured." diff --git a/tools/claude/hooks/session-env.sh b/tools/claude/hooks/session-env.sh index 1493c3e..1d2b8c3 100755 --- a/tools/claude/hooks/session-env.sh +++ b/tools/claude/hooks/session-env.sh @@ -2,6 +2,10 @@ # Claude Code SessionStart hook - direnv + mise 환경변수 로드 +# 디버깅 로그 +LOG_FILE="$HOME/.claude/hooks/session-env.log" +echo "[$(date)] Hook started, CLAUDE_ENV_FILE=$CLAUDE_ENV_FILE" >> "$LOG_FILE" + if [ -n "$CLAUDE_ENV_FILE" ]; then # direnv export로 환경변수 가져오기 direnv export bash 2>/dev/null | grep '^export ' >> "$CLAUDE_ENV_FILE" diff --git a/tools/claude/statusline-command.sh b/tools/claude/statusline-command.sh index 213b082..c8f5bcb 100755 --- a/tools/claude/statusline-command.sh +++ b/tools/claude/statusline-command.sh @@ -26,32 +26,44 @@ else git_info="" fi -# Get gcloud project (cached) -GCLOUD_CACHE="/tmp/claude-gcloud-cache" -GCLOUD_CACHE_AGE=300 # 5분 캐시 -gcloud_project="" -if [ -f "$GCLOUD_CACHE" ]; then - cache_age=$(($(date +%s) - $(stat -f %m "$GCLOUD_CACHE" 2>/dev/null || echo 0))) - if [ "$cache_age" -lt "$GCLOUD_CACHE_AGE" ]; then - gcloud_project=$(cat "$GCLOUD_CACHE") - fi -fi -if [ -z "$gcloud_project" ]; then - gcloud_project=$(gcloud config get-value project 2>/dev/null) - echo "$gcloud_project" > "$GCLOUD_CACHE" +# Firebase 환경 확인 (.firebaserc를 현재 및 하위 디렉토리에서 찾기) +firebase_dir="" +search_dir="$current_dir" + +# 현재 디렉토리에 .firebaserc 있는지 확인 +if [ -f "${search_dir}/.firebaserc" ]; then + firebase_dir="$search_dir" +else + # 하위 디렉토리에서 .firebaserc 찾기 (depth 1) + for subdir in "$search_dir"/*/; do + if [ -f "${subdir}.firebaserc" ]; then + firebase_dir="${subdir%/}" + break + fi + done fi -# gcloud project 표시 (production이면 경고) -if [ -n "$gcloud_project" ]; then - if echo "$gcloud_project" | grep -q "f06c6"; then - gcloud_info=" 🔴 ${gcloud_project}" - else - gcloud_info=" ☁️ ${gcloud_project}" - fi +if [ -n "$firebase_dir" ]; then + firebase_env=$(cd "$firebase_dir" 2>/dev/null && firebase use 2>/dev/null | head -1) + [ -z "$firebase_env" ] && firebase_env="-" else - gcloud_info="" + firebase_env="-" fi +# gcloud 환경 확인 +gcloud_env=$(gcloud config get-value project 2>/dev/null) +[ -z "$gcloud_env" ] && gcloud_env="?" + +# gcloud account +gcloud_account=$(gcloud config get-value account 2>/dev/null | cut -d'@' -f1) + +# 환경 표시 +firebase_info=" 🔥 ${firebase_env}" + +gcloud_info=" ☁️ ${gcloud_env}" + +account_info=" 👤 ${gcloud_account}" + # Function to get API quota from Anthropic OAuth API get_api_quota() { # Get OAuth token from Keychain @@ -147,5 +159,5 @@ else fi # Output statusline -printf "%s@%s:%s%s%s [%s]" \ - "$username" "$hostname" "$dir_name" "$git_info" "$gcloud_info" "$status_info" +printf "%s@%s:%s%s%s%s%s [%s]" \ + "$username" "$hostname" "$dir_name" "$git_info" "$firebase_info" "$gcloud_info" "$account_info" "$status_info"