Skip to content

fix(auto-updater): align with actual claude plugin list output format - #9

Merged
baleen37 merged 1 commit into
mainfrom
fix/auto-updater-claude-plugin-list-format
Jan 22, 2026
Merged

fix(auto-updater): align with actual claude plugin list output format#9
baleen37 merged 1 commit into
mainfrom
fix/auto-updater-claude-plugin-list-format

Conversation

@baleen37

@baleen37 baleen37 commented Jan 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • claude plugin list --json의 실제 출력 형식에 맞춰 auto-updater 수정
  • ID 기반 매칭으로 변경 (.id 필드 사용, 형식: "name@marketplace")
  • Mock 테스트 바이너리를 실제 CLI 출력 형식에 맞게 업데이트
  • 구식 /plugin 명령어를 claude plugin으로 교체

Changes

1. update-checker.sh

  • Line 98: claude plugin list --json 추가 (JSON 출력 활성화)
  • Line 118: .[] | select(.id | startswith($name + "@")) (ID 기반 매칭)
  • Marketplace.json의 name과 설치된 플러그인의 ID를 올바르게 매칭

2. auto-updater.bats

  • Mock plugin 바이너리 → claude 바이너리로 변경
  • JSON 출력에 실제 필드 추가: id, scope, enabled, installPath
  • name 필드 제거 (실제 출력에는 없음)
  • 2개의 새 테스트 추가하여 실제 형식 검증

3. README.md

  • 3곳의 /plugin 명령어를 claude plugin으로 교체

Test Plan

bats plugins/auto-updater/tests/auto-updater.bats

✅ 8개 테스트 모두 통과

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added --silent and --check-only command-line flags to the auto-updater for improved control over update behavior.
  • Documentation

    • Updated CLI command references to reflect the correct "claude plugin" syntax throughout documentation and examples.
  • Bug Fixes

    • Improved error handling and robustness around marketplace availability and plugin detection.
    • Enhanced marketplace caching to provide fallback support.

✏️ Tip: You can customize this high-level summary in your review settings.

Changes:
- Update update-checker.sh to use 'claude plugin list --json' instead of '/plugin list'
- Fix plugin matching to use .id field (format: "name@marketplace") instead of .name
- Update mock test binaries to generate realistic JSON output matching actual CLI
- Update README.md to replace deprecated '/plugin' commands with 'claude plugin'
- Add 2 new tests validating real-world plugin ID format handling

This fixes the auto-updater to work correctly with the actual claude CLI
plugin list output format, which uses ID-based matching instead of name-based.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@baleen37
baleen37 merged commit 68b7557 into main Jan 22, 2026
0 of 2 checks passed
@baleen37
baleen37 deleted the fix/auto-updater-claude-plugin-list-format branch January 22, 2026 02:44
@coderabbitai

coderabbitai Bot commented Jan 22, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The auto-updater plugin is refactored to integrate with the new claude plugin CLI commands, introducing remote marketplace fetching with local caching, command-line flags (--silent, --check-only), and JSON-based plugin detection instead of text parsing.

Changes

Cohort / File(s) Summary
Documentation Updates
plugins/auto-updater/README.md
Updated CLI command references from /plugin list and /plugin install to claude plugin list and claude plugin install across update flow, troubleshooting, and architecture sections.
Marketplace Fetching & CLI Integration
plugins/auto-updater/scripts/update-checker.sh
Added remote marketplace fetching with local caching fallback via fetch_marketplace function; replaced plugin operations with claude plugin list --json for JSON-based detection; changed plugin ID matching from exact names to id prefix patterns (e.g., name@); integrated claude plugin install for updates; added --silent and --check-only flag support; added update policy retrieval and timestamp management; enhanced error handling with early-exit conditions.
Test Coverage for New Behavior
plugins/auto-updater/tests/auto-updater.bats
Replaced mock /plugin executable with mock claude executable; updated tests to validate JSON plugin list output with fields like id, version, installPath; added tests for multiple plugins and ID-format parsing (e.g., git-guard@baleen-plugins); configured CLAUDE_PLUGIN_ROOT and MARKETPLACE_FILE environment variables; added test scenarios for --check-only and --silent modes.

Sequence Diagram

sequenceDiagram
    participant UC as Update Checker
    participant CM as Claude CLI
    participant GH as GitHub Marketplace
    participant LC as Local Cache
    participant IP as Installed Plugins

    UC->>LC: Check for cached marketplace
    alt Cached marketplace exists
        LC-->>UC: Return cached marketplace.json
    else Cache miss or stale
        UC->>GH: Fetch marketplace.json
        alt Fetch successful
            GH-->>UC: marketplace.json
            UC->>LC: Update local cache
        else Fetch failed
            UC->>LC: Fall back to cached file
            LC-->>UC: marketplace.json (fallback)
        end
    end

    UC->>CM: claude plugin list --json
    CM->>IP: Query installed plugins
    IP-->>CM: JSON plugin data
    CM-->>UC: JSON output with id, version

    UC->>UC: Parse marketplace & installed plugins
    UC->>UC: Identify plugins needing updates
    
    loop For each plugin requiring update
        UC->>CM: claude plugin install <id>
        CM->>IP: Install/update plugin
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • baleen37/claude-plugins#2: Adds ralph-loop entry to .claude-plugin/marketplace.json—directly consumed by the new marketplace parsing logic in this updater.

Poem

🐰 A rabbit's burrow of updates so fine,
Marketplace caches in perfect line,
Claude CLI calls, no slashes in sight,
Plugins update with --silent delight!

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant