From 0e33c70e65c3e6bafae949f20449d28d15c6b76e Mon Sep 17 00:00:00 2001 From: clh02467605 Date: Fri, 7 Aug 2026 14:09:23 +0800 Subject: [PATCH 1/2] docs: update skill installation instructions to use bl skill add - Replace all instances of `npx skills add modelstudioai/cli --all -g` with `bl skill add --name all` - Update installation documentation in INSTALL.md, README.md, and related files - Modify code references in config/inventory.ts, generate-reference.ts, and other files - Update HTML UI messages to reflect new installation command - Correct setup.md to include binary installation option and update subset install instructions - Adjust versioning documentation to use new skill installation command - Update all SKILL.md files with consistent installation instructions --- AGENTS.md | 2 +- INSTALL.md | 11 +++++----- README.md | 2 +- README.zh.md | 2 +- docs/agents/skill-change.md | 22 +++++++++---------- packages/cli/README.md | 2 +- packages/cli/README.zh.md | 2 +- .../commands/src/commands/config/inventory.ts | 6 ++--- .../commands/src/commands/config/ui-html.ts | 4 ++-- packages/commands/src/commands/update.ts | 3 +-- packages/runtime/src/utils/update-checker.ts | 6 ++--- skills/bailian-cli/README.md | 4 ++-- skills/bailian-cli/README.zh.md | 4 ++-- skills/bailian-cli/SKILL.md | 12 +++++----- skills/bailian-finetune/SKILL.md | 8 +++---- skills/bailian-gen/SKILL.md | 8 +++---- skills/bailian-managed-agent/SKILL.md | 8 +++---- skills/bailian-protocol/README.md | 4 ++-- skills/bailian-protocol/README.zh.md | 4 ++-- skills/bailian-protocol/SKILL.md | 10 ++++----- .../assets/issue-reporting.md | 2 +- skills/bailian-protocol/assets/setup.md | 19 ++++++++-------- skills/bailian-protocol/assets/versioning.md | 12 +++++----- tools/generate-reference.ts | 2 +- 24 files changed, 79 insertions(+), 80 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index ce3b7bbd..222db1ca 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -35,7 +35,7 @@ packages/core/src/auth/ # apiKey / console credential 解析与落盘 packages/core/src/client/ # HTTP client / endpoints / console gateway ``` -Skill / 命令手册随 `skills/bailian-*/` 经 `npx skills add modelstudioai/cli --all -g` 安装(整包装齐,含共享协议 `bailian-protocol`)。业务 skill(`bailian-cli` / `bailian-gen` / `bailian-finetune` / `bailian-managed-agent`)执行前读 `skills/bailian-protocol/`;不要依赖 frontmatter `companions`(安装器不强制)。`tools/generate-reference.ts` 从 **`packages/cli/src/commands.ts`** 按一级命令归属表分流写入各 `skills//reference/`(纳入 git);`tools/sync-skill-metadata.ts` 从 `packages/cli/package.json` 同步各 `skills/*/SKILL.md` 的 `metadata.version`。两者由根脚本 `pnpm run sync:skill-assets` 和 `.vite-hooks/pre-commit` 执行。hub `bailian-cli` 的路由表不复述领域命令明细;SKILL 文案 / 安装约定 / hand-off 见 [docs/agents/skill-change.md](docs/agents/skill-change.md)。 +Skill / 命令手册随 `skills/bailian-*/` 经 `bl skill add --name all` 安装(整包装齐,含共享协议 `bailian-protocol`)。业务 skill(`bailian-cli` / `bailian-gen` / `bailian-finetune` / `bailian-managed-agent`)执行前读 `skills/bailian-protocol/`;不要依赖 frontmatter `companions`(安装器不强制)。`tools/generate-reference.ts` 从 **`packages/cli/src/commands.ts`** 按一级命令归属表分流写入各 `skills//reference/`(纳入 git);`tools/sync-skill-metadata.ts` 从 `packages/cli/package.json` 同步各 `skills/*/SKILL.md` 的 `metadata.version`。两者由根脚本 `pnpm run sync:skill-assets` 和 `.vite-hooks/pre-commit` 执行。hub `bailian-cli` 的路由表不复述领域命令明细;SKILL 文案 / 安装约定 / hand-off 见 [docs/agents/skill-change.md](docs/agents/skill-change.md)。 约定: diff --git a/INSTALL.md b/INSTALL.md index ba44e0f8..148c2127 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -51,19 +51,18 @@ npm install -g bailian-cli 4. 校验:`bl --version`。 -可选 skills(与 CLI 本体无关,按需): +安装 skills(CLI 内置,无需 Git / npx skills): ```bash -npx skills add modelstudioai/cli --all -g +bl skill add --name all ``` -**Supported:** 始终使用 `--all -g`,一次装齐整套 `bailian-*`(含共享协议 `bailian-protocol`)。Agent Skills / `npx skills` **不会**按 metadata 自动拉依赖。 +**Supported:** `--name all` 一次装齐整套 `bailian-*`(含共享协议 `bailian-protocol`)。 -**Advanced / 不推荐:** 子集 `-s` 时 skills CLI 不会自动带上 `bailian-protocol`;若坚持子集,必须手动同时指定,例如: +**Advanced / 按需子集:** ```bash -# Advanced: you MUST include bailian-protocol yourself — installer does not pull it -npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-gen +bl skill add --name bailian-protocol,bailian-gen ``` 安装成功后,用中文简要说明已安装的 skills 及用户可做什么。 diff --git a/README.md b/README.md index bced4e78..24cfca81 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ irm https://bailian.aliyun.com/cli/install.ps1 | iex npm install -g bailian-cli # Agent skills -npx skills add modelstudioai/cli --all -g +bl skill add --name all ``` > Binary install does not require Node.js. `npm install -g` remains fully supported. diff --git a/README.zh.md b/README.zh.md index d09397c3..8d472550 100644 --- a/README.zh.md +++ b/README.zh.md @@ -85,7 +85,7 @@ irm https://bailian.aliyun.com/cli/install.ps1 | iex npm install -g bailian-cli # Agent skills -npx skills add modelstudioai/cli --all -g +bl skill add --name all ``` > 二进制安装不依赖 Node.js。`npm install -g` 长期保留。 diff --git a/docs/agents/skill-change.md b/docs/agents/skill-change.md index b4abc497..38d75215 100644 --- a/docs/agents/skill-change.md +++ b/docs/agents/skill-change.md @@ -11,16 +11,16 @@ ## 统一口径(安装) -1. **Supported install:** `npx skills add modelstudioai/cli --all -g`(整包装齐,含 `bailian-protocol`) -2. **`bailian-protocol` 是共享协议 skill**,业务 skill 执行前应 Read 它;Agent Skills / `npx skills` **不会**按 frontmatter 自动拉依赖 +1. **Supported install:** `bl skill add --name all`(整包装齐,含 `bailian-protocol`) +2. **`bailian-protocol` 是共享协议 skill**,业务 skill 执行前应 Read 它 3. **不要**在 frontmatter 写 `companions`,也不要对外说「companions = 安装器硬依赖」 -4. 子集安装(`-s`)为 **advanced / 不推荐**:skills CLI 不会自动带上 protocol;漏装会导致相对路径 Read 失败 +4. 子集安装:`bl skill add --name bailian-protocol,`;漏装 protocol 会导致相对路径 Read 失败 ## 概念图 ```text bailian-protocol ← 共享协议(consent / 鉴权 / 版本 / 错误上报) - ▲ 靠 --all -g 与业务 skill 同装;非安装器强制 companions + ▲ 靠 `bl skill add --name all` 与业务 skill 同装;非安装器强制 companions │ ┌───────┴────────┬────────────────┬──────────────────┐ bailian-gen bailian-finetune bailian-managed-agent @@ -37,8 +37,8 @@ bailian-gen bailian-finetune bailian-managed-agent ### A. 分层边界 -- [ ] **整包装齐**:安装/升级文案主推 `--all -g`;业务 skill **不**声明 `companions` -- [ ] **协议读取**:CRITICAL / references 可链 `../bailian-protocol/…`;若读不到 → 停止执行 `bl`,提示 `npx skills add modelstudioai/cli --all -g` +- [ ] **整包装齐**:安装/升级文案主推 `bl skill add --name all`;业务 skill **不**声明 `companions` +- [ ] **协议读取**:CRITICAL / references 可链 `../bailian-protocol/…`;若读不到 → 停止执行 `bl`,提示 `bl skill add --name all` - [ ] **软 hand-off**:兄弟业务 skill **只写 skill 名**;已安装则 Read,未安装则 `bl … --help` 或提示整包安装;**不要**把 `../bailian-gen/…` 等写成执行前提 - [ ] **Hub vs 领域**:`bailian-cli` 的「When to use which command」只列 hub 拥有的意图;媒体 / 精调 / managed-agent 各留 hand-off 行,**不抄**领域默认模型与子命令明细 - [ ] **渐进披露**:SKILL 写意图路由与领域硬规则;flags / usage / examples 以 `reference/` 或 `bl --help` 为准,表后保留「勿猜 flag」指向句 @@ -46,9 +46,9 @@ bailian-gen bailian-finetune bailian-managed-agent ### B. 文案与落款一致性 - [ ] 领域 skill(gen / finetune / managed-agent)路由或命令表后有指向 `reference/` 的句;文末 `## references`(protocol + reference)与家族对齐 -- [ ] description 含 WHAT + WHEN + 反触发;安装说明指向 `--all -g`,不写 companions 必装 +- [ ] description 含 WHAT + WHEN + 反触发;安装说明指向 `bl skill add --name all`,不写 companions 必装 - [ ] Quick examples 只演示本 skill 职责(hub 不示范 `bl image` / `bl video` 等) -- [ ] 若改了安装方式:同步 `README.md` / `README.zh.md` / `INSTALL.md` / `skills/*/README*` / `skills/bailian-protocol/assets/setup.md` 中的 `npx skills add …` 示例(改 `INSTALL.md` 时按 [install-doc-change.md](install-doc-change.md) 同步静态页) +- [ ] 若改了安装方式:同步 `README.md` / `README.zh.md` / `INSTALL.md` / `skills/*/README*` / `skills/bailian-protocol/assets/setup.md` 中的 `bl skill add …` 示例(改 `INSTALL.md` 时按 [install-doc-change.md](install-doc-change.md) 同步静态页) ### C. 归属与生成 @@ -60,8 +60,8 @@ bailian-gen bailian-finetune bailian-managed-agent ```sh pnpm run sync:skill-assets -# 本地试装(测本仓库改动,勿只拉远端) -npx skills add "$(pwd)" --all -g -y +# 已发布版本试装 +bl skill add --name all ``` 抽查:打开 `skills/bailian-cli/SKILL.md` 确认无领域子命令明细表、无 `companions`;打开对应领域 skill 确认有「勿猜 flag」与 hand-off。 @@ -69,7 +69,7 @@ npx skills add "$(pwd)" --all -g -y ## 常见漏点 - ✗ hub 路由表再次抄回 image / video / finetune / managed-agent 明细 → token 膨胀且与领域 skill 双份漂移 -- ✗ 重新加回 `companions` 并宣称安装器硬依赖 → 与 Agent Skills / `npx skills` 合同不符 +- ✗ 重新加回 `companions` 并宣称安装器硬依赖 → 与 `bl skill add` 合同不符 - ✗ 软 hand-off 写成硬路径 `../bailian-*/SKILL.md` 当执行前提 → 子集安装断链 - ✗ 只改 SKILL、忘改 `GROUP_OWNER_SKILL` → reference 落错 skill - ✗ 手改 `skills/*/reference/*.md` → 下次 generate 被覆盖 diff --git a/packages/cli/README.md b/packages/cli/README.md index bced4e78..24cfca81 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -87,7 +87,7 @@ irm https://bailian.aliyun.com/cli/install.ps1 | iex npm install -g bailian-cli # Agent skills -npx skills add modelstudioai/cli --all -g +bl skill add --name all ``` > Binary install does not require Node.js. `npm install -g` remains fully supported. diff --git a/packages/cli/README.zh.md b/packages/cli/README.zh.md index d09397c3..8d472550 100644 --- a/packages/cli/README.zh.md +++ b/packages/cli/README.zh.md @@ -85,7 +85,7 @@ irm https://bailian.aliyun.com/cli/install.ps1 | iex npm install -g bailian-cli # Agent skills -npx skills add modelstudioai/cli --all -g +bl skill add --name all ``` > 二进制安装不依赖 Node.js。`npm install -g` 长期保留。 diff --git a/packages/commands/src/commands/config/inventory.ts b/packages/commands/src/commands/config/inventory.ts index 5ec9c498..bd45fa23 100644 --- a/packages/commands/src/commands/config/inventory.ts +++ b/packages/commands/src/commands/config/inventory.ts @@ -1,5 +1,5 @@ // Read-only discovery of locally installed AI tooling, surfaced by `config ui`: -// - Agent skills installed under ~/.agents/skills (via `npx skills add`). +// - Agent skills installed under ~/.agents/skills (via `bl skill add`). // - MCP servers declared in each coding agent's local config file. // - Coding agent frameworks and whether the bailian-cli provider is wired in. // @@ -128,8 +128,8 @@ function countFiles(dir: string, budget = 500): number { } /** - * Skill directories to scan, keyed by the module that owns them. `npx skills - * add --all` fans skills out into each installed agent, so the same skill can + * Skill directories to scan, keyed by the module that owns them. `bl skill + * add --name all` fans skills out into each installed agent, so the same skill can * live in several of these roots at once. */ function skillRoots(home: string): Array<{ source: string; dir: string }> { diff --git a/packages/commands/src/commands/config/ui-html.ts b/packages/commands/src/commands/config/ui-html.ts index 6f9a04a2..4f31ab53 100644 --- a/packages/commands/src/commands/config/ui-html.ts +++ b/packages/commands/src/commands/config/ui-html.ts @@ -548,7 +548,7 @@ export const PAGE_HTML = `

