Web Analytics

claude-sh

⭐ 111 stars Korean by jdcodes1

claude.sh

Claude 코드를 bash 스크립트로 재작성. 약 1,500줄. npm 패키지 없음.

이유

원래 Claude 코드는 약 380,000줄의 TypeScript와 266개의 npm 의존성을 가집니다. 이것은 curljq만으로 bash에서 동일한 핵심 작업을 수행합니다.

기능

설치

git clone https://github.com/jdcodes1/claude.sh.git
cd claude.sh
chmod +x claude.sh

종속성

런타임 버전은 .tool-versions에 고정되어 있습니다. mise로 설치하세요:

mise install

사용법

export ANTHROPIC_API_KEY="sk-ant-..."
./claude.sh

환경 변수

| 변수 | 기본값 | 설명 | | --- | --- | --- | | ANTHROPIC_API_KEY | (필수) | 당신의 Anthropic API 키 | | CLAUDE_MODEL | claude-sonnet-4-6 | 사용할 모델 | | CLAUDE_MAX_TOKENS | 8192 | 최대 출력 토큰 수 | | ANTHROPIC_API_URL | https://api.anthropic.com | API 기본 URL | | CLAUDE_SH_PERMISSIONS | ask | 권한 모드: ask, allow, 또는 deny |

명령어

/help      — Show help
/cost      — Show session cost
/model     — Show/change model
/clear     — Clear conversation
/save      — Save current session
/resume    — List/resume saved sessions
/commit    — Auto-generate a git commit
/diff      — Show git diff
/quit      — Exit

세션 다시 시작하기

# List saved sessions
./claude.sh
/resume

Resume by number

/resume 1

Resume from CLI

./claude.sh --resume 20240101-120000-12345

아키텍처

claude.sh          # Main REPL loop, slash commands, process_turn()
lib/
  api.sh           # Anthropic API client, SSE streaming via FIFO, retry
  json.sh          # Message construction, session persistence, CLAUDE.md, git context
  tools.sh         # 6 tool implementations + permission system
  tui.sh           # ANSI colors, spinner, display helpers

작동 원리

비교

| | claude.sh | Claude 코드 (TypeScript) | | --- | --- | --- | | 코드 줄 수 | 약 1,500 | 약 380,000 | | 의존성 | curl, jq | 266 npm 패키지 | | 바이너리 크기 | 0 (스크립트) | 약 200MB node_modules | | 시작 시간 | 즉시 | 약 500ms |

테스트

테스트는 bats (Bash 자동화 테스트 시스템)를 사용합니다:

bats test/

License

MIT

--- Tranlated By Open Ai Tx | Last indexed: 2026-07-04 ---