claude-code-session: 프로필 한글 별칭(aliases) 지원

'아베르노 세션 열어줘' → develop2025 프로필로 매핑.
별칭은 state/claude_sessions.json 의 profiles.<name>.aliases 에 둔다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
hyowons
2026-10-06 11:32:05 +09:00
parent 5384b1d670
commit 708961b449
2 changed files with 11 additions and 2 deletions
@@ -21,6 +21,7 @@ description: Claude Code Remote Control 세션을 다중 인스턴스로 관리.
|---|---| |---|---|
| "클로드 세션 열어줘" / "세션 열어줘" | `session_tool.py session open` (default profile=openclaw, `YYMMDD-N` 자동) | | "클로드 세션 열어줘" / "세션 열어줘" | `session_tool.py session open` (default profile=openclaw, `YYMMDD-N` 자동) |
| "X 세션 열어줘" | `session_tool.py session open X` (프로필 X 등록 전이면 안내, 오늘 날짜 + 빈 번호 자동) | | "X 세션 열어줘" | `session_tool.py session open X` (프로필 X 등록 전이면 안내, 오늘 날짜 + 빈 번호 자동) |
| "아베르노 세션 열어줘" | `session_tool.py session open 아베르노` — 한글 별칭은 프로필의 `aliases`(state JSON)로 실제 프로필(`develop2025`)에 매핑된다. 별칭 그대로 넘기면 된다 |
| "260520-2 닫아줘" / "클로드2 닫아줘" | `session_tool.py session close 260520-2` | | "260520-2 닫아줘" / "클로드2 닫아줘" | `session_tool.py session close 260520-2` |
| "세션 목록" / "안 닫힌 세션" | `session_tool.py session list` | | "세션 목록" / "안 닫힌 세션" | `session_tool.py session list` |
| "260520-1 상태" | `session_tool.py session status 260520-1` | | "260520-1 상태" | `session_tool.py session status 260520-1` |
@@ -332,10 +332,18 @@ def cmd_profile_edit(args) -> int:
return 0 return 0
def _resolve_alias(state: dict, name: str) -> str:
"""프로필 별칭(한글 등)을 실제 프로필 이름으로 바꾼다. 해당 없으면 그대로."""
for pname, prof in state['profiles'].items():
if name in prof.get('aliases', []):
return pname
return name
def cmd_session_open(args) -> int: def cmd_session_open(args) -> int:
profile = args.profile or DEFAULT_PROFILE
_validate_name(profile, '프로필 이름')
state = _load_state() state = _load_state()
profile = _resolve_alias(state, args.profile or DEFAULT_PROFILE)
_validate_name(profile, '프로필 이름')
prof = state['profiles'].get(profile) prof = state['profiles'].get(profile)
if not prof: if not prof:
raise SystemExit(f'등록되지 않은 프로필: {profile} (먼저 `profile add` 실행)') raise SystemExit(f'등록되지 않은 프로필: {profile} (먼저 `profile add` 실행)')