feat(update): make /ccam-update pull the latest ccam plugin version, not just rebuild the current one

Docs and the command's own instructions previously implied /ccam-update
fetches new code; it only reinstalled deps and restarted the server
against whatever version was already resolved. It now also runs
`claude plugin marketplace update` + `claude plugin update ccam@<mp> -y`
first, and says plainly that /reload-plugins is still a manual step
(no CLI/script equivalent exists to apply it automatically).
This commit is contained in:
2026-08-18 16:43:37 +07:00
parent 8aaa200dd9
commit e30fefab49
2 changed files with 32 additions and 7 deletions
+1 -1
View File
@@ -129,7 +129,7 @@ output goes to `client-build.log` next to it; the server's own output goes to
| Command | Does | | Command | Does |
|---|---| |---|---|
| `/ccam-doctor` | Node version, bootstrap state, runtime deps, server liveness, duplicate hooks, CLI launcher + PATH, MCP build freshness, UI bundle | | `/ccam-doctor` | Node version, bootstrap state, runtime deps, server liveness, duplicate hooks, CLI launcher + PATH, MCP build freshness, UI bundle |
| `/ccam-update` | Reinstall dependencies and restart the server against the current plugin version (`plugin-bootstrap.js --force`) | | `/ccam-update` | Pull the latest `ccam` release via `claude plugin marketplace update` + `claude plugin update ccam@<marketplace> -y`, then reinstall dependencies and restart the server (`plugin-bootstrap.js --force`). The plugin pull needs a manual `/reload-plugins` afterward to take effect in the current session — not scriptable from a command. |
| `/ccam-open` | Build the UI bundle if missing, then print the dashboard URL | | `/ccam-open` | Build the UI bundle if missing, then print the dashboard URL |
### Where things live ### Where things live
+31 -6
View File
@@ -1,13 +1,38 @@
--- ---
description: Refresh CCAM's runtime dependencies and restart the dashboard server description: Pull the latest ccam plugin version and refresh the dashboard runtime
--- ---
Reinstall the runtime dependencies and restart the dashboard server against the Pull the newest `ccam` release from its marketplace, then reinstall the runtime
currently installed plugin version. Use this after a plugin update, or when dependencies and restart the dashboard server against it. Use this to get a new
`/ccam-doctor` reports missing dependencies or a dead server. dashboard build, or when `/ccam-doctor` reports missing dependencies or a dead
server.
This stops the running dashboard server before starting the new one. Say so, then First, find which marketplace this install's `ccam` came from and pull the
run: latest version into the plugin cache:
```bash
INSTALLED=$(claude plugin list 2>/dev/null | grep -o 'ccam@[^ ]*' | head -1)
MARKETPLACE="${INSTALLED#ccam@}"
if [ -z "$MARKETPLACE" ]; then
echo "ccam is not installed as a plugin (checkout install?) - nothing to update this way."
else
claude plugin marketplace update "$MARKETPLACE"
claude plugin update "ccam@$MARKETPLACE" -y
fi
```
That downloads the new version into `~/.claude/plugins/cache/` but does not
take effect in *this* session — Claude Code only re-resolves `${CLAUDE_PLUGIN_ROOT}`
on `/reload-plugins` (a REPL-only action, not scriptable from a command). Say
so plainly: **tell the user to run `/reload-plugins` now**, then either
re-run `/ccam-update` (this time the bootstrap step below runs against the new
version) or just start a new session — `plugin-bootstrap.js` compares the
recorded state against the current plugin version on every `SessionStart` and
rebuilds automatically if they differ.
Then, whether or not a plugin update was just pulled, refresh the runtime
against whatever `${CLAUDE_PLUGIN_ROOT}` currently resolves to. This stops the
running dashboard server before starting the new one. Say so, then run:
```bash ```bash
node "${CLAUDE_PLUGIN_ROOT}/scripts/plugin-bootstrap.js" --force node "${CLAUDE_PLUGIN_ROOT}/scripts/plugin-bootstrap.js" --force