Skip to content

Commit 8e11bf5

Browse files
authored
fix(claude-code): register marketplaces + fix ARM64 cache path in init-plugins (#74) (#75)
Plugin installs failed silently because marketplaces were never registered before postCreateCommand runs. Also fix the Playwright ARM64 patch to target the runtime cache dir instead of the marketplace source dir, and surface errors instead of suppressing.
1 parent 3590482 commit 8e11bf5

1 file changed

Lines changed: 32 additions & 6 deletions

File tree

‎claude-code/.devcontainer/init-plugins.sh‎

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@ else
1616
echo '{"hasCompletedOnboarding":true}' > "$HOME/.claude/.claude.json"
1717
fi
1818

19+
# ── Claude Code marketplaces ────────────────────────────────────────────────
20+
# The official marketplace is auto-configured on first interactive launch, but
21+
# postCreateCommand runs before that — register explicitly so plugin install works.
22+
MARKETPLACES=(
23+
"anthropics/claude-plugins-official"
24+
"umputun/ralphex"
25+
)
26+
27+
for marketplace in "${MARKETPLACES[@]}"; do
28+
if claude plugin marketplace add "$marketplace" 2>&1; then
29+
echo "✔ Marketplace added: $marketplace"
30+
else
31+
echo "⚠ Failed to add marketplace: $marketplace" >&2
32+
fi
33+
done
34+
1935
# ── Claude Code plugins ─────────────────────────────────────────────────────
2036
# Customize this list — remove plugins you don't use.
2137
PLUGINS=(
@@ -33,17 +49,27 @@ PLUGINS=(
3349
)
3450

3551
for plugin in "${PLUGINS[@]}"; do
36-
claude plugin install "$plugin" 2>/dev/null || true
52+
if claude plugin install "$plugin" 2>&1; then
53+
echo "✔ Installed: $plugin"
54+
else
55+
echo "⚠ Failed to install: $plugin" >&2
56+
fi
3757
done
3858

3959
# ── Playwright MCP: use Chromium on ARM64 (#64) ─────────────────────────────
4060
# @playwright/mcp defaults to --browser chrome, which has no Linux ARM64 builds.
4161
# Patch the plugin config to use chromium instead. No-op on AMD64.
42-
PLAYWRIGHT_MCP_CONFIG="$HOME/.claude/plugins/marketplaces/claude-plugins-official/external_plugins/playwright/.mcp.json"
43-
if [ "$(uname -m)" = "aarch64" ] && [ -f "$PLAYWRIGHT_MCP_CONFIG" ]; then
44-
jq '.playwright.args = ["@playwright/mcp@latest", "--browser", "chromium"]' \
45-
"$PLAYWRIGHT_MCP_CONFIG" > /tmp/playwright-mcp.json \
46-
&& mv /tmp/playwright-mcp.json "$PLAYWRIGHT_MCP_CONFIG"
62+
# Plugins run from the cache dir (~/.claude/plugins/cache), not the marketplace
63+
# source dir. The cache path includes a version hash — resolve via find.
64+
if [ "$(uname -m)" = "aarch64" ]; then
65+
PLAYWRIGHT_MCP_CONFIG=$(find "$HOME/.claude/plugins/cache" \
66+
-path "*/playwright*/.mcp.json" -print -quit 2>/dev/null)
67+
if [ -n "$PLAYWRIGHT_MCP_CONFIG" ]; then
68+
jq '.playwright.args = ["@playwright/mcp@latest", "--browser", "chromium"]' \
69+
"$PLAYWRIGHT_MCP_CONFIG" > /tmp/playwright-mcp.json \
70+
&& mv /tmp/playwright-mcp.json "$PLAYWRIGHT_MCP_CONFIG"
71+
echo "✔ Playwright MCP patched for ARM64 Chromium"
72+
fi
4773
fi
4874

4975
# ── rtk init (token-optimized CLI proxy) ────────────────────────────────────

0 commit comments

Comments
 (0)