Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -97,6 +98,7 @@ cask "obsidian"
cask "todoist-app"
cask "karabiner-elements"
cask "rectangle"
cask "bitwarden"
cask "clipy"
cask "gureumkim"

Expand Down
27 changes: 27 additions & 0 deletions macos/karabiner/karabiner.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
37 changes: 37 additions & 0 deletions scripts/setup-obsidian-vault.sh
Original file line number Diff line number Diff line change
@@ -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."
4 changes: 4 additions & 0 deletions tools/claude/hooks/session-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
58 changes: 35 additions & 23 deletions tools/claude/statusline-command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"