Skip to content

Commit eac1195

Browse files
committed
docs: add scripts directory with update-cc-plugins.sh and README
Introduce scripts/ with a bulk plugin updater script and its own README, and add a Scripts section to the main README linking to the new content.
1 parent 7c70806 commit eac1195

3 files changed

Lines changed: 93 additions & 0 deletions

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,20 @@ Using Claude Code with OpenRouter API. OpenRouter provides access to many models
436436

437437
</details>
438438

439+
## Scripts
440+
441+
The [`scripts/`](scripts/) directory contains utility shell scripts for maintaining your Claude Code setup.
442+
443+
| Script | Description |
444+
|--------|-------------|
445+
| [`update-cc-plugins.sh`](scripts/update-cc-plugins.sh) | Update all installed Claude Code marketplaces and plugins/skills in one command |
446+
447+
**Usage:**
448+
449+
```sh
450+
bash ~/.claude/scripts/update-cc-plugins.sh
451+
```
452+
439453
## Limitations
440454

441455
**WebSearch** tool in Claude Code is an [Anthropic specific tool,](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool) and it is not available when you’re not using the official Anthropic API. Hence, if you need web search, you'd need to connect Claude Code with external web search MCP servers, e.g. [Tavily MCP](https://docs.tavily.com/documentation/mcp), [Brave MCP](https://github.com/brave/brave-search-mcp-server), [Firecrawl MCP](https://docs.firecrawl.dev/mcp-server) or [DuckDuckGo Search MCP](https://github.com/nickclyde/duckduckgo-mcp-server).

scripts/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Scripts
2+
3+
Utility shell scripts for maintaining your Claude Code setup.
4+
5+
## update-cc-plugins.sh
6+
7+
Bulk-updates all installed Claude Code marketplaces and plugins/skills in one shot.
8+
9+
**Usage:**
10+
11+
```sh
12+
bash ~/.claude/scripts/update-cc-plugins.sh
13+
```
14+
15+
**What it does:**
16+
17+
1. Runs `claude plugin marketplace update` to refresh all configured marketplaces.
18+
2. Reads `~/.claude/plugins/installed_plugins.json` and calls `claude plugin update <plugin>` for each entry.
19+
3. Prints a summary: how many plugins were updated, skipped (no longer in the marketplace), or failed.

scripts/update-cc-plugins.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Update all Claude Code marketplaces and plugins/skills
5+
6+
GREEN='\033[0;32m'
7+
YELLOW='\033[1;33m'
8+
NC='\033[0m'
9+
10+
info() { echo -e "${GREEN}==>${NC} $*"; }
11+
section() { echo -e "\n${YELLOW}>>> $*${NC}"; }
12+
13+
PLUGINS_JSON="${HOME}/.claude/plugins/installed_plugins.json"
14+
15+
# 1. Update all marketplaces
16+
section "Updating marketplaces"
17+
claude plugin marketplace update
18+
info "All marketplaces updated"
19+
20+
# 2. Update all installed plugins
21+
section "Updating plugins"
22+
python3 - <<'EOF'
23+
import json, subprocess, sys
24+
from pathlib import Path
25+
26+
plugins_file = Path.home() / ".claude/plugins/installed_plugins.json"
27+
data = json.loads(plugins_file.read_text())
28+
29+
ok, not_found, failed = [], [], []
30+
for plugin_key in data["plugins"]:
31+
print(f" Updating {plugin_key}...", end=" ", flush=True)
32+
result = subprocess.run(
33+
["claude", "plugin", "update", plugin_key],
34+
capture_output=True, text=True
35+
)
36+
if result.returncode == 0:
37+
print("ok")
38+
ok.append(plugin_key)
39+
else:
40+
msg = (result.stderr or result.stdout).strip()
41+
if "not found" in msg.lower():
42+
print("skipped (not found in marketplace)")
43+
not_found.append((plugin_key, msg))
44+
else:
45+
print(f"FAILED ({msg})")
46+
failed.append((plugin_key, msg))
47+
48+
print(f"\nResults: {len(ok)} updated, {len(not_found)} skipped, {len(failed)} failed")
49+
if not_found:
50+
print("Skipped (no longer in marketplace — consider uninstalling):")
51+
for name, _ in not_found:
52+
print(f" - {name}")
53+
if failed:
54+
print("Failed:")
55+
for name, msg in failed:
56+
print(f" - {name}: {msg}")
57+
sys.exit(1)
58+
EOF
59+
60+
section "Done — restart Claude Code to apply updates"

0 commit comments

Comments
 (0)