mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 12:15:57 +00:00
CRITICAL fix for Windows npm global installation unable to find Claude CLI in PATH, particularly affecting SSH sessions. Native installation always worked. Root Causes Identified: 1. Node.js spawn() doesn't use Windows PATHEXT variable 2. where.exe returns no-extension file first, but spawn() needs actual .cmd wrapper 3. .cmd files require shell: true to execute (batch scripts, not binaries) Solutions Implemented: 1. Pre-resolve absolute path using where.exe/which before spawning 2. Prefer executables with extensions (.exe, .cmd, .bat) on Windows 3. Auto-detect .cmd/.bat/.ps1 files and use shell: true for execution Changes: - bin/claude-detector.js: Added execSync PATH resolution with extension preference - bin/ccs.js: Added null checks + getSpawnOptions() helper for shell: true - CHANGELOG.md: Comprehensive documentation of Windows-specific fixes Security: - Commands are hardcoded literals (no injection risk) - 5-second timeout on execSync prevents hangs - shell: true only used for verified .cmd files - Documented security considerations Testing: - ✅ Linux: All tests pass, no regressions - ✅ Windows SSH (i9-bootcamp): Verified fix resolves EINVAL and PATH errors Impact: Windows npm users can now use CCS in SSH sessions with npm-installed Claude CLI Fixes: #windows-npm-path-detection