6.7 KiB
name, description
| name | description |
|---|---|
| deploy | Batch install, update, or uninstall the whole jsc skill set on every installed AI CLI. Detect CLIs via detect-clis.sh, report every plugin's local-versus-published version first and recommend update when any one of them is behind, then ask the user for the mode via decision tree, then run each CLI's native plugin commands with the unified jsc marketplace (token jsc-{domain}@jsc). Domain list comes from the plugins/meta marketplace.json, never hardcoded. After install or update, write this machine's update and remove guides via write-guides.sh and demand a session restart. Use for rollout or removal of the jsc plugins; not for a single skill. |
deploy — batch install, update, or uninstall the skill set
Steps
-
Run
tools/detect-clis.shto find the installed CLIs and their executable paths. Done when the TSV lists at least one CLI with an executable path. -
Check versions before asking anything, so the recommendation is based on fact rather than a guess:
- Run
jsc-hooks/hooks/version-guard.sh report. It prints one line per installed jsc plugin —{domain}<TAB>{本機}<TAB>{遠端}<TAB>{落後|最新|超前|查詢失敗}— and a finalbehind<TAB>{落後個數}. - No local plugin registry → report this CLI as unverifiable, never as up to date. Two forms of the same fact: a report carrying no
{domain}row at all before thebehindline, or the script's explicit no-registry line (noregistry<TAB>{路徑}). Both mean the version check could not run for this CLI, sobehind<TAB>0here proves nothing. State that plainly and base no recommendation on it. - Show that table to the user as-is. It is the evidence behind the recommendation, so never summarise it away.
behind≥ 1 → markupdateas the recommended option, and name every domain that is behind together with its local and remote version. One domain behind is enough; do not wait for a majority.behind= 0 with at least one domain row → recommend nothing; present the three options neutrally.查詢失敗on any domain → say so explicitly. An unverified domain is not the same as an up-to-date one, and must not be counted as either.
Done when the report is shown and either every domain row carries one of the four status literals
落後最新超前查詢失敗, or the CLI is reported as having no local registry and therefore unverifiable. - Run
-
Ask the user for the mode per the
jsc-ask:askrules:install/update/uninstall. Every option states its impact scope: which CLIs it touches and which configs it writes. Done when the user has named exactly one ofinstall,updateoruninstall. -
Get the domain list (never hardcode it; this skill follows automatically when domains are added or removed): read
plugins[].namefrom the unified marketplace viajsc-gitea/tools/gitea.sh api GET /repos/plugins/meta/raw/.claude-plugin/marketplace.json. The marketplace is unified asjsc; the install token isjsc-{domain}@jsc. Eachplugins[].namealready carries thejsc-prefix (e.g.jsc-ask) — pass it totools/deploy.shas-is, prefixed or not; the script normalizes it. Done when the domain list comes from that response and holds at least one name. -
Run
tools/deploy.sh {mode} {cli} {domain}...once per detected CLI, passing the whole domain list in one call so the marketplace command runs only once. This step MUST run as a sub agent (one sub agent per CLI). The script printscmdandexitlines for every command, onerequiresline before each domain update, optionalcompatlines for Codex cache links, and oneresultline at the end;-nprints the commands without running them. On update,tools/check-requires.sh {cli} {manifest}checks each domain'sjsc.requiresbefore that domain is updated. A missing or too-old required jsc plugin prints askipline and leaves that domain untouched. Codex update preserves oldjsc-hookscache version paths as symlinks to the newest installed version, so a still-running Codex session whose hook_run_id points at the old cache can finish withoutNo such file. Antigravity cannot install from a Gitea URL, so the script clones each domain into the local plugin directory (JSC_LOCAL_PLUGINS, default$JSC_HOME/plugins) and installs from that path — keep that clone, because update pulls the same one. That default deliberately avoids a development checkout: when the directory holds uncommitted changes or unpushed commits, the script prints askipline, leaves the tree untouched, and installs the on-disk content. Done when every detected CLI has reported an exit status for every command it ran, and every skipped domain has a dependency reason or local-tree reason. -
After install or update, call
jsc-hooks:hooks-installto rewire the hooks. The hook installer must refresh$JSC_HOME/current/jsc-hooksand must runtools/wire-cli.sh smoke {cli}for every detected CLI. Treat anyNo such filein those smoke results as a failed update and report it; do not let the deploy finish as successful when a rewritten hook path cannot execute. Done when hooks-install reports purge, wiring, smoke and scan results for each detected CLI, and every smoke result is eitherstatus=okor explicitly reported as the update failure. -
After install or update, run
tools/write-guides.sh {mode} {domain}...once for the whole machine, after every CLI in step 5 has finished. It rewrites$JSC_HOME/update-guide.mdand$JSC_HOME/remove-guide.mdfrom the live detection result, so the later update and removal runs have the real commands for this machine. Skip it foruninstall: the guides describe an installed skill set. Done when the script printed awroteline for both files. -
Report the result and any failure reason for every CLI × mode, plus every
skipline, every Codexcompatline, and every CLI that could not be version-checked in step 2. Done when every detected CLI appears in the report with itsresultstatus. -
For install or update, close the report with the restart instruction, in these words: 「請關閉目前的工作階段並重新啟動,新的技能內容才會載入」.
deploy.shrecorded this round in$JSC_HOME/restart-required.d/{cli}— one file per CLI — and prints its path on arestartline;jsc-hooksreads only that CLI's own file and keeps reminding until that CLI restarts, withJSC_RESTART_GATE=offas the escape hatch. Restarting one CLI clears its own file and leaves the others' gates standing. Name the two guide paths from step 7 in the same closing block, so the operator knows where this machine's update and removal commands now live. Done when the restart instruction is printed and both guide paths are named.