Installed Skills

-

Agent skills discovered across every local agent module (~/.agents/skills plus each agent's skills folder). Installed via npx skills add.

+

Agent skills discovered across every local agent module (~/.agents/skills plus each agent's skills folder). Installed via bl skill add.

Loading…
@@ -1444,7 +1444,7 @@ export const PAGE_HTML = ` function renderSkills() { var body = document.getElementById('skillsBody'); var pager = document.getElementById('skillsPager'); - if (!SKILLS.length) { pager.innerHTML = ''; renderEmpty(body, 'No skills installed.', 'Install with npx skills add modelstudioai/cli --all -g'); return; } + if (!SKILLS.length) { pager.innerHTML = ''; renderEmpty(body, 'No skills installed.', 'Install with bl skill add --name all'); return; } var list = SKILLS.filter(function (s) { return skillMatches(s, SKILL_Q); }); if (!list.length) { pager.innerHTML = ''; renderEmpty(body, 'No skills match "' + SKILL_Q + '".', ''); return; } var info = pageSlice(list, SKILL_PAGE, getPageSize('skills')); SKILL_PAGE = info.page; diff --git a/packages/commands/src/commands/update.ts b/packages/commands/src/commands/update.ts index cb67263d..e9692d90 100644 --- a/packages/commands/src/commands/update.ts +++ b/packages/commands/src/commands/update.ts @@ -20,8 +20,7 @@ import { type AnsiStyles, } from "bailian-cli-runtime"; -const SKILL_SOURCE = "modelstudioai/cli"; -const SKILL_INSTALL_CMD = `npx skills add ${SKILL_SOURCE} --all -g -y`; +const SKILL_INSTALL_CMD = "bl skill add --name all"; function updateAgentSkill(color: AnsiStyles): void { process.stderr.write("\nUpdating agent skill...\n"); diff --git a/packages/runtime/src/utils/update-checker.ts b/packages/runtime/src/utils/update-checker.ts index 44dcabc4..1ae51104 100644 --- a/packages/runtime/src/utils/update-checker.ts +++ b/packages/runtime/src/utils/update-checker.ts @@ -299,13 +299,11 @@ export async function performAutoUpdate( try { process.stderr.write(` ${dim}Syncing agent skill...${reset}\n`); - execSync(`npx skills add modelstudioai/cli --all -g -y`, { stdio: "inherit" }); + execSync(`bl skill add --name all`, { stdio: "inherit" }); process.stderr.write(` ${green}✓ Agent skill updated.${reset}\n\n`); } catch (err) { process.stderr.write(` ${yellow}⚠ Agent skill sync failed: ${errorMessage(err)}${reset}\n`); - process.stderr.write( - ` ${yellow} Run manually: npx skills add modelstudioai/cli --all -g -y${reset}\n\n`, - ); + process.stderr.write(` ${yellow} Run manually: bl skill add --name all${reset}\n\n`); } pendingNotification = null; diff --git a/skills/bailian-cli/README.md b/skills/bailian-cli/README.md index d95e5aea..df45eaf6 100644 --- a/skills/bailian-cli/README.md +++ b/skills/bailian-cli/README.md @@ -4,11 +4,11 @@ Agent skill for **Alibaba Cloud Model Studio CLI** (`bl`) resource hub — apps, memory, RAG, usage/quota, MCP, and hub `reference/`. -- Shared protocol: `bailian-protocol` (install via `--all -g`) +- Shared protocol: `bailian-protocol` (install via `bl skill add --name all`) - Soft hand-offs (optional skills): `bailian-gen` · `bailian-finetune` · `bailian-managed-agent` ```bash -npx skills add modelstudioai/cli --all -g +bl skill add --name all ``` For CLI installation, authentication, and examples, see the [main README](../../README.md). diff --git a/skills/bailian-cli/README.zh.md b/skills/bailian-cli/README.zh.md index 360ef221..13c09ffb 100644 --- a/skills/bailian-cli/README.zh.md +++ b/skills/bailian-cli/README.zh.md @@ -4,11 +4,11 @@ **阿里云百炼 CLI**(`bl`)的资源管理 Agent 技能 — 应用、记忆、RAG、用量/额度、MCP,以及 hub `reference/`。 -- 共享协议:`bailian-protocol`(通过 `--all -g` 与整家族同装) +- 共享协议:`bailian-protocol`(通过 `bl skill add --name all` 与整家族同装) - 软 hand-off(可选):`bailian-gen` · `bailian-finetune` · `bailian-managed-agent` ```bash -npx skills add modelstudioai/cli --all -g +bl skill add --name all ``` CLI 的安装、认证和使用示例请查看[主 README](../../README.zh.md)。 diff --git a/skills/bailian-cli/SKILL.md b/skills/bailian-cli/SKILL.md index e6196352..2158b162 100644 --- a/skills/bailian-cli/SKILL.md +++ b/skills/bailian-cli/SKILL.md @@ -10,7 +10,7 @@ description: >- 工作空间、MCP 市场、pipeline、文件上传、console API、登录鉴权与配置、 Agent skill 安装/列表/更新/卸载(bl skill add|list|update|remove,百炼 skill registry)。 用户点名百炼 / DashScope / `bl`,或继续既有 `bl` 工作流时直接使用。 - 共享协议(consent / 版本预检 / 鉴权 / 错误上报)在 bailian-protocol;官方安装 `npx skills add modelstudioai/cli --all -g`。 + 共享协议(consent / 版本预检 / 鉴权 / 错误上报)在 bailian-protocol;官方安装 `bl skill add --name all`。 家族路由:生图/生视频/配音/语音合成/转写 → bailian-gen;精调/微调/训练/数据集 → bailian-finetune; agents.yaml 托管 Agent → bailian-managed-agent。 不要用于普通问答、编程、写作、翻译、摘要、泛搜索,或图片理解等宿主自己能做的任务(普通问答、编程、写作、翻译、摘要、泛搜索不触发)。 @@ -19,14 +19,14 @@ description: >- # Aliyun Model Studio CLI (`bl`) -**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Provider selection and consent, Version & updates (pre-flight checklist), Setup & auth, and CLI errors: report an issue. If that protocol file is missing, stop and run `npx skills add modelstudioai/cli --all -g`; do not guess auth/consent.** +**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Provider selection and consent, Version & updates (pre-flight checklist), Setup & auth, and CLI errors: report an issue. If that protocol file is missing, stop and run `bl skill add --name all`; do not guess auth/consent.** > **Family hub** — This skill owns Bailian resource commands and the hub `reference/` (apps, knowledge, usage, auth, config, …). -> Shared protocol → [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md) (install the full family with `--all -g`). -> Soft hand-offs by skill name (Read if installed; else `bl … --help` / prompt `npx skills add modelstudioai/cli --all -g`): `bailian-gen` (media) · `bailian-finetune` (training) · `bailian-managed-agent` (agents.yaml IaC). +> Shared protocol → [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md) (install the full family with `bl skill add --name all`). +> Soft hand-offs by skill name (Read if installed; else `bl … --help` / prompt `bl skill add --name all`): `bailian-gen` (media) · `bailian-finetune` (training) · `bailian-managed-agent` (agents.yaml IaC). > Do not invoke it for ordinary reasoning, coding, writing, translation, summarization, generic research, or image understanding the host agent can complete directly. > -> **Install (supported):** `npx skills add modelstudioai/cli --all -g` +> **Install (supported):** `bl skill add --name all` ## Command reference (authoritative) @@ -113,7 +113,7 @@ schema-export commands. ## Routing reminders -- Image/video/audio generation or editing → skill `bailian-gen` (class 3 consent from `bailian-protocol`). Fine-tuning / datasets / deployments → `bailian-finetune`. agents.yaml IaC → `bailian-managed-agent`. Soft hand-off: Read sibling skill if installed; else `bl … --help` or prompt `npx skills add modelstudioai/cli --all -g`. Image understanding the host agent can do → host-first; use `bl vision` / `bl omni` only when the user names a Bailian model or the media (video/audio files) exceeds host capability. +- Image/video/audio generation or editing → skill `bailian-gen` (class 3 consent from `bailian-protocol`). Fine-tuning / datasets / deployments → `bailian-finetune`. agents.yaml IaC → `bailian-managed-agent`. Soft hand-off: Read sibling skill if installed; else `bl … --help` or prompt `bl skill add --name all`. Image understanding the host agent can do → host-first; use `bl vision` / `bl omni` only when the user names a Bailian model or the media (video/audio files) exceeds host capability. - Answer ordinary reasoning, coding, writing, translation, summarization, and generic research with the host agent's native capabilities; do not bounce them through `bl text chat` or `bl search web`. - Usage / quota / credits questions that do not name a product → ask which product (Bailian or another AI service) first; run `bl usage` / `bl quota` only after the user picks Bailian or Bailian context is already established. - "Remember this" and memory requests default to the host agent's own memory; `bl memory *` is only for Bailian app memory resources. diff --git a/skills/bailian-finetune/SKILL.md b/skills/bailian-finetune/SKILL.md index bfb090b1..f2efd1b3 100644 --- a/skills/bailian-finetune/SKILL.md +++ b/skills/bailian-finetune/SKILL.md @@ -11,12 +11,12 @@ description: >- upload 拿 file-id → finetune create 建任务 → watch 看进度 → export 导出 → deploy 上线,需要 API key; 写操作先用 `--dry-run` 预览。反触发:用户点名火山方舟/ark 的精调不走本 skill;只是要选哪个模型走 bailian-model-recommend;用现成模型生图生视频走 bailian-gen;百炼其他资源管理走 bailian-cli。 - 官方安装:`npx skills add modelstudioai/cli --all -g`(与共享协议 bailian-protocol 同装)。 + 官方安装:`bl skill add --name all`(与共享协议 bailian-protocol 同装)。 --- # Bailian fine-tuning pipeline (`bl dataset` / `bl finetune` / `bl deploy`) -**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Version & updates (pre-flight checklist), Setup & auth, and CLI errors: report an issue. Command details are authoritative in [`reference/`](reference/index.md) (dataset / finetune / deploy) and `bl --help` — do not guess flags. The whole pipeline requires an API key. If that protocol file is missing, stop and run `npx skills add modelstudioai/cli --all -g`; do not guess auth/consent.** +**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Version & updates (pre-flight checklist), Setup & auth, and CLI errors: report an issue. Command details are authoritative in [`reference/`](reference/index.md) (dataset / finetune / deploy) and `bl --help` — do not guess flags. The whole pipeline requires an API key. If that protocol file is missing, stop and run `bl skill add --name all`; do not guess auth/consent.** ## End-to-end workflow (follow in order) @@ -63,7 +63,7 @@ bl deploy text create --model my-qwen-sft --name my-svc ## Common hand-offs -软 hand-off(按 skill **名**;已安装则 Read,否则 `--help` / 提示 `npx skills add modelstudioai/cli --all -g`): +软 hand-off(按 skill **名**;已安装则 Read,否则 `--help` / 提示 `bl skill add --name all`): - After deployment, try the model or generate content → skill `bailian-gen` (media) or `bl text chat` (fallback: `bl image\|video\|text --help`). - Unsure which base model to pick → `bailian-model-recommend` / `bl advisor recommend`. @@ -71,5 +71,5 @@ bl deploy text create --model my-qwen-sft --name my-svc ## references -- [bailian-protocol](../bailian-protocol/SKILL.md) — shared protocol (install via `--all -g`) +- [bailian-protocol](../bailian-protocol/SKILL.md) — shared protocol (install via `bl skill add --name all`) - [reference/](reference/index.md) — command details diff --git a/skills/bailian-gen/SKILL.md b/skills/bailian-gen/SKILL.md index 9a6c3e88..12d9bcfb 100644 --- a/skills/bailian-gen/SKILL.md +++ b/skills/bailian-gen/SKILL.md @@ -13,12 +13,12 @@ description: >- 图片和语音同步返回并落地本地文件,视频是异步任务、用 `--download` 或轮询取回;本地文件直接传路径,CLI 自动上传。 反触发:宿主自己能做的图片理解、普通问答、编程、写作、翻译不走本技能;百炼应用/知识库/用量/额度走 bailian-cli; 精调训练走 bailian-finetune。 - 官方安装:`npx skills add modelstudioai/cli --all -g`(与共享协议 bailian-protocol 同装)。 + 官方安装:`bl skill add --name all`(与共享协议 bailian-protocol 同装)。 --- # Bailian media generation (`bl image` / `bl video` / `bl speech` / `bl omni`) -**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Provider selection and consent (one-time ask templates), Version & updates (pre-flight checklist), and CLI errors: report an issue. Command details are authoritative in [`reference/`](reference/index.md) and `bl --help` — do not guess flags. If that protocol file is missing, stop and run `npx skills add modelstudioai/cli --all -g`; do not guess auth/consent.** +**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Provider selection and consent (one-time ask templates), Version & updates (pre-flight checklist), and CLI errors: report an issue. Command details are authoritative in [`reference/`](reference/index.md) and `bl --help` — do not guess flags. If that protocol file is missing, stop and run `bl skill add --name all`; do not guess auth/consent.** ## Consent (short version; full rules in bailian-protocol) @@ -76,7 +76,7 @@ If one or more `bl` commands actually ran, proactively add a one-line summary in ## Common hand-offs -软 hand-off(按 skill **名**;已安装则 Read,否则 `--help` / 提示 `npx skills add modelstudioai/cli --all -g`): +软 hand-off(按 skill **名**;已安装则 Read,否则 `--help` / 提示 `bl skill add --name all`): - Generation failed and it is not a usage/auth/content-filter issue → follow the issue-reporting flow in `bailian-protocol` ([`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md#cli-errors-report-an-issue)) and ask once whether to report. - Managing Bailian apps / knowledge bases / usage → skill `bailian-cli` (fallback: `bl app\|knowledge\|usage --help`). @@ -84,5 +84,5 @@ If one or more `bl` commands actually ran, proactively add a one-line summary in ## references -- [bailian-protocol](../bailian-protocol/SKILL.md) — shared protocol (install via `--all -g`) +- [bailian-protocol](../bailian-protocol/SKILL.md) — shared protocol (install via `bl skill add --name all`) - [reference/](reference/index.md) — command details diff --git a/skills/bailian-managed-agent/SKILL.md b/skills/bailian-managed-agent/SKILL.md index 256028bb..31f82b09 100644 --- a/skills/bailian-managed-agent/SKILL.md +++ b/skills/bailian-managed-agent/SKILL.md @@ -11,12 +11,12 @@ description: >- apply / destroy 变更远端资源且必须带 `--yes`,务必先 plan 给用户看 diff 再让其确认。 反触发:调用已上线的百炼应用/智能体走 bailian-app-call 或 `bl app`;宿主 agent 自身的记忆、技能、 子代理不走本 skill;生图生视频走 bailian-gen。 - 官方安装:`npx skills add modelstudioai/cli --all -g`(与共享协议 bailian-protocol 同装)。 + 官方安装:`bl skill add --name all`(与共享协议 bailian-protocol 同装)。 --- # Bailian managed agent IaC (`bl managed-agent`) -**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Version & updates (pre-flight checklist) and CLI errors: report an issue. Command details are authoritative in [`reference/managed-agent.md`](reference/managed-agent.md) and `bl managed-agent --help` — do not guess flags. If that protocol file is missing, stop and run `npx skills add modelstudioai/cli --all -g`; do not guess auth/consent.** +**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Version & updates (pre-flight checklist) and CLI errors: report an issue. Command details are authoritative in [`reference/managed-agent.md`](reference/managed-agent.md) and `bl managed-agent --help` — do not guess flags. If that protocol file is missing, stop and run `bl skill add --name all`; do not guess auth/consent.** ## Safety guardrail (the most important rule) @@ -60,7 +60,7 @@ Flags, usage, and examples: see [`reference/`](reference/index.md) or `bl - 阿里云百炼 `bl` 家族共享执行协议(consent 确认、版本预检、鉴权/安装、错误上报、本地文件与输出约定)。 不是面向用户意图的业务入口;当任一 bailian-* 业务 skill(bailian-cli / bailian-gen / bailian-finetune / bailian-managed-agent)执行前需要公共上下文,或用户首次安装/鉴权/`bl` 报错需上报时读取本 skill。 - 官方安装为整包:`npx skills add modelstudioai/cli --all -g`(与业务 skill 同装);Agent Skills / `npx skills` 不会按 metadata 自动拉依赖。 + 官方安装为整包:`bl skill add --name all`(与业务 skill 同装)。 --- # Bailian shared protocol (`bailian-protocol`) @@ -18,10 +18,10 @@ description: >- > **Install(supported):** 整包装齐,含本 skill 与全部业务 skill: > > ```bash -> npx skills add modelstudioai/cli --all -g +> bl skill add --name all > ``` > -> Agent Skills / `npx skills` **不会**解析 frontmatter 依赖字段。子集 `-s` 为 advanced / 不推荐;若坚持子集,必须**手动**同时带上 `bailian-protocol`,否则业务 skill 的相对路径 Read 会失败。 +> 子集安装请显式带上 `bailian-protocol`(例如 `bl skill add --name bailian-protocol,bailian-gen`),否则业务 skill 的相对路径 Read 会失败。 ## Provider selection and consent @@ -44,7 +44,7 @@ After approval, treat Bailian as selected for the current task. Do not ask again ## Family routing & hand-offs 业务路由(**软 hand-off**:按 skill **名**路由;已安装则 Read 其 `SKILL.md`,未安装则用 `bl --help`,或提示整包安装 -`npx skills add modelstudioai/cli --all -g`): +`bl skill add --name all`): | Intent | Skill | Fallback | | ------------------------------------- | ----------------------- | ----------------------------------------------- | @@ -55,7 +55,7 @@ After approval, treat Bailian as selected for the current task. Do not ask again **共享协议** vs **软 hand-off**: -- `bailian-protocol`:靠 `--all -g` 与业务 skill 同装;CRITICAL 可用相对路径 `../bailian-protocol/…`。读不到则停止跑 `bl`,提示整包安装。 +- `bailian-protocol`:靠 `bl skill add --name all` 与业务 skill 同装;CRITICAL 可用相对路径 `../bailian-protocol/…`。读不到则停止跑 `bl`,提示整包安装。 - 其它 bailian-\* 业务 skill:只按名字提及,**不要**写死 `../bailian-*/SKILL.md` 当执行前提。 ## Version & updates (after provider selection, before the first `bl` command) diff --git a/skills/bailian-protocol/assets/issue-reporting.md b/skills/bailian-protocol/assets/issue-reporting.md index 6ea6e831..c75e2719 100644 --- a/skills/bailian-protocol/assets/issue-reporting.md +++ b/skills/bailian-protocol/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-after-provider-selection-before-the-first-bl-command) — run `bl update` and `npx skills add modelstudioai/cli --all -g -y` if mismatched. +1. Align versions: [SKILL.md → Version & updates](../SKILL.md#version--updates-after-provider-selection-before-the-first-bl-command) — run `bl update` and `bl skill add --name all` 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-protocol/assets/setup.md b/skills/bailian-protocol/assets/setup.md index 272c7bd2..2bae59dd 100644 --- a/skills/bailian-protocol/assets/setup.md +++ b/skills/bailian-protocol/assets/setup.md @@ -12,15 +12,16 @@ inspect config keys. Day-to-day command routing lives in the business skills ## Install ```bash -npm install -g bailian-cli -# Recommended: install the full bailian-* skill family (includes bailian-protocol) -npx skills add modelstudioai/cli --all -g - -# Advanced / not recommended: skills CLI does not auto-pull bailian-protocol -# npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-gen -# npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-finetune -# npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-managed-agent -# npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-cli +# Recommended binary install (no Node), or: npm install -g bailian-cli +curl -fsSL https://bailian.aliyun.com/cli/install.sh | bash +# Install the full bailian-* skill family (includes bailian-protocol) +bl skill add --name all + +# Advanced / subset (comma-separated names; include bailian-protocol when needed) +# bl skill add --name bailian-protocol,bailian-gen +# bl skill add --name bailian-protocol,bailian-finetune +# bl skill add --name bailian-protocol,bailian-managed-agent +# bl skill add --name bailian-protocol,bailian-cli ``` Verify: `bl --version` (prints `bl X.Y.Z`). diff --git a/skills/bailian-protocol/assets/versioning.md b/skills/bailian-protocol/assets/versioning.md index 6976432e..804349dc 100644 --- a/skills/bailian-protocol/assets/versioning.md +++ b/skills/bailian-protocol/assets/versioning.md @@ -16,7 +16,7 @@ 3. Compare the two versions (ignore the `bl` prefix; compare only `X.Y.Z`): - If `metadata.version` ≠ `bl --version`, refresh skills before doing anything else: ```bash - npx skills add modelstudioai/cli --all -g -y + bl skill add --name all ``` - Do not trust a stale `reference/` when versions mismatch — flags may be wrong. 4. Check the latest published CLI version: @@ -26,7 +26,7 @@ 5. If the installed `bl` is **older** than the latest npm version, **STOP** the current task and **ask the user** (report skill version, installed CLI version, and npm latest): > A newer version of bl is available (current: X.Y.Z, latest: A.B.C). Upgrade before continuing? - **Do NOT auto-upgrade silently** — the user decides. - - If the user agrees: run `bl update`, then continue. (`bl update` upgrades `bailian-cli` via npm and, on success, also runs `npx skills add modelstudioai/cli --all -g -y` to keep skills in lockstep across all agent apps.) + - If the user agrees: run `bl update`, then continue. (`bl update` upgrades `bailian-cli` via npm and, on success, also runs `bl skill add --name all` to keep skills in lockstep across all agent apps.) - If the user declines: continue with the current version and note it in the summary. - If `npm view` / `bl update` fails (offline, registry blocked, permission): continue with the current `bl` and tell the user it could not be updated. 6. Only proceed with the user's actual task after the above is resolved. @@ -38,11 +38,13 @@ If `bl --version` fails, install the CLI and skills: ```bash -npm install -g bailian-cli -npx skills add modelstudioai/cli --all -g +# Recommended — no Node required +curl -fsSL https://bailian.aliyun.com/cli/install.sh | bash +# Or: npm install -g bailian-cli +bl skill add --name all ``` -Do not install a single business skill alone — use `--all -g` so `bailian-protocol` is present. +Do not install a single business skill alone — use `--name all` so `bailian-protocol` is present. ## Mention it in the task summary diff --git a/tools/generate-reference.ts b/tools/generate-reference.ts index 976d80a7..fee3ef12 100644 --- a/tools/generate-reference.ts +++ b/tools/generate-reference.ts @@ -7,7 +7,7 @@ * Ownership of each top-level command group is declared in `GROUP_OWNER_SKILL` below. * Unmapped groups fall back to `bailian-cli` (hub) so new commands never block generation. * - * Committed to git; consumed by bailian-* Agent Skills (`npx skills add modelstudioai/cli`). + * Committed to git; consumed by bailian-* Agent Skills (`bl skill add --name all`). * * Run: pnpm --filter bailian-cli run generate:reference * Also run via `pnpm run sync:skill-assets` or the repo pre-commit hook. From 9ae5dc924d7c40f84ee26cbf70830985ab383ce6 Mon Sep 17 00:00:00 2001 From: clh02467605 Date: Fri, 7 Aug 2026 17:56:30 +0800 Subject: [PATCH 2/2] docs(cli): update skill installation command from add --name all to init - Replace `bl skill add --name all` with `bl skill init` across documentation - Update installation instructions in README, INSTALL, and agent skill guides - Modify code references in update checker and UI components - Adjust documentation links and cross-references accordingly - Revise command examples in protocol and asset files - Update versioning and setup instructions to reflect new command - Modify HTML UI rendering for skill installation guidance - Change internal command constants and execution calls --- AGENTS.md | 2 +- INSTALL.md | 4 ++-- README.md | 2 +- README.zh.md | 2 +- docs/agents/skill-change.md | 15 ++++++++------- packages/cli/README.md | 2 +- packages/cli/README.zh.md | 2 +- .../commands/src/commands/config/inventory.ts | 4 ++-- packages/commands/src/commands/config/ui-html.ts | 2 +- packages/commands/src/commands/update.ts | 2 +- packages/runtime/src/utils/update-checker.ts | 4 ++-- skills/bailian-cli/README.md | 4 ++-- skills/bailian-cli/README.zh.md | 4 ++-- skills/bailian-cli/SKILL.md | 12 ++++++------ skills/bailian-finetune/SKILL.md | 8 ++++---- skills/bailian-gen/SKILL.md | 8 ++++---- skills/bailian-managed-agent/SKILL.md | 8 ++++---- skills/bailian-protocol/README.md | 4 ++-- skills/bailian-protocol/README.zh.md | 4 ++-- skills/bailian-protocol/SKILL.md | 8 ++++---- skills/bailian-protocol/assets/issue-reporting.md | 2 +- skills/bailian-protocol/assets/setup.md | 2 +- skills/bailian-protocol/assets/versioning.md | 8 ++++---- tools/generate-reference.ts | 2 +- 24 files changed, 58 insertions(+), 57 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 222db1ca..dd006dc5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -35,7 +35,7 @@ packages/core/src/auth/ # apiKey / console credential 解析与落盘 packages/core/src/client/ # HTTP client / endpoints / console gateway ``` -Skill / 命令手册随 `skills/bailian-*/` 经 `bl skill add --name all` 安装(整包装齐,含共享协议 `bailian-protocol`)。业务 skill(`bailian-cli` / `bailian-gen` / `bailian-finetune` / `bailian-managed-agent`)执行前读 `skills/bailian-protocol/`;不要依赖 frontmatter `companions`(安装器不强制)。`tools/generate-reference.ts` 从 **`packages/cli/src/commands.ts`** 按一级命令归属表分流写入各 `skills//reference/`(纳入 git);`tools/sync-skill-metadata.ts` 从 `packages/cli/package.json` 同步各 `skills/*/SKILL.md` 的 `metadata.version`。两者由根脚本 `pnpm run sync:skill-assets` 和 `.vite-hooks/pre-commit` 执行。hub `bailian-cli` 的路由表不复述领域命令明细;SKILL 文案 / 安装约定 / hand-off 见 [docs/agents/skill-change.md](docs/agents/skill-change.md)。 +Skill / 命令手册随 `skills/bailian-*/` 经 `bl skill init` 安装(装齐 registry 中全部 `bailian-*`,含共享协议 `bailian-protocol`)。业务 skill(`bailian-cli` / `bailian-gen` / `bailian-finetune` / `bailian-managed-agent`)执行前读 `skills/bailian-protocol/`;不要依赖 frontmatter `companions`(安装器不强制)。`tools/generate-reference.ts` 从 **`packages/cli/src/commands.ts`** 按一级命令归属表分流写入各 `skills//reference/`(纳入 git);`tools/sync-skill-metadata.ts` 从 `packages/cli/package.json` 同步各 `skills/*/SKILL.md` 的 `metadata.version`。两者由根脚本 `pnpm run sync:skill-assets` 和 `.vite-hooks/pre-commit` 执行。hub `bailian-cli` 的路由表不复述领域命令明细;SKILL 文案 / 安装约定 / hand-off 见 [docs/agents/skill-change.md](docs/agents/skill-change.md)。 约定: diff --git a/INSTALL.md b/INSTALL.md index 148c2127..3982f3d8 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -54,10 +54,10 @@ npm install -g bailian-cli 安装 skills(CLI 内置,无需 Git / npx skills): ```bash -bl skill add --name all +bl skill init ``` -**Supported:** `--name all` 一次装齐整套 `bailian-*`(含共享协议 `bailian-protocol`)。 +**Supported:** `bl skill init` 一次装齐 registry 中全部 `bailian-*`(含共享协议 `bailian-protocol`)。 **Advanced / 按需子集:** diff --git a/README.md b/README.md index dc019efb..891699e3 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ Please read https://bailian.aliyun.com/cli/install.md and install the Aliyun Mod ```bash npm install -g bailian-cli -npx skills add modelstudioai/cli --all -g +bl skill init ``` > Requires Node.js >= 18.17. diff --git a/README.zh.md b/README.zh.md index aa00be96..2b852433 100644 --- a/README.zh.md +++ b/README.zh.md @@ -85,7 +85,7 @@ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_ ```bash npm install -g bailian-cli -npx skills add modelstudioai/cli --all -g +bl skill init ``` > 需要预先安装 Node.js >= 18.17。 diff --git a/docs/agents/skill-change.md b/docs/agents/skill-change.md index 38d75215..cddbaa32 100644 --- a/docs/agents/skill-change.md +++ b/docs/agents/skill-change.md @@ -11,16 +11,17 @@ ## 统一口径(安装) -1. **Supported install:** `bl skill add --name all`(整包装齐,含 `bailian-protocol`) +1. **Supported install:** `bl skill init`(装齐 registry 中全部 `bailian-*`,含 `bailian-protocol`) 2. **`bailian-protocol` 是共享协议 skill**,业务 skill 执行前应 Read 它 3. **不要**在 frontmatter 写 `companions`,也不要对外说「companions = 安装器硬依赖」 4. 子集安装:`bl skill add --name bailian-protocol,`;漏装 protocol 会导致相对路径 Read 失败 +5. **`bl skill add --all`:** 安装 registry 全量(含 `spark-video` 等非 bailian 技能);一键安装 / `bl update` 用 `skill init`,不要用 `--all` ## 概念图 ```text bailian-protocol ← 共享协议(consent / 鉴权 / 版本 / 错误上报) - ▲ 靠 `bl skill add --name all` 与业务 skill 同装;非安装器强制 companions + ▲ 靠 `bl skill init` 与业务 skill 同装;非安装器强制 companions │ ┌───────┴────────┬────────────────┬──────────────────┐ bailian-gen bailian-finetune bailian-managed-agent @@ -37,8 +38,8 @@ bailian-gen bailian-finetune bailian-managed-agent ### A. 分层边界 -- [ ] **整包装齐**:安装/升级文案主推 `bl skill add --name all`;业务 skill **不**声明 `companions` -- [ ] **协议读取**:CRITICAL / references 可链 `../bailian-protocol/…`;若读不到 → 停止执行 `bl`,提示 `bl skill add --name all` +- [ ] **整包装齐**:安装/升级文案主推 `bl skill init`;业务 skill **不**声明 `companions` +- [ ] **协议读取**:CRITICAL / references 可链 `../bailian-protocol/…`;若读不到 → 停止执行 `bl`,提示 `bl skill init` - [ ] **软 hand-off**:兄弟业务 skill **只写 skill 名**;已安装则 Read,未安装则 `bl … --help` 或提示整包安装;**不要**把 `../bailian-gen/…` 等写成执行前提 - [ ] **Hub vs 领域**:`bailian-cli` 的「When to use which command」只列 hub 拥有的意图;媒体 / 精调 / managed-agent 各留 hand-off 行,**不抄**领域默认模型与子命令明细 - [ ] **渐进披露**:SKILL 写意图路由与领域硬规则;flags / usage / examples 以 `reference/` 或 `bl --help` 为准,表后保留「勿猜 flag」指向句 @@ -46,9 +47,9 @@ bailian-gen bailian-finetune bailian-managed-agent ### B. 文案与落款一致性 - [ ] 领域 skill(gen / finetune / managed-agent)路由或命令表后有指向 `reference/` 的句;文末 `## references`(protocol + reference)与家族对齐 -- [ ] description 含 WHAT + WHEN + 反触发;安装说明指向 `bl skill add --name all`,不写 companions 必装 +- [ ] description 含 WHAT + WHEN + 反触发;安装说明指向 `bl skill init`,不写 companions 必装 - [ ] Quick examples 只演示本 skill 职责(hub 不示范 `bl image` / `bl video` 等) -- [ ] 若改了安装方式:同步 `README.md` / `README.zh.md` / `INSTALL.md` / `skills/*/README*` / `skills/bailian-protocol/assets/setup.md` 中的 `bl skill add …` 示例(改 `INSTALL.md` 时按 [install-doc-change.md](install-doc-change.md) 同步静态页) +- [ ] 若改了安装方式:同步 `README.md` / `README.zh.md` / `INSTALL.md` / `skills/*/README*` / `skills/bailian-protocol/assets/setup.md` 中的 `bl skill init` / `bl skill add …` 示例(改 `INSTALL.md` 时按 [install-doc-change.md](install-doc-change.md) 同步静态页) ### C. 归属与生成 @@ -61,7 +62,7 @@ bailian-gen bailian-finetune bailian-managed-agent ```sh pnpm run sync:skill-assets # 已发布版本试装 -bl skill add --name all +bl skill init ``` 抽查:打开 `skills/bailian-cli/SKILL.md` 确认无领域子命令明细表、无 `companions`;打开对应领域 skill 确认有「勿猜 flag」与 hand-off。 diff --git a/packages/cli/README.md b/packages/cli/README.md index dc019efb..891699e3 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -86,7 +86,7 @@ Please read https://bailian.aliyun.com/cli/install.md and install the Aliyun Mod ```bash npm install -g bailian-cli -npx skills add modelstudioai/cli --all -g +bl skill init ``` > Requires Node.js >= 18.17. diff --git a/packages/cli/README.zh.md b/packages/cli/README.zh.md index aa00be96..2b852433 100644 --- a/packages/cli/README.zh.md +++ b/packages/cli/README.zh.md @@ -85,7 +85,7 @@ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_ ```bash npm install -g bailian-cli -npx skills add modelstudioai/cli --all -g +bl skill init ``` > 需要预先安装 Node.js >= 18.17。 diff --git a/packages/commands/src/commands/config/inventory.ts b/packages/commands/src/commands/config/inventory.ts index bd45fa23..b5a17757 100644 --- a/packages/commands/src/commands/config/inventory.ts +++ b/packages/commands/src/commands/config/inventory.ts @@ -128,8 +128,8 @@ function countFiles(dir: string, budget = 500): number { } /** - * Skill directories to scan, keyed by the module that owns them. `bl skill - * add --name all` fans skills out into each installed agent, so the same skill can + * Skill directories to scan, keyed by the module that owns them. `bl skill init` / + * `bl skill add` fans skills out into each installed agent, so the same skill can * live in several of these roots at once. */ function skillRoots(home: string): Array<{ source: string; dir: string }> { diff --git a/packages/commands/src/commands/config/ui-html.ts b/packages/commands/src/commands/config/ui-html.ts index 4f31ab53..0c7ebbaf 100644 --- a/packages/commands/src/commands/config/ui-html.ts +++ b/packages/commands/src/commands/config/ui-html.ts @@ -1444,7 +1444,7 @@ export const PAGE_HTML = ` function renderSkills() { var body = document.getElementById('skillsBody'); var pager = document.getElementById('skillsPager'); - if (!SKILLS.length) { pager.innerHTML = ''; renderEmpty(body, 'No skills installed.', 'Install with bl skill add --name all'); return; } + if (!SKILLS.length) { pager.innerHTML = ''; renderEmpty(body, 'No skills installed.', 'Install with bl skill init'); return; } var list = SKILLS.filter(function (s) { return skillMatches(s, SKILL_Q); }); if (!list.length) { pager.innerHTML = ''; renderEmpty(body, 'No skills match "' + SKILL_Q + '".', ''); return; } var info = pageSlice(list, SKILL_PAGE, getPageSize('skills')); SKILL_PAGE = info.page; diff --git a/packages/commands/src/commands/update.ts b/packages/commands/src/commands/update.ts index e9692d90..ee6e3e56 100644 --- a/packages/commands/src/commands/update.ts +++ b/packages/commands/src/commands/update.ts @@ -20,7 +20,7 @@ import { type AnsiStyles, } from "bailian-cli-runtime"; -const SKILL_INSTALL_CMD = "bl skill add --name all"; +const SKILL_INSTALL_CMD = "bl skill init"; function updateAgentSkill(color: AnsiStyles): void { process.stderr.write("\nUpdating agent skill...\n"); diff --git a/packages/runtime/src/utils/update-checker.ts b/packages/runtime/src/utils/update-checker.ts index 1ae51104..1a79a0ab 100644 --- a/packages/runtime/src/utils/update-checker.ts +++ b/packages/runtime/src/utils/update-checker.ts @@ -299,11 +299,11 @@ export async function performAutoUpdate( try { process.stderr.write(` ${dim}Syncing agent skill...${reset}\n`); - execSync(`bl skill add --name all`, { stdio: "inherit" }); + execSync(`bl skill init`, { stdio: "inherit" }); process.stderr.write(` ${green}✓ Agent skill updated.${reset}\n\n`); } catch (err) { process.stderr.write(` ${yellow}⚠ Agent skill sync failed: ${errorMessage(err)}${reset}\n`); - process.stderr.write(` ${yellow} Run manually: bl skill add --name all${reset}\n\n`); + process.stderr.write(` ${yellow} Run manually: bl skill init${reset}\n\n`); } pendingNotification = null; diff --git a/skills/bailian-cli/README.md b/skills/bailian-cli/README.md index df45eaf6..3888131e 100644 --- a/skills/bailian-cli/README.md +++ b/skills/bailian-cli/README.md @@ -4,11 +4,11 @@ Agent skill for **Alibaba Cloud Model Studio CLI** (`bl`) resource hub — apps, memory, RAG, usage/quota, MCP, and hub `reference/`. -- Shared protocol: `bailian-protocol` (install via `bl skill add --name all`) +- Shared protocol: `bailian-protocol` (install via `bl skill init`) - Soft hand-offs (optional skills): `bailian-gen` · `bailian-finetune` · `bailian-managed-agent` ```bash -bl skill add --name all +bl skill init ``` For CLI installation, authentication, and examples, see the [main README](../../README.md). diff --git a/skills/bailian-cli/README.zh.md b/skills/bailian-cli/README.zh.md index 13c09ffb..cd0d015f 100644 --- a/skills/bailian-cli/README.zh.md +++ b/skills/bailian-cli/README.zh.md @@ -4,11 +4,11 @@ **阿里云百炼 CLI**(`bl`)的资源管理 Agent 技能 — 应用、记忆、RAG、用量/额度、MCP,以及 hub `reference/`。 -- 共享协议:`bailian-protocol`(通过 `bl skill add --name all` 与整家族同装) +- 共享协议:`bailian-protocol`(通过 `bl skill init` 与整家族同装) - 软 hand-off(可选):`bailian-gen` · `bailian-finetune` · `bailian-managed-agent` ```bash -bl skill add --name all +bl skill init ``` CLI 的安装、认证和使用示例请查看[主 README](../../README.zh.md)。 diff --git a/skills/bailian-cli/SKILL.md b/skills/bailian-cli/SKILL.md index 2158b162..bcf6d2f6 100644 --- a/skills/bailian-cli/SKILL.md +++ b/skills/bailian-cli/SKILL.md @@ -10,7 +10,7 @@ description: >- 工作空间、MCP 市场、pipeline、文件上传、console API、登录鉴权与配置、 Agent skill 安装/列表/更新/卸载(bl skill add|list|update|remove,百炼 skill registry)。 用户点名百炼 / DashScope / `bl`,或继续既有 `bl` 工作流时直接使用。 - 共享协议(consent / 版本预检 / 鉴权 / 错误上报)在 bailian-protocol;官方安装 `bl skill add --name all`。 + 共享协议(consent / 版本预检 / 鉴权 / 错误上报)在 bailian-protocol;官方安装 `bl skill init`。 家族路由:生图/生视频/配音/语音合成/转写 → bailian-gen;精调/微调/训练/数据集 → bailian-finetune; agents.yaml 托管 Agent → bailian-managed-agent。 不要用于普通问答、编程、写作、翻译、摘要、泛搜索,或图片理解等宿主自己能做的任务(普通问答、编程、写作、翻译、摘要、泛搜索不触发)。 @@ -19,14 +19,14 @@ description: >- # Aliyun Model Studio CLI (`bl`) -**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Provider selection and consent, Version & updates (pre-flight checklist), Setup & auth, and CLI errors: report an issue. If that protocol file is missing, stop and run `bl skill add --name all`; do not guess auth/consent.** +**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Provider selection and consent, Version & updates (pre-flight checklist), Setup & auth, and CLI errors: report an issue. If that protocol file is missing, stop and run `bl skill init`; do not guess auth/consent.** > **Family hub** — This skill owns Bailian resource commands and the hub `reference/` (apps, knowledge, usage, auth, config, …). -> Shared protocol → [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md) (install the full family with `bl skill add --name all`). -> Soft hand-offs by skill name (Read if installed; else `bl … --help` / prompt `bl skill add --name all`): `bailian-gen` (media) · `bailian-finetune` (training) · `bailian-managed-agent` (agents.yaml IaC). +> Shared protocol → [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md) (install the full family with `bl skill init`). +> Soft hand-offs by skill name (Read if installed; else `bl … --help` / prompt `bl skill init`): `bailian-gen` (media) · `bailian-finetune` (training) · `bailian-managed-agent` (agents.yaml IaC). > Do not invoke it for ordinary reasoning, coding, writing, translation, summarization, generic research, or image understanding the host agent can complete directly. > -> **Install (supported):** `bl skill add --name all` +> **Install (supported):** `bl skill init` ## Command reference (authoritative) @@ -113,7 +113,7 @@ schema-export commands. ## Routing reminders -- Image/video/audio generation or editing → skill `bailian-gen` (class 3 consent from `bailian-protocol`). Fine-tuning / datasets / deployments → `bailian-finetune`. agents.yaml IaC → `bailian-managed-agent`. Soft hand-off: Read sibling skill if installed; else `bl … --help` or prompt `bl skill add --name all`. Image understanding the host agent can do → host-first; use `bl vision` / `bl omni` only when the user names a Bailian model or the media (video/audio files) exceeds host capability. +- Image/video/audio generation or editing → skill `bailian-gen` (class 3 consent from `bailian-protocol`). Fine-tuning / datasets / deployments → `bailian-finetune`. agents.yaml IaC → `bailian-managed-agent`. Soft hand-off: Read sibling skill if installed; else `bl … --help` or prompt `bl skill init`. Image understanding the host agent can do → host-first; use `bl vision` / `bl omni` only when the user names a Bailian model or the media (video/audio files) exceeds host capability. - Answer ordinary reasoning, coding, writing, translation, summarization, and generic research with the host agent's native capabilities; do not bounce them through `bl text chat` or `bl search web`. - Usage / quota / credits questions that do not name a product → ask which product (Bailian or another AI service) first; run `bl usage` / `bl quota` only after the user picks Bailian or Bailian context is already established. - "Remember this" and memory requests default to the host agent's own memory; `bl memory *` is only for Bailian app memory resources. diff --git a/skills/bailian-finetune/SKILL.md b/skills/bailian-finetune/SKILL.md index f2efd1b3..c3f10eff 100644 --- a/skills/bailian-finetune/SKILL.md +++ b/skills/bailian-finetune/SKILL.md @@ -11,12 +11,12 @@ description: >- upload 拿 file-id → finetune create 建任务 → watch 看进度 → export 导出 → deploy 上线,需要 API key; 写操作先用 `--dry-run` 预览。反触发:用户点名火山方舟/ark 的精调不走本 skill;只是要选哪个模型走 bailian-model-recommend;用现成模型生图生视频走 bailian-gen;百炼其他资源管理走 bailian-cli。 - 官方安装:`bl skill add --name all`(与共享协议 bailian-protocol 同装)。 + 官方安装:`bl skill init`(与共享协议 bailian-protocol 同装)。 --- # Bailian fine-tuning pipeline (`bl dataset` / `bl finetune` / `bl deploy`) -**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Version & updates (pre-flight checklist), Setup & auth, and CLI errors: report an issue. Command details are authoritative in [`reference/`](reference/index.md) (dataset / finetune / deploy) and `bl --help` — do not guess flags. The whole pipeline requires an API key. If that protocol file is missing, stop and run `bl skill add --name all`; do not guess auth/consent.** +**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Version & updates (pre-flight checklist), Setup & auth, and CLI errors: report an issue. Command details are authoritative in [`reference/`](reference/index.md) (dataset / finetune / deploy) and `bl --help` — do not guess flags. The whole pipeline requires an API key. If that protocol file is missing, stop and run `bl skill init`; do not guess auth/consent.** ## End-to-end workflow (follow in order) @@ -63,7 +63,7 @@ bl deploy text create --model my-qwen-sft --name my-svc ## Common hand-offs -软 hand-off(按 skill **名**;已安装则 Read,否则 `--help` / 提示 `bl skill add --name all`): +软 hand-off(按 skill **名**;已安装则 Read,否则 `--help` / 提示 `bl skill init`): - After deployment, try the model or generate content → skill `bailian-gen` (media) or `bl text chat` (fallback: `bl image\|video\|text --help`). - Unsure which base model to pick → `bailian-model-recommend` / `bl advisor recommend`. @@ -71,5 +71,5 @@ bl deploy text create --model my-qwen-sft --name my-svc ## references -- [bailian-protocol](../bailian-protocol/SKILL.md) — shared protocol (install via `bl skill add --name all`) +- [bailian-protocol](../bailian-protocol/SKILL.md) — shared protocol (install via `bl skill init`) - [reference/](reference/index.md) — command details diff --git a/skills/bailian-gen/SKILL.md b/skills/bailian-gen/SKILL.md index 12d9bcfb..f9b9da08 100644 --- a/skills/bailian-gen/SKILL.md +++ b/skills/bailian-gen/SKILL.md @@ -13,12 +13,12 @@ description: >- 图片和语音同步返回并落地本地文件,视频是异步任务、用 `--download` 或轮询取回;本地文件直接传路径,CLI 自动上传。 反触发:宿主自己能做的图片理解、普通问答、编程、写作、翻译不走本技能;百炼应用/知识库/用量/额度走 bailian-cli; 精调训练走 bailian-finetune。 - 官方安装:`bl skill add --name all`(与共享协议 bailian-protocol 同装)。 + 官方安装:`bl skill init`(与共享协议 bailian-protocol 同装)。 --- # Bailian media generation (`bl image` / `bl video` / `bl speech` / `bl omni`) -**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Provider selection and consent (one-time ask templates), Version & updates (pre-flight checklist), and CLI errors: report an issue. Command details are authoritative in [`reference/`](reference/index.md) and `bl --help` — do not guess flags. If that protocol file is missing, stop and run `bl skill add --name all`; do not guess auth/consent.** +**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Provider selection and consent (one-time ask templates), Version & updates (pre-flight checklist), and CLI errors: report an issue. Command details are authoritative in [`reference/`](reference/index.md) and `bl --help` — do not guess flags. If that protocol file is missing, stop and run `bl skill init`; do not guess auth/consent.** ## Consent (short version; full rules in bailian-protocol) @@ -76,7 +76,7 @@ If one or more `bl` commands actually ran, proactively add a one-line summary in ## Common hand-offs -软 hand-off(按 skill **名**;已安装则 Read,否则 `--help` / 提示 `bl skill add --name all`): +软 hand-off(按 skill **名**;已安装则 Read,否则 `--help` / 提示 `bl skill init`): - Generation failed and it is not a usage/auth/content-filter issue → follow the issue-reporting flow in `bailian-protocol` ([`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md#cli-errors-report-an-issue)) and ask once whether to report. - Managing Bailian apps / knowledge bases / usage → skill `bailian-cli` (fallback: `bl app\|knowledge\|usage --help`). @@ -84,5 +84,5 @@ If one or more `bl` commands actually ran, proactively add a one-line summary in ## references -- [bailian-protocol](../bailian-protocol/SKILL.md) — shared protocol (install via `bl skill add --name all`) +- [bailian-protocol](../bailian-protocol/SKILL.md) — shared protocol (install via `bl skill init`) - [reference/](reference/index.md) — command details diff --git a/skills/bailian-managed-agent/SKILL.md b/skills/bailian-managed-agent/SKILL.md index 31f82b09..929dfee8 100644 --- a/skills/bailian-managed-agent/SKILL.md +++ b/skills/bailian-managed-agent/SKILL.md @@ -11,12 +11,12 @@ description: >- apply / destroy 变更远端资源且必须带 `--yes`,务必先 plan 给用户看 diff 再让其确认。 反触发:调用已上线的百炼应用/智能体走 bailian-app-call 或 `bl app`;宿主 agent 自身的记忆、技能、 子代理不走本 skill;生图生视频走 bailian-gen。 - 官方安装:`bl skill add --name all`(与共享协议 bailian-protocol 同装)。 + 官方安装:`bl skill init`(与共享协议 bailian-protocol 同装)。 --- # Bailian managed agent IaC (`bl managed-agent`) -**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Version & updates (pre-flight checklist) and CLI errors: report an issue. Command details are authoritative in [`reference/managed-agent.md`](reference/managed-agent.md) and `bl managed-agent --help` — do not guess flags. If that protocol file is missing, stop and run `bl skill add --name all`; do not guess auth/consent.** +**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Version & updates (pre-flight checklist) and CLI errors: report an issue. Command details are authoritative in [`reference/managed-agent.md`](reference/managed-agent.md) and `bl managed-agent --help` — do not guess flags. If that protocol file is missing, stop and run `bl skill init`; do not guess auth/consent.** ## Safety guardrail (the most important rule) @@ -60,7 +60,7 @@ Flags, usage, and examples: see [`reference/`](reference/index.md) or `bl - 阿里云百炼 `bl` 家族共享执行协议(consent 确认、版本预检、鉴权/安装、错误上报、本地文件与输出约定)。 不是面向用户意图的业务入口;当任一 bailian-* 业务 skill(bailian-cli / bailian-gen / bailian-finetune / bailian-managed-agent)执行前需要公共上下文,或用户首次安装/鉴权/`bl` 报错需上报时读取本 skill。 - 官方安装为整包:`bl skill add --name all`(与业务 skill 同装)。 + 官方安装为整包:`bl skill init`(与业务 skill 同装)。 --- # Bailian shared protocol (`bailian-protocol`) @@ -18,7 +18,7 @@ description: >- > **Install(supported):** 整包装齐,含本 skill 与全部业务 skill: > > ```bash -> bl skill add --name all +> bl skill init > ``` > > 子集安装请显式带上 `bailian-protocol`(例如 `bl skill add --name bailian-protocol,bailian-gen`),否则业务 skill 的相对路径 Read 会失败。 @@ -44,7 +44,7 @@ After approval, treat Bailian as selected for the current task. Do not ask again ## Family routing & hand-offs 业务路由(**软 hand-off**:按 skill **名**路由;已安装则 Read 其 `SKILL.md`,未安装则用 `bl --help`,或提示整包安装 -`bl skill add --name all`): +`bl skill init`): | Intent | Skill | Fallback | | ------------------------------------- | ----------------------- | ----------------------------------------------- | @@ -55,7 +55,7 @@ After approval, treat Bailian as selected for the current task. Do not ask again **共享协议** vs **软 hand-off**: -- `bailian-protocol`:靠 `bl skill add --name all` 与业务 skill 同装;CRITICAL 可用相对路径 `../bailian-protocol/…`。读不到则停止跑 `bl`,提示整包安装。 +- `bailian-protocol`:靠 `bl skill init` 与业务 skill 同装;CRITICAL 可用相对路径 `../bailian-protocol/…`。读不到则停止跑 `bl`,提示整包安装。 - 其它 bailian-\* 业务 skill:只按名字提及,**不要**写死 `../bailian-*/SKILL.md` 当执行前提。 ## Version & updates (after provider selection, before the first `bl` command) diff --git a/skills/bailian-protocol/assets/issue-reporting.md b/skills/bailian-protocol/assets/issue-reporting.md index c75e2719..b1df4d53 100644 --- a/skills/bailian-protocol/assets/issue-reporting.md +++ b/skills/bailian-protocol/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-after-provider-selection-before-the-first-bl-command) — run `bl update` and `bl skill add --name all` if mismatched. +1. Align versions: [SKILL.md → Version & updates](../SKILL.md#version--updates-after-provider-selection-before-the-first-bl-command) — run `bl update` and `bl skill init` 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-protocol/assets/setup.md b/skills/bailian-protocol/assets/setup.md index 2bae59dd..3c0d8407 100644 --- a/skills/bailian-protocol/assets/setup.md +++ b/skills/bailian-protocol/assets/setup.md @@ -15,7 +15,7 @@ inspect config keys. Day-to-day command routing lives in the business skills # Recommended binary install (no Node), or: npm install -g bailian-cli curl -fsSL https://bailian.aliyun.com/cli/install.sh | bash # Install the full bailian-* skill family (includes bailian-protocol) -bl skill add --name all +bl skill init # Advanced / subset (comma-separated names; include bailian-protocol when needed) # bl skill add --name bailian-protocol,bailian-gen diff --git a/skills/bailian-protocol/assets/versioning.md b/skills/bailian-protocol/assets/versioning.md index 804349dc..fea70175 100644 --- a/skills/bailian-protocol/assets/versioning.md +++ b/skills/bailian-protocol/assets/versioning.md @@ -16,7 +16,7 @@ 3. Compare the two versions (ignore the `bl` prefix; compare only `X.Y.Z`): - If `metadata.version` ≠ `bl --version`, refresh skills before doing anything else: ```bash - bl skill add --name all + bl skill init ``` - Do not trust a stale `reference/` when versions mismatch — flags may be wrong. 4. Check the latest published CLI version: @@ -26,7 +26,7 @@ 5. If the installed `bl` is **older** than the latest npm version, **STOP** the current task and **ask the user** (report skill version, installed CLI version, and npm latest): > A newer version of bl is available (current: X.Y.Z, latest: A.B.C). Upgrade before continuing? - **Do NOT auto-upgrade silently** — the user decides. - - If the user agrees: run `bl update`, then continue. (`bl update` upgrades `bailian-cli` via npm and, on success, also runs `bl skill add --name all` to keep skills in lockstep across all agent apps.) + - If the user agrees: run `bl update`, then continue. (`bl update` upgrades `bailian-cli` via npm and, on success, also runs `bl skill init` to keep skills in lockstep across all agent apps.) - If the user declines: continue with the current version and note it in the summary. - If `npm view` / `bl update` fails (offline, registry blocked, permission): continue with the current `bl` and tell the user it could not be updated. 6. Only proceed with the user's actual task after the above is resolved. @@ -41,10 +41,10 @@ If `bl --version` fails, install the CLI and skills: # Recommended — no Node required curl -fsSL https://bailian.aliyun.com/cli/install.sh | bash # Or: npm install -g bailian-cli -bl skill add --name all +bl skill init ``` -Do not install a single business skill alone — use `--name all` so `bailian-protocol` is present. +Do not install a single business skill alone — use `bl skill init` so `bailian-protocol` is present. ## Mention it in the task summary diff --git a/tools/generate-reference.ts b/tools/generate-reference.ts index fee3ef12..089a63bb 100644 --- a/tools/generate-reference.ts +++ b/tools/generate-reference.ts @@ -7,7 +7,7 @@ * Ownership of each top-level command group is declared in `GROUP_OWNER_SKILL` below. * Unmapped groups fall back to `bailian-cli` (hub) so new commands never block generation. * - * Committed to git; consumed by bailian-* Agent Skills (`bl skill add --name all`). + * Committed to git; consumed by bailian-* Agent Skills (`bl skill init`). * * Run: pnpm --filter bailian-cli run generate:reference * Also run via `pnpm run sync:skill-assets` or the repo pre-commit hook.