Claude-Gemini 통합 도구 'CGMB' v1.1.0: Windows 지원 구현
발행: (2026년 1월 13일 오전 01:00 GMT+9)
3 분 소요
원문: Dev.to
Source: Dev.to
개요
버전 1.1.0 의 CGMB (Claude‑Gemini Multimodal Bridge) 는 전체 Windows 지원, 스캔된 PDF용 OCR, URL 자동 라우팅, 최신 Gemini 모델(gemini-3-flash, gemini-2.5-flash)을 추가합니다.
v1.1.0의 새로운 기능
| 기능 | 설명 | 상태 |
|---|---|---|
| 🪟 Windows 지원 | 경로 정규화 및 드라이브 문자 처리 | ✅ 전체 지원 |
| 📝 OCR 기능 | 스캔된 PDF 지원 | ✅ 신규 |
| 🔄 URL 자동 라우팅 | URL 유형에 따른 레이어 선택 | ✅ 신규 |
| 🚀 최신 모델 | gemini-3-flash, gemini-2.5-flash | ✅ 지원됨 |
Windows 경로 정규화
배경
- v1.0은 Unix 스타일 경로만 처리했습니다.
- Windows 경로:
- 드라이브 문자(
C:,D:…)로 시작 - 구분자로 역슬래시(
\) 사용 - 앞 슬래시와 혼합될 수 있음(
C:/Users/...)
- 드라이브 문자(
구현 (CGMBServer.ts)
// Detect Windows absolute path pattern (case‑insensitive)
const isWindowsAbsolutePath = /^[A-Za-z]:[\/\\]/.test(filePath);
if (isWindows && isWindowsAbsolutePath) {
// Normalize forward slashes to backslashes
preprocessedPath = filePath.replace(/\//g, '\\');
}
const normalizedPath = path.normalize(preprocessedPath);
// Absolute path detection (considering Windows pattern)
const isAbsolute = path.isAbsolute(normalizedPath) || isWindowsAbsolutePath;
const resolvedPath = isAbsolute
? normalizedPath
: path.resolve(baseDir, normalizedPath);
핵심 포인트
- 정규식
/^[A-Za-z]:[\/\\]/은 드라이브 문자를 감지합니다. path.normalize()호출 전에 슬래시를 통일합니다.path.isAbsolute()의 결과를 Windows 패턴 감지와 결합합니다.
프롬프트 기반 경로 감지
// Regex to detect both Windows and Unix paths
const filePathRegex = /(?:[A-Za-z]:\\[^\s"'<>|]+\.[a-zA-Z0-9]+|\/(?!https?:)[^\s"'<>|]+\.[a-zA-Z0-9]+|\.\.?\/[^\s"'<>|]+\.[a-zA-Z0-9]+)/gi;
const localPathsInPrompt = prompt.match(filePathRegex) || [];
사용 예시
CGMB analyze C:\Users\name\Documents\report.pdf
CGMB analyze /home/user/documents/report.pdf
URL 자동 라우팅
이 도구는 이제 URL 유형을 판단하고 요청을 최적의 AI 레이어로 라우팅합니다.
private detectUrlType(url: string): 'pdf' | 'image' | 'audio' | 'web' {
const lower = url.toLowerCase();
const urlPath = lower.split('?')[0] ?? lower;
if (urlPath.endsWith('.pdf') || lower.includes('/pdf')) {
return 'pdf';
}
if (/\.(png|jpg|jpeg|gif|webp|bmp|svg)$/.test(urlPath)) {
return 'image';
}
if (/\.(mp3|wav|m4a|ogg|flac|aac)$/.test(urlPath)) {
return 'audio';
}
return 'web';
}
라우팅 테이블
| URL 유형 | 목적지 | 이유 |
|---|---|---|
| AI Studio | Gemini File API를 통한 OCR 처리 | |
| Images / Audio | AI Studio | 멀티모달 처리 |
| Web pages | Gemini CLI | 실시간 정보 검색 |
설치 및 업그레이드
# New installation
npm install -g claude-gemini-multimodal-bridge
# Upgrade
npm update -g claude-gemini-multimodal-bridge
버전 비교
| 항목 | v1.0.0 | v1.1.0 |
|---|---|---|
| Windows 지원 | ❌ Unix 전용 | ✅ 전체 지원 |
| OCR 기능 | ❌ 없음 | ✅ 스캔된 PDF 지원 |
| URL 라우팅 | 기본 | ✅ 유형 기반 자동 선택 |
| Gemini 모델 | gemini-2.0-flash | gemini-3-flash, gemini-2.5-flash |
향후 계획
- 보다 고급 라우팅 알고리즘
- 새로운 Gemini 모델에 대한 빠른 지원
- 성능 최적화
링크
- GitHub:
- README:
- NPM:
피드백 및 이슈를 환영합니다!