Files
ccs/bin
kaitranntt 03dd3cf857 fix(windows): resolve npm installation PATH detection on Windows
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
2025-11-04 22:47:22 -05:00
..
2025-11-04 21:24:37 -05:00
2025-11-04 21:24:37 -05:00