pub fn resolve_npm_cli(name: &str) -> PathBufExpand description
Resolve a Node/npm-style CLI name to an executable path.
Resolution order:
- Env var
<NAME_UPPERCASE>_BINARY(e.g.CLAUDE_BINARY,CODEX_BINARY) — if set, returned verbatim. Lets users pin a specific binary. - On Windows: probe
<name>.exe, then<name>.cmd, then<name>.ps1via thewhichcrate (which respects PATH and is independent of cmd.exe’s PATHEXT handling). - Fallback: return
PathBuf::from(name)soCommand::new()behaves identically to the pre-resolver code on platforms where probing finds nothing.