Skip to content

Commit d6bc364

Browse files
cameroncookeclaude
andcommitted
feat(cli): Make upgrade command channel-aware
Each install channel now queries its own source of truth for the latest version instead of always using GitHub Releases. This prevents misleading results when release channels drift — e.g. GitHub may publish a version before the Homebrew tap bumps, or npm dist-tags may lag a pre-release. - Homebrew: `brew info --json=v2` (handles exit-0-with-empty-formulae) - npm-global / npx: `npm view <pkg>@latest version --json` - Unknown: falls back to GitHub Releases latest endpoint Release notes are fetched separately by tag from GitHub and are non-fatal if unavailable (404, timeout, network error). New DI surface: fetchLatestVersionForChannel, fetchReleaseNotesForTag, runChannelLookupCommand (for test isolation). The dependency factory rebuilds derived defaults from merged overrides so tests can mock at any level. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9a6a404 commit d6bc364

File tree

4 files changed

+495
-80
lines changed

4 files changed

+495
-80
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Added
66

7-
- Added `xcodebuildmcp upgrade` command to check for updates and upgrade in place. Supports `--check` (report-only) and `--yes`/`-y` (skip confirmation). Detects install method (Homebrew, npm-global, npx) and runs the appropriate upgrade command. Non-interactive environments exit 1 when an auto-upgrade is possible but `--yes` was not supplied.
7+
- Added `xcodebuildmcp upgrade` command to check for updates and upgrade in place. Supports `--check` (report-only) and `--yes`/`-y` (skip confirmation). Detects install method (Homebrew, npm-global, npx) and queries the appropriate channel source (`brew info`, `npm view`, or GitHub Releases) for the latest version. Non-interactive environments exit 1 when an auto-upgrade is possible but `--yes` was not supplied.
88

99
## [2.3.2]
1010

docs/CLI.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ xcodebuildmcp upgrade --yes
5454

5555
When both `--check` and `--yes` are supplied, `--check` wins.
5656

57+
### Channel-aware version lookup
58+
59+
The version check queries the source of truth for your install channel — `brew info` for Homebrew, `npm view` for npm/npx, or GitHub Releases for unknown installs. This avoids misleading results when release channels drift (e.g. GitHub may publish a version before the Homebrew tap bumps). If the channel-specific lookup fails, the command does not fall back to another source; it reports the error and exits 1.
60+
5761
### Install method behavior
5862

5963
The command detects how XcodeBuildMCP was installed and adapts accordingly:
@@ -73,9 +77,9 @@ When stdin is not a TTY (CI, pipes, scripts):
7377
- `--yes` runs the upgrade for Homebrew and npm-global installs.
7478
- Without `--check` or `--yes`, the command prints the manual upgrade command and exits 1 (it cannot prompt for confirmation).
7579

76-
### GitHub API failures
80+
### Lookup failures
7781

78-
If the release check fails (network error, rate limit, timeout), the command prints the detected install method and manual upgrade instructions, then exits 1.
82+
If the channel-specific version check fails (network error, rate limit, timeout, missing formula), the command prints the detected install method and manual upgrade instructions, then exits 1.
7983

8084
## Tool Options
8185

0 commit comments

Comments
 (0)