diff --git a/packages/cli/src/commands/update.ts b/packages/cli/src/commands/update.ts index e9bf77d..353c477 100644 --- a/packages/cli/src/commands/update.ts +++ b/packages/cli/src/commands/update.ts @@ -5,7 +5,8 @@ import { defineCommand, getConfigDir } from "bailian-cli-core"; import { CLI_VERSION } from "../version.ts"; import { NPM_PACKAGE, fetchLatestVersion } from "../utils/update-checker.ts"; -const SKILL_NAME = "bailian-cli"; +const SKILL_SOURCE = "modelstudioai/cli"; +const SKILL_INSTALL_CMD = `npx skills add ${SKILL_SOURCE} --all -g -y`; /** Build the install command */ function detectInstallCommand(): { cmd: string; label: string } { @@ -16,11 +17,13 @@ function updateAgentSkill(colors: { green: string; yellow: string; reset: string const { green, yellow, reset } = colors; process.stderr.write("\nUpdating agent skill...\n"); try { - execSync(`npx skills update ${SKILL_NAME} -g -y`, { stdio: "inherit" }); + // Reinstall (not `skills update`) into ~/.agents/skills/ and sync to all agent apps. + // `--all` on `skills add` means --skill '*' --agent '*' -y (Cursor, Claude Code, etc.). + execSync(SKILL_INSTALL_CMD, { stdio: "inherit" }); process.stderr.write(`${green}\u2713 Agent skill updated.${reset}\n`); } catch { process.stderr.write( - `${yellow}Agent skill update skipped. Run manually: npx skills update ${SKILL_NAME} -g -y${reset}\n`, + `${yellow}Agent skill update skipped. Run manually: ${SKILL_INSTALL_CMD}${reset}\n`, ); } } @@ -45,6 +48,7 @@ export default defineCommand({ if (latest && latest === CLI_VERSION) { process.stderr.write(`${green}\u2713 Already up to date (${CLI_VERSION}).${reset}\n`); + updateAgentSkill({ green, yellow, reset }); return; } diff --git a/skills/bailian-cli/assets/issue-reporting.md b/skills/bailian-cli/assets/issue-reporting.md index e70d196..a2082be 100644 --- a/skills/bailian-cli/assets/issue-reporting.md +++ b/skills/bailian-cli/assets/issue-reporting.md @@ -114,7 +114,7 @@ Offer reporting when **none** of EXCLUDE applies **and** any of the following ho ### Before offering to report -1. Align versions: [SKILL.md → Version & updates](../SKILL.md#version--updates-agent--do-first) — run `bl update` and `npx skills update bailian-cli -g -y` if mismatched. +1. Align versions: [SKILL.md → Version & updates](../SKILL.md#version--updates-agent--do-first) — run `bl update` and `npx skills add modelstudioai/cli --all -g -y` if mismatched. 2. Confirm `bl auth status` is healthy (for commands that need auth). 3. Retry once with `--verbose` if stderr was thin. diff --git a/skills/bailian-cli/assets/versioning.md b/skills/bailian-cli/assets/versioning.md index f09dbd9..f6eb2bc 100644 --- a/skills/bailian-cli/assets/versioning.md +++ b/skills/bailian-cli/assets/versioning.md @@ -18,7 +18,7 @@ Run this flow **once per session**, before the first `bl` command. 2. **CLI version** — `bl --version` (output `bl X.Y.Z`; compare only `X.Y.Z`). 3. If the two strings **differ**, refresh the skill first: ```bash - npx skills update bailian-cli -g -y + npx skills add modelstudioai/cli --all -g -y ``` Do not trust a stale `reference/` when versions mismatch — flags may be wrong. @@ -36,7 +36,7 @@ bl update ``` `bl update` upgrades `bailian-cli` via npm and, on success, also runs -`npx skills update bailian-cli -g -y` to keep the skill in lockstep. +`npx skills add modelstudioai/cli --all -g -y` to keep the skill in lockstep across all agent apps. ## 3. Update policy — always ask first