From e30fefab49af3c65a803a4c4fd37f73442461457 Mon Sep 17 00:00:00 2001 From: nntrivi2001 Date: Tue, 18 Aug 2026 16:43:37 +0700 Subject: [PATCH] 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@ -y` first, and says plainly that /reload-plugins is still a manual step (no CLI/script equivalent exists to apply it automatically). --- docs/PLUGINS.md | 2 +- plugins/ccam/commands/ccam-update.md | 37 +++++++++++++++++++++++----- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/docs/PLUGINS.md b/docs/PLUGINS.md index c89de70..b89605f 100644 --- a/docs/PLUGINS.md +++ b/docs/PLUGINS.md @@ -129,7 +129,7 @@ output goes to `client-build.log` next to it; the server's own output goes to | Command | Does | |---|---| | `/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@ -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 | ### Where things live diff --git a/plugins/ccam/commands/ccam-update.md b/plugins/ccam/commands/ccam-update.md index de005d5..6696a58 100644 --- a/plugins/ccam/commands/ccam-update.md +++ b/plugins/ccam/commands/ccam-update.md @@ -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 -currently installed plugin version. Use this after a plugin update, or when -`/ccam-doctor` reports missing dependencies or a dead server. +Pull the newest `ccam` release from its marketplace, then reinstall the runtime +dependencies and restart the dashboard server against it. Use this to get a new +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 -run: +First, find which marketplace this install's `ccam` came from and pull the +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 node "${CLAUDE_PLUGIN_ROOT}/scripts/plugin-bootstrap.js" --force