mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
108dda1772
Bare `npm i -g <pkg>` was the install command for every managed tool, but Anthropic and SST now both recommend their native installers over npm. The update path already anchors to native installs (`claude update` and friends), so install was the last place still forcing npm — even when the user's intent was clearly to get the upstream-recommended install. - New `install_command_for(tool)` (non-Windows only): claude and opencode now run the upstream installer with a `|| npm i -g ...@latest` POSIX short-circuit fallback, so the tool still installs if the URL is unreachable. - codex / gemini / openclaw / hermes pass through to the original static command — they have no independent official installer today. - `build_tool_lifecycle_command` now opens `set -o pipefail` alongside `set -e`: without it, `curl ... | bash` where curl fails would have bash exit 0 on empty stdin, silently masking the failure and skipping the `||` fallback. - 6 new `install_strategy` unit tests pin the per-tool install command shape, mirroring the existing anchored_upgrade regression suite. Update routing and Windows install behavior are unchanged.