Claude Glm Switcher banner
jkf87 jkf87

Claude Glm Switcher

AI community

Description

Claude Code --glm mode switcher - Toggle between Anthropic subscription and z.ai API with one flag

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Claude Code --glm 모드 전환 설정

Claude Code에서 `--glm` 플래그 하나로 Anthropic 구독과 z.ai API를 쉽게 전환할 수 있습니다.

glm coding plan 가입

GLM 코딩 플랜 초대장 10% 할인 Link: https://z.ai/subscribe?ic=OTYO9JPFNV

설치 방법

macOS / Linux

zsh 사용자 (macOS 기본)

# 1. 설정 파일 열기
nano ~/.zshrc

# 2. claude-glm-zshrc.sh 내용을 맨 아래에 붙여넣기

# 3. API 키 수정
# ZAI_API_KEY="여기에_z.ai_API_키_입력" 부분을 실제 키로 변경

# 4. 저장 후 적용
source ~/.zshrc

bash 사용자 (Linux 기본)

# 1. 설정 파일 열기
nano ~/.bashrc

# 2. claude-glm-bashrc.sh 내용을 맨 아래에 붙여넣기

# 3. API 키 수정
# ZAI_API_KEY="여기에_z.ai_API_키_입력" 부분을 실제 키로 변경

# 4. 저장 후 적용
source ~/.bashrc

Windows (PowerShell)

원클릭 자동 설치 (권장)

# 방법 1: 스크립트 실행 시 API 키 입력
.\install-claude-glm.ps1

# 방법 2: 명령행에서 API 키 직접 지정
.\install-claude-glm.ps1 -ApiKey "여러분의_z.ai_API_키"

**설치 스크립트가 자동으로 수행하는 작업:**

  1. PowerShell 실행 정책 설정 (RemoteSigned)
  2. Claude Code 설치 확인
  3. API 키 입력 및 저장
  4. 기존 claude 파일 백업 (claude-orig.ps1, claude-orig.cmd)
  5. PowerShell 프로필 자동 생성 및 설정

**실행 정책 오류가 발생하면:**

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

**설치 완료 후:**

  • PowerShell을 닫고 새로 열어야 적용됩니다
  • 새 PowerShell에서 claude-status 명령어로 설치 확인

수동 설치 (자동 설치가 안 될 경우)

# 1. PowerShell 프로필 열기
notepad $PROFILE

# 프로필이 없다면 먼저 생성
if (!(Test-Path -Path $PROFILE)) { New-Item -ItemType File -Path $PROFILE -Force }

# 2. 아래 내용을 프로필에 붙여넣기
# (install-claude-glm.ps1의 92-132줄 참조)

# 3. $env:ZAI_API_KEY 부분을 실제 API 키로 변경

# 4. 저장 후 적용
. $PROFILE

사용법

명령어 모드 플랫폼
claude Anthropic 구독 모드 모두
claude --glm z.ai API 모드 모두
claude-status 사용법 확인 모두

추가 옵션 사용

`--glm` 플래그 뒤에 원하는 옵션을 추가할 수 있습니다:

# 모델 지정
claude --glm --model claude-sonnet-4-5-20250929

# 대화 재개
claude --glm --resume

# 기타 모든 claude 옵션 사용 가능
claude --glm [옵션들...]

파일 구성

dist/
├── claude-glm-zshrc.sh       # macOS/zsh용
├── claude-glm-bashrc.sh      # Linux/bash용
├── in