다양한 Claude Code 프로필 간 전환

hackernews | | 💼 비즈니스
#claude #claude code #cli #macos #계정 전환 #꿀팁 #프로필
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

macOS에서 여러 Claude Code 계정을 사용할 때 발생하는 수동 설정 번거로움과 자격 증명 누출 위험을 해결하기 위해, **claudini**라는 CLI 도구가 개발되었습니다. 이 도구는 설정 파일과 키체인 자격 증명을 포함한 **프로필 관리 기능을 제공**하며, 단 하나의 명령어로 계정을 전환할 수 있습니다. 또한 보안을 위해 민감한 정보를 키체인에만 저장하고, 계정 간에 공유 설정이나 사용 기록을 **자동으로 동기화**하는 기능을 특징으로 합니다.

본문

CLI for switching between multiple Claude Code accounts on macOS. Claude Code doesn't support multiple accounts. If you use Claude Code with different accounts — say a personal one and a work one — switching means manually replacing ~/.claude.json and swapping the credential stored in the macOS Keychain. Do it wrong and you lose your config, break your session, or leak one account's credential into another. claudini solves this by managing named profiles that bundle both the config file and the keychain credential. You switch accounts with a single command (claudini use work ), and everything else — syncing shared settings, swapping credentials, updating symlinks — happens automatically. All credentials stay in the macOS Keychain; nothing is ever written to disk as plain text. - Each profile stores its own claude.json on disk and its credential in the macOS Keychain ~/.claude.json becomes a symlink pointing to the active profile'sclaude.json - On switch, the keychain credential is swapped and shared fields (projects, settings, usage history) are synced from the outgoing profile to the incoming one - Account-specific fields (OAuth tokens, user ID, org caches) stay per-profile - Credentials never touch the filesystem — they are read from and written to the Keychain directly ~/.claudini/ config.json # { "active_profile": "personal" } profiles/ personal/ claude.json # account-specific claude.json work/ claude.json backups/ before-upgrade/ claude.json # snapshot of ~/.claude.json claude/ # snapshot of ~/.claude/ directory macOS Keychain: "Claude Code-credentials" # active credential (read by Claude Code) "claudini-profile-personal" # personal profile credential "claudini-profile-work" # work profile credential "claudini-backup-before-upgrade" # backup credential curl -fsSL https://raw.githubusercontent.com/kimrgrey/claudini/main/install.sh | sh The script detects your Mac's architecture (Apple Silicon or Intel), downloads the matching binary from the latest GitHub Release, and installs it to /usr/local/bin/claudini . To install to a custom location: INSTALL_DIR=~/.local/bin curl -fsSL https://raw.githubusercontent.com/kimrgrey/claudini/main/install.sh | sh Download the binary for your architecture from the latest release: - Apple Silicon: claudini-aarch64-apple-darwin - Intel: claudini-x86_64-apple-darwin Then make it executable and move it to your PATH: chmod +x claudini-* mv claudini-* /usr/local/bin/claudini cargo install --path . Or build locally: cargo build --release # binary at target/release/claudini Create a backup of your current Claude Code configuration before making any changes: claudini backup create init This saves a snapshot of your ~/.claude.json , keychain credential, and ~/.claude/ directory so you can restore if anything goes wrong. claudini init Creates the ~/.claudini/ directory structure and config.json . If already initialized, migrates any legacy plain text credential files to the Keychain. claudini profile add personal Reads the current ~/.claude.json and keychain credential, saves them as the personal profile, and replaces ~/.claude.json with a symlink. claudini profile add --login work Saves the current credential, clears auth, launches claude for interactive OAuth login, then saves the new account as the work profile. claudini use work Syncs shared fields, swaps the symlink and keychain credential. claudini use is a shortcut for claudini profile use . To switch and immediately launch Claude Code in one step: claudini work # or equivalently: claudini use work --launch claudini use work -l claudini profile list Shows all profiles in a table, with the active one marked. claudini profile current Prints the active profile name and associated email address. claudini profile rename work work-old Renames a profile. If it's the active profile, the symlink and config are updated automatically. claudini profile remove work Deletes a profile's stored data and its Keychain credential. Cannot remove the currently active profile. claudini backup create before-upgrade Saves a snapshot of ~/.claude.json , the keychain credential, and the ~/.claude/ directory. claudini backup restore before-upgrade Replaces current config, credentials, and ~/.claude/ directory from the named backup. claudini backup delete before-upgrade Deletes a backup's stored data and its Keychain credential. claudini backup list Shows all available backup names. All commands support --json for machine-readable output: claudini --json profile list claudini --json profile current claudini --json backup list Errors are returned as {"error": "..."} . Override the Claude home directory to test safely: # Via CLI flag claudini --claude-home /tmp/test-claude profile add test # Via environment variable export CLAUDINI_CLAUDE_HOME=/tmp/test-claude claudini profile add test When overridden, claudini looks for /.claude.json instead of ~/.claude.json . When switching profiles, claudini copies shared fields from the outgoing profile to the inco

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →