How nvm-windows/cli works
NVM for Windows CLI manages Node.js downloads, installs and removals, caching, and configuration. The principal workflow is a user invoking the CLI to install a version, then select an operating mode/version so the installation becomes active; listing, cache management, configuration, firewall, and malware commands are additional capabilities. Bootstrap and installer modules provide internal setup and installation machinery. The README establishes the product scope, but the sampled excerpts do not show most command-to-installer calls, so those relationships are omitted or marked unverified.
Main entry points: commands Command handlers · installer.go Installer engine · mode.go Operating mode · main.go Command entry
Components 25
CLI entry
- Command entry
src/cmd/main.go - Command handlers
src/commands
Node lifecycle
- Install command
src/commands/install/install.go - Installer engine
src/installer/installer.go - Package verification
src/installer/verification.go - Uninstaller
src/installer/uninstaller.go - Download cache
src/installer/cache.go
Version management
- Version selection
src/commands/use - Version listings
src/commands/list - Cache commands
src/commands/cache - Configuration
src/commands/cfg - Version aliases
src/commands/alias - Version pinning
src/commands/pin.go - Release sync
src/commands/sync.go
Windows integration
- First-run setup
src/bootstrap/init.go - Install identity
src/bootstrap/identity.go - Legacy migration
src/bootstrap/migration.go - Storage paths
src/bootstrap/paths.go - Module firewall
src/commands/firewall/root.go - Malware checks
src/commands/malware/malware.go - Environment report
src/commands/env.go - Operating mode
src/mode/mode.go - Activation links
src/link/link.go - Shim refresh
src/reshim/reshim.go
Other components
- CLI user
Connections 20
- CLI user → Command entry: invokes
- Command entry → Command handlers: runs CLI
src/cmd/main.go - Command handlers → Install command: dispatches
- Install command → Installer engine: starts install
- Installer engine → Package verification: verifies package
- Installer engine → Download cache: uses cache
- Command handlers → Uninstaller: dispatches removal
- Command handlers → Version selection: dispatches selection
- Command handlers → Version listings: dispatches listing
- Command handlers → Cache commands: dispatches cache
- Command handlers → Configuration: dispatches config
- Command handlers → Version aliases: dispatches aliases
- Command handlers → Version pinning: dispatches pinning
- Command handlers → Release sync: dispatches sync
- Command handlers → Module firewall: dispatches firewall
- Command handlers → Malware checks: dispatches checks
- Command handlers → Environment report: dispatches report
- Command handlers → Operating mode: dispatches mode
- Operating mode → Activation links: creates junction
src/mode/mode.go - Operating mode → Shim refresh: refreshes shims
src/mode/mode.go