Skip to content

cp-khs/cc-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cc-config — Claude Code 환경 관리

Claude Code를 여러 환경(Plan, GLM, Bedrock, OpenRouter)에서 편리하게 전환하기 위한 zsh/bash 플러그인입니다.

설치

원클릭 설치

curl -fsSL https://raw.githubusercontent.com/cp-khs/cc-config/master/install.sh | bash

설치 후 이어서 실행:

exec zsh
cc-config init glm         # GLM API Key 설정
cc-config init openrouter  # OpenRouter API Key 설정 (선택)

다른 경로에 설치하려면 CC_CONFIG_DIR 환경 변수를 지정합니다:

CC_CONFIG_DIR=~/my-cc-config bash <(curl -fsSL https://raw.githubusercontent.com/cp-khs/cc-config/master/install.sh)

수동 설치

1. 저장소 클론

~/.config/cc-config(권장) 또는 원하는 디렉토리에 클론합니다:

# 권장 경로
git clone https://github.com/cp-khs/cc-config.git ~/.config/cc-config

# 또는 다른 경로
git clone https://github.com/cp-khs/cc-config.git ~/my-cc-config

2. zshrc에 source 추가

클론한 디렉토리의 cc-config.sh를 source합니다:

# 권장 경로에 클론한 경우
echo 'source ~/.config/cc-config/cc-config.sh' >> ~/.zshrc

# 다른 경로에 클론한 경우
echo 'source ~/my-cc-config/cc-config.sh' >> ~/.zshrc

cc-config.sh는 자신이 위치한 디렉토리를 기준으로 profiles/secrets/를 자동으로 찾습니다. 클론 경로가 달라도 source 경로만 맞으면 정상 동작합니다.

3. 쉘 재시작

exec zsh

4. API 키 초기 설정

API 키가 필요한 프로파일은 init 명령으로 키를 입력합니다:

cc-config init glm        # GLM (z.ai) API Key 입력
cc-config init openrouter # OpenRouter API Key 입력

키는 secrets/ 디렉토리에 저장되며 git에 포함되지 않습니다.


사용 방법

현재 세션에서 임시 전환

cc-config plan        # Claude Plan으로 전환
cc-config glm         # GLM (z.ai)으로 전환
cc-config bedrock     # AWS Bedrock으로 전환
cc-config openrouter  # OpenRouter로 전환

실행 시 적용된 환경 변수가 함께 출력됩니다:

$ cc-config plan
  export ANTHROPIC_MODEL=opusplan

  unset CLAUDE_CODE_USE_BEDROCK
  unset OPENROUTER_API_KEY
  ...

✅ Switched to: plan (current session only)

터미널을 닫으면 기본 프로파일로 복귀합니다.

기본 프로파일 변경 (영구 적용)

cc-config set plan    # plan을 기본으로 설정
exec zsh              # 재시작으로 적용

조회

cc-config list        # 사용 가능한 프로파일 목록
cc-config current     # 현재 기본 프로파일 이름
cc-config show        # 현재 기본 프로파일 내용

프로파일 종류

프로파일 설명 API 키
plan Claude 공식 Plan (로그인 기반) 불필요
glm z.ai GLM 엔드포인트 cc-config init glm
bedrock AWS Bedrock AWS 자격증명
openrouter OpenRouter BYOK cc-config init openrouter

디렉토리 구조

<클론 경로>/
├── cc-config.sh        # zsh/bash 플러그인 (source 대상)
├── profiles/
│   ├── plan.env         # API 키 없음
│   ├── glm.env          # API 키 없음 (secrets에서 로드)
│   ├── bedrock.env      # API 키 없음
│   └── openrouter.env   # API 키 없음 (secrets에서 로드)
├── secrets/             # API 키 저장 (git 제외)
│   ├── glm.secret       # cc-config init glm 으로 생성
│   └── openrouter.secret
└── README.md

우선순위

cc-config <profile>  (현재 세션 임시 적용 — 최우선)
    ↓
프로젝트 설정 (.claude/settings.local.json)
    ↓
기본 프로파일 (cc-config set <profile>)

문제 해결

명령어를 찾을 수 없을 때

# source 줄이 zshrc에 있는지 확인
grep cc-config ~/.zshrc

# 없으면 추가
echo 'source <클론경로>/cc-config.sh' >> ~/.zshrc
exec zsh

GLM/OpenRouter가 작동하지 않을 때

# API 키 설정 여부 확인
ls <클론경로>/secrets/

# 키 재설정
cc-config init glm

환경 변수 확인

env | grep -E "ANTHROPIC|OPENROUTER|CLAUDE|AWS_REGION"

About

Claude Code 프로파일 관리 플러그인 (zsh/bash)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages