fix: Dockerビルドでのマーケットプレイス追加コマンドを修正 (v1.6.3) - #175
Conversation
## 問題 v1.6.2でも依然としてプラグインがインストールされていませんでした。 ### エラー内容 ``` error: unknown command 'add-marketplace' [WARN] Marketplaces directory not found [INFO] プラグイン: 0 インストール完了、15 失敗/スキップ ``` ### 根本原因 `claude plugin add-marketplace` コマンドは存在しない。 正しくは `claude plugin marketplace add` コマンド。 ## 解決策 ### コマンド修正 **Before**: ```bash claude plugin add-marketplace anthropic/claude-code --name claude-code-plugins claude plugin add-marketplace https://github.com/davila7/claude-code-templates.git --name claude-code-templates claude plugin add-marketplace wshobson/agents --name claude-code-workflows ``` **After**: ```bash claude plugin marketplace add anthropic/claude-code claude plugin marketplace add https://github.com/davila7/claude-code-templates.git claude plugin marketplace add wshobson/agents ``` ### 変更ポイント - `add-marketplace` → `marketplace add` (正しいサブコマンド) - `--name` オプション削除 (不要) ## 期待効果 | 項目 | v1.6.2 | v1.6.3 (This PR) | |------|--------|------------------| | マーケットプレイス追加 | ❌ エラー | ✅ 成功 | | プラグインインストール | ❌ 0/15 | ✅ 15/15 | 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe script Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
PR Review: Dockerビルドでのマーケットプレイス追加コマンド修正 (v1.6.3)概要コマンドの誤りを修正し、Claude CLI v2.0.76の正しいコマンド構造に対応する重要な修正です。 ✅ 承認ポイント1. 根本原因の正確な特定
2. PR説明の品質
3. 影響範囲の限定
🔍 品質面での指摘1. テストカバレッジ不足
|
| 観点 | 評価 | コメント |
|---|---|---|
| コード品質 | ⭐⭐⭐⭐☆ | コマンド修正は正確だが、テスト不足 |
| セキュリティ | ⭐⭐⭐⭐⭐ | 認証情報の適切な管理 |
| パフォーマンス | ⭐⭐⭐⭐⭐ | 影響なし |
| 保守性 | ⭐⭐⭐☆☆ | ドキュメント・テスト不足 |
| 説明品質 | ⭐⭐⭐⭐⭐ | 非常に詳細で追跡可能 |
総合: 承認推奨 ✅
この修正は緊急性が高く、影響範囲も限定的です。テストカバレッジの課題は別PRで対応することを推奨します。
📋 フォローアップPRの提案
-
test: Claude plugin installer のテスト追加 (優先度: 高)
- Batsテストフレームワーク導入
- コマンド構造の検証
- エラーシナリオのテスト
-
docs: プラグインインストールのドキュメント追加 (優先度: 中)
- README更新
- トラブルシューティングガイド
-
refactor: エラーハンドリング改善 (優先度: 低)
- 詳細なエラー分類
- 冪等性の明示的な実装
🤖 Generated with Claude Code
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
script/install-claude-plugins.sh
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: claude-review
🔇 Additional comments (1)
script/install-claude-plugins.sh (1)
53-55: LGTM: Error handling approach is appropriate.The use of
|| echoto handle failures gracefully is appropriate here, as marketplace additions may fail if they already exist. This allows the script to continue with plugin installation even if marketplace initialization encounters issues.
| # 必須マーケットプレイスを追加(正しいコマンド: claude plugin marketplace add) | ||
| claude plugin marketplace add anthropic/claude-code 2>&1 || echo "[WARN] claude-code-plugins already exists or failed to add" | ||
| claude plugin marketplace add https://github.com/davila7/claude-code-templates.git 2>&1 || echo "[WARN] claude-code-templates already exists or failed to add" | ||
| claude plugin marketplace add wshobson/agents 2>&1 || echo "[WARN] claude-code-workflows already exists or failed to add" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's examine the file to understand the context better
cat -n script/install-claude-plugins.sh | head -60 | tail -20Repository: keito4/config
Length of output: 1096
🏁 Script executed:
# Check git history to see what the original command was
cd script && git log -p --follow -S "add-marketplace" -- install-claude-plugins.sh | head -100Repository: keito4/config
Length of output: 39
🏁 Script executed:
# Look for any documentation or comments about Claude CLI in the repo
find . -type f \( -name "*.md" -o -name "*.txt" -o -name "*.sh" \) -exec grep -l "claude.*plugin.*marketplace" {} \; | head -10Repository: keito4/config
Length of output: 157
🏁 Script executed:
# Check git diff for this specific file
git diff HEAD~5..HEAD -- script/install-claude-plugins.sh | head -100Repository: keito4/config
Length of output: 91
🏁 Script executed:
# Read the README for plugin context
cat .claude/plugins/README.mdRepository: keito4/config
Length of output: 3164
🏁 Script executed:
# Search for any documentation about the old command
rg "add-marketplace|claude.*plugin" --type sh --context 3Repository: keito4/config
Length of output: 3691
🌐 Web query:
Claude CLI command syntax "claude marketplace add" OR "claude plugin marketplace add"
💡 Result:
Use the Claude Code plugin command: /plugin marketplace add
Examples:
- Add GitHub repo: /plugin marketplace add owner/repo. [1]
- Add any git URL: /plugin marketplace add https://gitlab.com/company/plugins.git. [1]
- Add local directory: /plugin marketplace add ./my-marketplace (or a direct marketplace.json path). [1]
- You can then list marketplaces with /plugin marketplace list and install plugins with /plugin install name@marketplace. [2]
Sources: [1] Claude Docs — Plugin Marketplaces; [2] Claude Docs — Plugins.
🌐 Web query:
Claude CLI v2.0.76 documentation plugin marketplace
💡 Result:
Here are official docs and resources for Claude Code/CLI plugins and marketplaces (including marketplace commands and examples):
- Plugins (quickstart, plugin structure, install/manage commands). See "Plugins" guide. [1]
- Plugin marketplaces (how to create/add marketplaces, examples, CLI commands like
/plugin marketplace add,/plugin install,/plugin marketplace list, auto-update and team config). [2] - Plugins reference (component schemas: commands, agents, skills, hooks, MCP servers and CLI schemas). [3]
- Community/third‑party registries & CLI helpers (browse/install public plugins easily). [4]
If you want, I can:
- show the exact CLI commands and example marketplace.json manifest for v2.0.76-compatible Claude Code, or
- fetch the changelog entry for v2.0.76 specifically.
Sources:
[1] Claude Docs — Plugins. https://docs.claude.com/en/docs/claude-code/plugins
[2] Claude Docs — Plugin marketplaces. https://docs.claude.com/en/docs/claude-code/plugin-marketplaces
[3] Claude Docs — Plugins reference. https://docs.claude.com/en/docs/claude-code/plugins-reference
[4] Claude-plugins community registry / claude-plugins.dev. https://claude-plugins.dev/
🌐 Web query:
Anthropic GitHub organization "anthropic/claude-code" OR "anthropics/claude-code" official repository
💡 Result:
The official Claude Code repository is under the GitHub org "anthropics" → anthropics/claude-code. [1][2]
Sources:
[1] GitHub — anthropics/claude-code. (github.com)
[2] Anthropic — Claude Code product page. (anthropic.com)
Citations:
- 1: https://github.com/anthropics/claude-code?utm_source=openai
- 2: https://www.anthropic.com/claude-code/?utm_source=openai
Fix marketplace source identifier and update error messages.
Line 53 has a critical typo: anthropic/claude-code should be anthropics/claude-code (the official Anthropic GitHub organization name includes an 's'). The command syntax itself is correct.
Additionally, the error messages on lines 53–55 reference marketplace names (claude-code-plugins, claude-code-templates, claude-code-workflows) that were previously set via the --name option, which has been removed. Update them to reference the actual sources being added:
- claude plugin marketplace add anthropic/claude-code 2>&1 || echo "[WARN] claude-code-plugins already exists or failed to add"
- claude plugin marketplace add https://github.com/davila7/claude-code-templates.git 2>&1 || echo "[WARN] claude-code-templates already exists or failed to add"
- claude plugin marketplace add wshobson/agents 2>&1 || echo "[WARN] claude-code-workflows already exists or failed to add"
+ claude plugin marketplace add anthropics/claude-code 2>&1 || echo "[WARN] Failed to add anthropics/claude-code marketplace"
+ claude plugin marketplace add https://github.com/davila7/claude-code-templates.git 2>&1 || echo "[WARN] Failed to add davila7/claude-code-templates marketplace"
+ claude plugin marketplace add wshobson/agents 2>&1 || echo "[WARN] Failed to add wshobson/agents marketplace"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # 必須マーケットプレイスを追加(正しいコマンド: claude plugin marketplace add) | |
| claude plugin marketplace add anthropic/claude-code 2>&1 || echo "[WARN] claude-code-plugins already exists or failed to add" | |
| claude plugin marketplace add https://github.com/davila7/claude-code-templates.git 2>&1 || echo "[WARN] claude-code-templates already exists or failed to add" | |
| claude plugin marketplace add wshobson/agents 2>&1 || echo "[WARN] claude-code-workflows already exists or failed to add" | |
| # 必須マーケットプレイスを追加(正しいコマンド: claude plugin marketplace add) | |
| claude plugin marketplace add anthropics/claude-code 2>&1 || echo "[WARN] Failed to add anthropics/claude-code marketplace" | |
| claude plugin marketplace add https://github.com/davila7/claude-code-templates.git 2>&1 || echo "[WARN] Failed to add davila7/claude-code-templates marketplace" | |
| claude plugin marketplace add wshobson/agents 2>&1 || echo "[WARN] Failed to add wshobson/agents marketplace" |
🤖 Prompt for AI Agents
In script/install-claude-plugins.sh around lines 52 to 55, fix the marketplace
source identifier typo and update the error messages: change the source
"anthropic/claude-code" to "anthropics/claude-code" and adjust the echo warnings
to reference the actual sources being added (e.g., "anthropics/claude-code",
"https://github.com/davila7/claude-code-templates.git", and "wshobson/agents")
so they accurately state the source already exists or failed to add.
|
🎉 This PR is included in version 1.6.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
問題
v1.6.2のDockerイメージでも依然としてプラグインがインストールされていませんでした。
ビルドログに記録されたエラー
根本原因の詳細分析
存在しないコマンドの使用
# install-claude-plugins.sh で使用していたコマンド(誤り) claude plugin add-marketplace anthropic/claude-code --name claude-code-pluginsClaude CLI v2.0.76の実際のコマンド
正しいコマンド構造:
claude plugin marketplace add <source>結果
add-marketplaceというサブコマンドは存在しない/home/vscode/.claude/plugins/marketplacesディレクトリが空のまま解決策
コマンド修正
Before (v1.6.2):
After (v1.6.3):
変更ポイント
plugin add-marketplaceplugin marketplace add--nameオプションコマンド動作確認(ローカル)
$ claude plugin marketplace add anthropic/claude-code Successfully added marketplace 'claude-code-plugins' $ claude plugin marketplace list Configured marketplaces: ❯ claude-code-plugins Source: GitHub (anthropics/claude-code)期待効果
プラグインインストール
ビルド時間
変更なし - コマンド修正のみ(処理内容は同じ)
ビルドログ(成功時の期待出力)
テスト計画
フェーズ1: ローカルでの確認
フェーズ2: CI/CD ビルド
フェーズ3: DevContainer 起動確認
/pluginコマンドでエラーが出ないか確認影響範囲
Dockerビルド
ローカル環境
DevContainer 環境
/pluginコマンドでエラーが出なくなる関連PR
ロールバック手順
問題が発生した場合:
検証ポイント
マージ後のビルドログで以下を確認:
Successfully added marketplace 'claude-code-plugins'Successfully added marketplace 'claude-code-templates'Successfully added marketplace 'claude-code-workflows'[SUCCESS] 完了: frontend-design@claude-code-plugins(×15回)[INFO] プラグイン: 15 インストール完了、0 失敗/スキップerror: unknown commandが出ないこと🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.