Skip to content

Commit 8da9f5a

Browse files
committed
fix: project plugin install
1 parent 3092e32 commit 8da9f5a

4 files changed

Lines changed: 56 additions & 24 deletions

File tree

.claude/install-plugins.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env bash
2+
set -u -o pipefail
3+
4+
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
5+
MARKETPLACE_DIR="$REPO_ROOT/.claude/plugins"
6+
MARKETPLACE_NAME="bitkit-android"
7+
8+
if ! command -v claude >/dev/null 2>&1; then
9+
echo "Error: 'claude' CLI not found on PATH. Install Claude Code first." >&2
10+
exit 1
11+
fi
12+
13+
if [ ! -f "$MARKETPLACE_DIR/.claude-plugin/marketplace.json" ]; then
14+
echo "Error: $MARKETPLACE_DIR/.claude-plugin/marketplace.json not found." >&2
15+
exit 1
16+
fi
17+
18+
if claude plugin marketplace list 2>/dev/null | grep -q "\b${MARKETPLACE_NAME}\b"; then
19+
echo "Updating marketplace '${MARKETPLACE_NAME}'..."
20+
claude plugin marketplace update "${MARKETPLACE_NAME}" || \
21+
echo " (warning: marketplace update failed; continuing)"
22+
else
23+
echo "Adding marketplace '${MARKETPLACE_NAME}'..."
24+
claude plugin marketplace add "${MARKETPLACE_DIR}" --scope user
25+
fi
26+
27+
failures=()
28+
for plugin_dir in "${MARKETPLACE_DIR}"/*/; do
29+
[ -f "${plugin_dir}.claude-plugin/plugin.json" ] || continue
30+
plugin_name="$(basename "${plugin_dir}")"
31+
full="${plugin_name}@${MARKETPLACE_NAME}"
32+
33+
if claude plugin list 2>/dev/null | grep -q "${full}"; then
34+
echo "Updating plugin '${full}'..."
35+
claude plugin update "${full}" || failures+=("${full} (update)")
36+
else
37+
echo "Installing plugin '${full}'..."
38+
claude plugin install "${full}" --scope user || failures+=("${full} (install)")
39+
fi
40+
done
41+
42+
echo ""
43+
if [ "${#failures[@]}" -gt 0 ]; then
44+
echo "Completed with failures: ${failures[*]}" >&2
45+
exit 1
46+
fi
47+
echo "Done. Restart Claude Code if it was running."

.claude/plugins/blocktank-api/README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@ A Claude Code plugin that gives Claude knowledge of the full Blocktank LSP API,
44

55
## Setup
66

7-
Run these two commands once from the repo root:
7+
Run once from the repo root (re-run anytime to update):
88

99
```sh
10-
claude plugin marketplace add ./.claude/plugins --scope user
11-
claude plugin install blocktank-api@bitkit-android --scope user
10+
./.claude/install-plugins.sh
1211
```
1312

14-
Then restart Claude Code if it was already running. The `blocktank-api:lsp` skill (invoked as `/lsp`) will be available.
15-
16-
The repo ships a matching `.claude/settings.json` and `.claude/plugins/.claude-plugin/marketplace.json` so the two commands above resolve against committed, portable definitions — nothing to hand-edit. Verify with `claude plugin list | grep blocktank-api`.
13+
Restart Claude Code once. The `blocktank-api:lsp` skill (invoked as `/lsp`) is then available.
1714

1815
## Usage
1916

.claude/settings.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,16 @@ Reports are generated in: `app/build/reports/detekt/`.
6464

6565
### AI tooling
6666

67-
The repo ships a Claude Code plugin under `.claude/plugins/blocktank-api/` that gives Claude the `/lsp` skill for driving Blocktank LSP during local development. One-time setup after first clone:
67+
The repo ships Claude Code plugins under `.claude/plugins/` to give Claude domain-specific skills for local development:
68+
69+
- [**blocktank-api**](.claude/plugins/blocktank-api/README.md)`/lsp` skill for driving Blocktank LSP during Lightning testing.
70+
71+
Install or update all bundled plugins with:
6872

6973
```sh
70-
claude plugin marketplace add ./.claude/plugins --scope user
71-
claude plugin install blocktank-api@bitkit-android --scope user
74+
./.claude/install-plugins.sh
7275
```
7376

74-
See [.claude/plugins/blocktank-api/README.md](.claude/plugins/blocktank-api/README.md) for usage and configuration.
75-
7677
## Test
7778

7879
**Commands**

0 commit comments

Comments
 (0)