# `@horu2day/pure-cad-cli` 설치 가이드

공개 npm 패키지. **토큰·`.npmrc` 설정 필요 없음.** Node.js 20+ 만 있으면 한 줄.

---

## 1. 설치

```bash
npm i -g @horu2day/pure-cad-cli
```

확인:

```bash
pure-cad --help
pure-cad new --output empty.dxf
```

기대 stdout: `{"ok":true,"output":"...empty.dxf","ms":...}`

---

## 2. 일회성 실행 (설치 없이)

```bash
npx @horu2day/pure-cad-cli new --output empty.dxf
```

처음 실행 시 약 140 KB 다운로드 + `~/.npm/_npx/` 캐싱.

---

## 3. 프로젝트 로컬

```bash
cd my-cad-project
npm init -y
npm i -D @horu2day/pure-cad-cli
npx pure-cad new --output empty.dxf
```

---

## 4. 동작 확인

```bash
pure-cad new --output empty.dxf
cat empty.dxf | head -5     # "  0\nSECTION\n  2\nHEADER\n..."
pure-cad --help             # run / query / export / new 사용법
```

---

## 5. 업그레이드 / 제거

```bash
npm i -g @horu2day/pure-cad-cli@latest   # 최신
npm i -g @horu2day/pure-cad-cli@0.2.0    # 특정 버전
npm uninstall -g @horu2day/pure-cad-cli  # 제거
```

릴리스 노트: `https://github.com/horu2day/dwgReader/releases?q=cli`

---

## 6. 문제 해결

| 증상 | 원인 / 해결 |
|------|------------|
| `404 Not Found` | npm 캐시 또는 일시 오류. `npm cache clean --force` 후 재시도. registry가 사설로 덮였으면 `npm config get registry`가 `https://registry.npmjs.org/` 인지 확인 |
| `EACCES` 권한 오류 (전역) | `npx @horu2day/pure-cad-cli ...` 로 전역 설치 회피, 또는 npm 전역 prefix를 사용자 폴더로 변경 |
| `Cannot find package '@jitl/...'` | 의존성 미설치. 재설치 |
| 회사 방화벽 차단 | `registry.npmjs.org` 화이트리스트 요청 |
