Skip to content

Commit 07dafc0

Browse files
committed
feat: The method to modify and update skills
1 parent 1d803bb commit 07dafc0

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

packages/cli/src/commands/update.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { defineCommand, getConfigDir } from "bailian-cli-core";
55
import { CLI_VERSION } from "../version.ts";
66
import { NPM_PACKAGE, fetchLatestVersion } from "../utils/update-checker.ts";
77

8-
const SKILL_NAME = "bailian-cli";
8+
const SKILL_SOURCE = "modelstudioai/cli";
9+
const SKILL_INSTALL_CMD = `npx skills add ${SKILL_SOURCE} --all -g -y`;
910

1011
/** Build the install command */
1112
function detectInstallCommand(): { cmd: string; label: string } {
@@ -16,11 +17,13 @@ function updateAgentSkill(colors: { green: string; yellow: string; reset: string
1617
const { green, yellow, reset } = colors;
1718
process.stderr.write("\nUpdating agent skill...\n");
1819
try {
19-
execSync(`npx skills update ${SKILL_NAME} -g -y`, { stdio: "inherit" });
20+
// Reinstall (not `skills update`) into ~/.agents/skills/ and sync to all agent apps.
21+
// `--all` on `skills add` means --skill '*' --agent '*' -y (Cursor, Claude Code, etc.).
22+
execSync(SKILL_INSTALL_CMD, { stdio: "inherit" });
2023
process.stderr.write(`${green}\u2713 Agent skill updated.${reset}\n`);
2124
} catch {
2225
process.stderr.write(
23-
`${yellow}Agent skill update skipped. Run manually: npx skills update ${SKILL_NAME} -g -y${reset}\n`,
26+
`${yellow}Agent skill update skipped. Run manually: ${SKILL_INSTALL_CMD}${reset}\n`,
2427
);
2528
}
2629
}
@@ -45,6 +48,7 @@ export default defineCommand({
4548

4649
if (latest && latest === CLI_VERSION) {
4750
process.stderr.write(`${green}\u2713 Already up to date (${CLI_VERSION}).${reset}\n`);
51+
updateAgentSkill({ green, yellow, reset });
4852
return;
4953
}
5054

skills/bailian-cli/assets/issue-reporting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Offer reporting when **none** of EXCLUDE applies **and** any of the following ho
114114

115115
### Before offering to report
116116

117-
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.
117+
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.
118118
2. Confirm `bl auth status` is healthy (for commands that need auth).
119119
3. Retry once with `--verbose` if stderr was thin.
120120

skills/bailian-cli/assets/versioning.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Run this flow **once per session**, before the first `bl` command.
1818
2. **CLI version**`bl --version` (output `bl X.Y.Z`; compare only `X.Y.Z`).
1919
3. If the two strings **differ**, refresh the skill first:
2020
```bash
21-
npx skills update bailian-cli -g -y
21+
npx skills add modelstudioai/cli --all -g -y
2222
```
2323

2424
Do not trust a stale `reference/` when versions mismatch — flags may be wrong.
@@ -36,7 +36,7 @@ bl update
3636
```
3737

3838
`bl update` upgrades `bailian-cli` via npm and, on success, also runs
39-
`npx skills update bailian-cli -g -y` to keep the skill in lockstep.
39+
`npx skills add modelstudioai/cli --all -g -y` to keep the skill in lockstep across all agent apps.
4040

4141
## 3. Update policy — always ask first
4242

0 commit comments

Comments
 (0)