mirror of
https://github.com/modelstudioai/cli.git
synced 2026-09-14 19:49:23 +08:00
refactor(skills): introduce bailian-protocol companion and slim bailian-cli routing
This commit is contained in:
@@ -6,7 +6,7 @@ pnpm run sync:skill-assets
|
||||
|
||||
# Stage generator output so it is included in this commit.
|
||||
git add \
|
||||
skills/bailian-base/SKILL.md \
|
||||
skills/bailian-protocol/SKILL.md \
|
||||
skills/bailian-cli/SKILL.md \
|
||||
skills/bailian-cli/reference \
|
||||
skills/bailian-gen/SKILL.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` 安装。共享协议在 `skills/bailian-base/`;业务 skill(`bailian-cli` / `bailian-gen` / `bailian-finetune` / `bailian-managed-agent`)依赖它作为 companion。`tools/generate-reference.ts` 从 **`packages/cli/src/commands.ts`** 按一级命令归属表分流写入各 `skills/<skill>/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` 执行。
|
||||
Skill / 命令手册随 `skills/bailian-*/` 经 `npx skills add modelstudioai/cli` 安装。共享协议在 `skills/bailian-protocol/`;业务 skill(`bailian-cli` / `bailian-gen` / `bailian-finetune` / `bailian-managed-agent`)依赖它作为 companion。`tools/generate-reference.ts` 从 **`packages/cli/src/commands.ts`** 按一级命令归属表分流写入各 `skills/<skill>/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 文案 / companion / hand-off 约定见 [docs/agents/skill-change.md](docs/agents/skill-change.md)。
|
||||
|
||||
约定:
|
||||
|
||||
@@ -49,30 +49,31 @@ Skill / 命令手册随 `skills/bailian-*/` 经 `npx skills add modelstudioai/cl
|
||||
|
||||
- `tools/release/` — 发版自动化(CI 驱动,见 `.github/workflows/publish.yml`)
|
||||
- `tools/generate-reference.ts` — 从 `packages/cli/src/commands.ts` 按归属表生成各 `skills/<skill>/reference/`
|
||||
- `tools/sync-skill-metadata.ts` — 同步各 `skills/*/SKILL.md` 的 `metadata.version`(含 `bailian-base`)
|
||||
- `tools/sync-skill-metadata.ts` — 同步各 `skills/*/SKILL.md` 的 `metadata.version`(含 `bailian-protocol`)
|
||||
- `README.md` / `README.zh.md` — npm 和 GitHub 主页
|
||||
|
||||
## 业务场景索引
|
||||
|
||||
按当前任务从下表挑一条进入对应文档:
|
||||
|
||||
| 场景 | 何时进入 | 详见 |
|
||||
| -------------- | -------------------------------------------- | ---------------------------------------------------------------------------- |
|
||||
| 命令增删改 | 增加 / 删除 / 重命名 `bl xxx` 或入口命令路径 | [docs/agents/command-add-remove.md](docs/agents/command-add-remove.md) |
|
||||
| E2E 测试维护 | 新增/改命令或 e2e 用例、补 help/缺参/dry-run | [docs/agents/cli-e2e-tests.md](docs/agents/cli-e2e-tests.md) |
|
||||
| 批量压测 | 改/跑多能力并发压测、`test:stress`、fixtures | [docs/agents/stress-batch-tests.md](docs/agents/stress-batch-tests.md) |
|
||||
| 选项变更 | 给已有命令加 `--flag` 或改默认值 | [docs/agents/command-flag-change.md](docs/agents/command-flag-change.md) |
|
||||
| 模型上下架 | 增加新模型 / 改默认模型 / 废弃旧模型 | [docs/agents/model-add-remove.md](docs/agents/model-add-remove.md) |
|
||||
| 错误文案变更 | 改 `BailianError` 的 message 或 hint | [docs/agents/error-hint-change.md](docs/agents/error-hint-change.md) |
|
||||
| URL / 渠道变更 | 控制台域名 / 文档站 / 追踪参数 | [docs/agents/url-change.md](docs/agents/url-change.md) |
|
||||
| 鉴权扩展 | 加 OAuth / SSO / 换 token 来源 | [docs/agents/auth-change.md](docs/agents/auth-change.md) |
|
||||
| 配置项扩展 | 新 env var 或 `~/.bailian/config.json` 字段 | [docs/agents/config-add.md](docs/agents/config-add.md) |
|
||||
| Profile / 激活 | 改命名 Profile、预设或 `active_config` | [docs/agents/config-profile-change.md](docs/agents/config-profile-change.md) |
|
||||
| 安装文档 | 改安装、鉴权、验证流程或线上 install 页面 | [docs/agents/install-doc-change.md](docs/agents/install-doc-change.md) |
|
||||
| 发布 | channel / stable 发布到 npm(CI 驱动) | [docs/agents/publish.md](docs/agents/publish.md) |
|
||||
| Change Log | 发版说明 / 历史版本说明 | [docs/agents/changelog-write.md](docs/agents/changelog-write.md) |
|
||||
| 工具链调整 | lint 规则 / 构建配置 / 依赖升级 | [docs/agents/lint-toolchain.md](docs/agents/lint-toolchain.md) |
|
||||
| Command Pack | 扩展包 / 白名单 / plugin 管理命令 | [docs/agents/command-pack.md](docs/agents/command-pack.md) |
|
||||
| 场景 | 何时进入 | 详见 |
|
||||
| ----------------- | ------------------------------------------------ | ---------------------------------------------------------------------------- |
|
||||
| 命令增删改 | 增加 / 删除 / 重命名 `bl xxx` 或入口命令路径 | [docs/agents/command-add-remove.md](docs/agents/command-add-remove.md) |
|
||||
| E2E 测试维护 | 新增/改命令或 e2e 用例、补 help/缺参/dry-run | [docs/agents/cli-e2e-tests.md](docs/agents/cli-e2e-tests.md) |
|
||||
| 批量压测 | 改/跑多能力并发压测、`test:stress`、fixtures | [docs/agents/stress-batch-tests.md](docs/agents/stress-batch-tests.md) |
|
||||
| 选项变更 | 给已有命令加 `--flag` 或改默认值 | [docs/agents/command-flag-change.md](docs/agents/command-flag-change.md) |
|
||||
| 模型上下架 | 增加新模型 / 改默认模型 / 废弃旧模型 | [docs/agents/model-add-remove.md](docs/agents/model-add-remove.md) |
|
||||
| Skill 文案 / 路由 | 改 SKILL 路由、companion、hand-off、hub/领域边界 | [docs/agents/skill-change.md](docs/agents/skill-change.md) |
|
||||
| 错误文案变更 | 改 `BailianError` 的 message 或 hint | [docs/agents/error-hint-change.md](docs/agents/error-hint-change.md) |
|
||||
| URL / 渠道变更 | 控制台域名 / 文档站 / 追踪参数 | [docs/agents/url-change.md](docs/agents/url-change.md) |
|
||||
| 鉴权扩展 | 加 OAuth / SSO / 换 token 来源 | [docs/agents/auth-change.md](docs/agents/auth-change.md) |
|
||||
| 配置项扩展 | 新 env var 或 `~/.bailian/config.json` 字段 | [docs/agents/config-add.md](docs/agents/config-add.md) |
|
||||
| Profile / 激活 | 改命名 Profile、预设或 `active_config` | [docs/agents/config-profile-change.md](docs/agents/config-profile-change.md) |
|
||||
| 安装文档 | 改安装、鉴权、验证流程或线上 install 页面 | [docs/agents/install-doc-change.md](docs/agents/install-doc-change.md) |
|
||||
| 发布 | channel / stable 发布到 npm(CI 驱动) | [docs/agents/publish.md](docs/agents/publish.md) |
|
||||
| Change Log | 发版说明 / 历史版本说明 | [docs/agents/changelog-write.md](docs/agents/changelog-write.md) |
|
||||
| 工具链调整 | lint 规则 / 构建配置 / 依赖升级 | [docs/agents/lint-toolchain.md](docs/agents/lint-toolchain.md) |
|
||||
| Command Pack | 扩展包 / 白名单 / plugin 管理命令 | [docs/agents/command-pack.md](docs/agents/command-pack.md) |
|
||||
|
||||
如果当前任务无法对应任何场景,先按经验完成,然后**回来评估这是不是一类新场景** —— 是就新增 `docs/agents/<scenario>.md`,把清单沉淀下来。
|
||||
|
||||
|
||||
+2
-2
@@ -53,10 +53,10 @@ CLI 校验通过后,在本机终端执行:
|
||||
npx skills add modelstudioai/cli --all -g
|
||||
```
|
||||
|
||||
推荐 `--all`(含 companion `bailian-base`)。若只装单个业务 skill,必须同时带上 `bailian-base`,例如:
|
||||
推荐 `--all`(含 companion `bailian-protocol`)。若只装单个业务 skill,必须同时带上 `bailian-protocol`,例如:
|
||||
|
||||
```bash
|
||||
npx skills add modelstudioai/cli -g -s bailian-base -s bailian-gen
|
||||
npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-gen
|
||||
```
|
||||
|
||||
安装成功后,用中文简要说明已安装的 skills 及用户可做什么。
|
||||
|
||||
@@ -78,15 +78,15 @@ No timeline scrubbing. No frame-by-frame editing. Just one sentence → one vide
|
||||
|
||||
```bash
|
||||
npm install -g bailian-cli
|
||||
# Recommended: full bailian-* skill family (includes companion bailian-base)
|
||||
# Recommended: full bailian-* skill family (includes companion bailian-protocol)
|
||||
npx skills add modelstudioai/cli --all -g
|
||||
```
|
||||
|
||||
Subset install — always include companion `bailian-base` with any business skill:
|
||||
Subset install — always include companion `bailian-protocol` with any business skill:
|
||||
|
||||
```bash
|
||||
npx skills add modelstudioai/cli -g -s bailian-base -s bailian-gen
|
||||
npx skills add modelstudioai/cli -g -s bailian-base -s bailian-cli
|
||||
npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-gen
|
||||
npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-cli
|
||||
```
|
||||
|
||||
> Requires Node.js >= 18.17.
|
||||
|
||||
+4
-4
@@ -76,15 +76,15 @@ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_
|
||||
|
||||
```bash
|
||||
npm install -g bailian-cli
|
||||
# 推荐:安装完整 bailian-* skill 家族(含 companion bailian-base)
|
||||
# 推荐:安装完整 bailian-* skill 家族(含 companion bailian-protocol)
|
||||
npx skills add modelstudioai/cli --all -g
|
||||
```
|
||||
|
||||
子集安装时,业务 skill 必须同时带上 companion `bailian-base`:
|
||||
子集安装时,业务 skill 必须同时带上 companion `bailian-protocol`:
|
||||
|
||||
```bash
|
||||
npx skills add modelstudioai/cli -g -s bailian-base -s bailian-gen
|
||||
npx skills add modelstudioai/cli -g -s bailian-base -s bailian-cli
|
||||
npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-gen
|
||||
npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-cli
|
||||
```
|
||||
|
||||
> 需要预先安装 Node.js >= 18.17。
|
||||
|
||||
@@ -90,6 +90,7 @@ packages/commands/src/index.ts
|
||||
- [ ] 运行 `pnpm run sync:skill-assets`(或正常 `git commit` 走 pre-commit),刷新各 `skills/<skill>/reference/` 与 `SKILL.md` 的 `metadata.version` 并提交
|
||||
- [ ] `README.md` / `README.zh.md`:Quick Start、命令一览、认证说明(用户向,与 help 对齐)
|
||||
- [ ] 相关 `skills/<skill>/SKILL.md`:若安装说明或能力边界有变,同步更新;新一级命令组若属领域 skill,同步改 `tools/generate-reference.ts` 的 `GROUP_OWNER_SKILL`
|
||||
- [ ] **拥有方** skill 的「When to use which command」(或等价路由表)补上新意图;hub `bailian-cli` 仅加/改 hand-off 行,**不要**把领域子命令与默认模型抄进 hub 表(约定见 [skill-change.md](skill-change.md))
|
||||
|
||||
### D. 测试层
|
||||
|
||||
@@ -129,6 +130,7 @@ pnpm -F knowledge-studio-cli exec tsx src/main.ts <command> --help
|
||||
- ✗ 只导出了命令实现,忘了在 `packages/cli/src/commands.ts` 暴露路径 → `bl --help` 看不到
|
||||
- ✗ 手改 `skills/*/reference/*.md` → 下次 generate 被覆盖;应改 command metadata 后重新 generate 并提交
|
||||
- ✗ 新一级命令组忘改 `tools/generate-reference.ts` 的 `GROUP_OWNER_SKILL` → reference 会落到 hub `bailian-cli`(未必是预期)
|
||||
- ✗ 只改 reference / hub,忘改拥有方 skill 路由表;或把领域命令明细重新抄回 `bailian-cli` SKILL → 与 [skill-change.md](skill-change.md) 分层冲突
|
||||
- ✗ 在 `usageArgs` / `exampleArgs` 写死 `bl text chat` → `kscli` 等入口复用时 help 错
|
||||
- ✗ Console Gateway 命令忘设 `auth: "console"` → console flags / credential 注入都不生效
|
||||
- ✗ 单 action 的子组是反模式,新增时优先拍平为两级
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
### C. 命令手册
|
||||
|
||||
- [ ] 若 `--model` 的 description 含 default,改命令后跑 `pnpm --filter bailian-cli run generate:reference` 更新对应 `skills/<skill>/reference/<group>.md` 并提交
|
||||
- [ ] 同步**拥有该命令的领域 skill**「When to use which command」表中的 Default model(现主要是 `bailian-gen`;精调相关看 `bailian-finetune` 正文示例)。hub `bailian-cli` 已瘦身,一般**不必**再写领域默认模型(见 [skill-change.md](skill-change.md))
|
||||
|
||||
### D. 用户面文档
|
||||
|
||||
@@ -49,6 +50,7 @@ pnpm -F bailian-cli exec tsx src/main.ts <command> --model <new-model> --message
|
||||
|
||||
## 常见漏点
|
||||
|
||||
- ✗ 改了命令默认模型,但 SKILL.md frontmatter 仍写老型号 → AI agent 调用时仍按老型号宣传
|
||||
- ✗ 改了命令默认模型,但 SKILL.md frontmatter 或领域路由表 Default model 仍写老型号 → AI agent 调用时仍按老型号宣传
|
||||
- ✗ 只改了 `reference/` / flag description,忘改 `bailian-gen`(等) SKILL 路由表
|
||||
- ✗ 废弃模型时只删了代码,e2e 测试还在跑,CI 红
|
||||
- ✗ 新模型 endpoint 不一致,但只改了 default,没加 endpoint 分支判断
|
||||
|
||||
+11
-11
@@ -37,17 +37,17 @@
|
||||
|
||||
两种模式都会先跑 `check.mjs`,覆盖以下检查:
|
||||
|
||||
| 检查项 | 说明 |
|
||||
| -------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
||||
| `pnpm install --frozen-lockfile` | lockfile 一致性 |
|
||||
| README 同步 | `packages/cli/README.md` 与根 README 一致 |
|
||||
| 版本号一致 | `tools/release/lib/packages.mjs` 中待发布包集合 version 相同 |
|
||||
| `workspace:*` 替换 | 发布包间 workspace 依赖解析为真实版本号 |
|
||||
| 构建 | 基础发布构建 core/runtime/commands 依赖和 cli;`--knowledge` 额外构建 `knowledge-studio-cli` |
|
||||
| 生成资产 | 重建各 `skills/<skill>/reference/`;非 channel 模式还同步各 `skills/*/SKILL.md` version(含 `bailian-base`) |
|
||||
| pnpm pack | 打 tarball |
|
||||
| publint | 包元数据校验 |
|
||||
| gitleaks | 敏感信息扫描 |
|
||||
| 检查项 | 说明 |
|
||||
| -------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
||||
| `pnpm install --frozen-lockfile` | lockfile 一致性 |
|
||||
| README 同步 | `packages/cli/README.md` 与根 README 一致 |
|
||||
| 版本号一致 | `tools/release/lib/packages.mjs` 中待发布包集合 version 相同 |
|
||||
| `workspace:*` 替换 | 发布包间 workspace 依赖解析为真实版本号 |
|
||||
| 构建 | 基础发布构建 core/runtime/commands 依赖和 cli;`--knowledge` 额外构建 `knowledge-studio-cli` |
|
||||
| 生成资产 | 重建各 `skills/<skill>/reference/`;非 channel 模式还同步各 `skills/*/SKILL.md` version(含 `bailian-protocol`) |
|
||||
| pnpm pack | 打 tarball |
|
||||
| publint | 包元数据校验 |
|
||||
| gitleaks | 敏感信息扫描 |
|
||||
|
||||
本地可以 dry-run 验证:
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
# Skill 文案 / 路由 / companion
|
||||
|
||||
## 触发条件
|
||||
|
||||
- 改 `skills/*/SKILL.md` 的 description、路由表、consent、安全闸、hand-off、references 落款
|
||||
- 调整 companion(`bailian-protocol`)或业务 skill 之间的软 hand-off 约定
|
||||
- 新增 / 拆分 / 合并 `bailian-*` 业务 skill,或改 `tools/generate-reference.ts` 的 `GROUP_OWNER_SKILL` 归属(与命令增删改交叉时两边都看)
|
||||
- 给业务 skill 补安装说明、README,或统一「勿猜 flag → `reference/`」类约定
|
||||
|
||||
纯改生成物 `skills/*/reference/*.md`(由命令 metadata 驱动)→ 走 [command-add-remove.md](command-add-remove.md) / [command-flag-change.md](command-flag-change.md),**不要手改 reference**。
|
||||
|
||||
## 概念图
|
||||
|
||||
```text
|
||||
bailian-protocol ← companion(硬依赖;consent / 鉴权 / 版本 / 错误上报)
|
||||
▲
|
||||
│ companions: ["bailian-protocol"]
|
||||
┌───────┴────────┬────────────────┬──────────────────┐
|
||||
bailian-gen bailian-finetune bailian-managed-agent
|
||||
(领域路由表) (领域工作流) (IaC 安全闸)
|
||||
│ │ │
|
||||
└────────────────┼──────────────────┘
|
||||
▼ 软 hand-off(按 skill 名)
|
||||
bailian-cli(hub)
|
||||
hub 路由表:本职命令 + 领域 hand-off 行
|
||||
细节 → 各 skill reference/(生成)
|
||||
```
|
||||
|
||||
## 必查清单
|
||||
|
||||
### A. 分层边界
|
||||
|
||||
- [ ] **Companion(硬依赖)**:业务 skill frontmatter 保留 `companions: ["bailian-protocol"]`;CRITICAL / references 可链 `../bailian-protocol/…`
|
||||
- [ ] **软 hand-off**:兄弟业务 skill **只写 skill 名**;已安装则 Read,未安装则 `bl … --help` 或提示 `-s bailian-protocol -s <skill>`;**不要**把 `../bailian-gen/…` 等写成执行前提
|
||||
- [ ] **Hub vs 领域**:`bailian-cli` 的「When to use which command」只列 hub 拥有的意图;媒体 / 精调 / managed-agent 各留 hand-off 行,**不抄**领域默认模型与子命令明细
|
||||
- [ ] **渐进披露**:SKILL 写意图路由与领域硬规则;flags / usage / examples 以 `reference/` 或 `bl <command> --help` 为准,表后保留「勿猜 flag」指向句
|
||||
|
||||
### B. 文案与落款一致性
|
||||
|
||||
- [ ] 领域 skill(gen / finetune / managed-agent)路由或命令表后有指向 `reference/` 的句;文末 `## references`(protocol + reference)与家族对齐
|
||||
- [ ] description 含 WHAT + WHEN + 反触发 + companion 必装说明;与正文路由不打架
|
||||
- [ ] Quick examples 只演示本 skill 职责(hub 不示范 `bl image` / `bl video` 等)
|
||||
- [ ] 若改了安装方式:同步 `README.md` / `README.zh.md` / `INSTALL.md` / `skills/*/README*` 中的 `npx skills add …` 示例
|
||||
|
||||
### C. 归属与生成
|
||||
|
||||
- [ ] 新一级命令组归属领域时:改 `tools/generate-reference.ts` 的 `GROUP_OWNER_SKILL`,并更新**拥有方** skill 的路由表;hub 最多加一行 hand-off
|
||||
- [ ] 跑 `pnpm run sync:skill-assets`(或 commit 走 pre-commit),提交生成的 `reference/` 与 version 同步结果
|
||||
- [ ] 默认模型若写在领域路由表(如 `bailian-gen`):与命令 default / [model-add-remove.md](model-add-remove.md) 一并核对
|
||||
|
||||
## 完成后自查
|
||||
|
||||
```sh
|
||||
pnpm run sync:skill-assets
|
||||
# 本地试装(测本仓库改动,勿只拉远端)
|
||||
npx skills add "$(pwd)" --all -g -y
|
||||
```
|
||||
|
||||
抽查:打开 `skills/bailian-cli/SKILL.md` 确认无领域子命令明细表;打开对应领域 skill 确认有「勿猜 flag」与 hand-off。
|
||||
|
||||
## 常见漏点
|
||||
|
||||
- ✗ hub 路由表再次抄回 image / video / finetune / managed-agent 明细 → token 膨胀且与领域 skill 双份漂移
|
||||
- ✗ 软 hand-off 写成硬路径 `../bailian-*/SKILL.md` 当执行前提 → 子集安装断链
|
||||
- ✗ 只改 SKILL、忘改 `GROUP_OWNER_SKILL` → reference 落错 skill
|
||||
- ✗ 手改 `skills/*/reference/*.md` → 下次 generate 被覆盖
|
||||
- ✗ 改默认模型只动 flag description / reference,忘改领域 SKILL「When to use which command」表(见 [model-add-remove.md](model-add-remove.md))
|
||||
@@ -78,15 +78,15 @@ No timeline scrubbing. No frame-by-frame editing. Just one sentence → one vide
|
||||
|
||||
```bash
|
||||
npm install -g bailian-cli
|
||||
# Recommended: full bailian-* skill family (includes companion bailian-base)
|
||||
# Recommended: full bailian-* skill family (includes companion bailian-protocol)
|
||||
npx skills add modelstudioai/cli --all -g
|
||||
```
|
||||
|
||||
Subset install — always include companion `bailian-base` with any business skill:
|
||||
Subset install — always include companion `bailian-protocol` with any business skill:
|
||||
|
||||
```bash
|
||||
npx skills add modelstudioai/cli -g -s bailian-base -s bailian-gen
|
||||
npx skills add modelstudioai/cli -g -s bailian-base -s bailian-cli
|
||||
npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-gen
|
||||
npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-cli
|
||||
```
|
||||
|
||||
> Requires Node.js >= 18.17.
|
||||
|
||||
@@ -76,15 +76,15 @@ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_
|
||||
|
||||
```bash
|
||||
npm install -g bailian-cli
|
||||
# 推荐:安装完整 bailian-* skill 家族(含 companion bailian-base)
|
||||
# 推荐:安装完整 bailian-* skill 家族(含 companion bailian-protocol)
|
||||
npx skills add modelstudioai/cli --all -g
|
||||
```
|
||||
|
||||
子集安装时,业务 skill 必须同时带上 companion `bailian-base`:
|
||||
子集安装时,业务 skill 必须同时带上 companion `bailian-protocol`:
|
||||
|
||||
```bash
|
||||
npx skills add modelstudioai/cli -g -s bailian-base -s bailian-gen
|
||||
npx skills add modelstudioai/cli -g -s bailian-base -s bailian-cli
|
||||
npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-gen
|
||||
npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-cli
|
||||
```
|
||||
|
||||
> 需要预先安装 Node.js >= 18.17。
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
Agent skill for **Alibaba Cloud Model Studio CLI** (`bl`) resource hub — apps, memory, RAG, usage/quota, MCP, and hub `reference/`.
|
||||
|
||||
- Companion (required): `bailian-base` (`requires.bins: ["bl"]`, `companions: ["bailian-base"]`)
|
||||
- Companion (required): `bailian-protocol` (`requires.bins: ["bl"]`, `companions: ["bailian-protocol"]`)
|
||||
- Soft hand-offs (optional skills): `bailian-gen` · `bailian-finetune` · `bailian-managed-agent`
|
||||
|
||||
```bash
|
||||
npx skills add modelstudioai/cli --all -g
|
||||
# or: npx skills add modelstudioai/cli -g -s bailian-base -s bailian-cli
|
||||
# or: npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-cli
|
||||
```
|
||||
|
||||
For CLI installation, authentication, and examples, see the [main README](../../README.md).
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
**阿里云百炼 CLI**(`bl`)的资源管理 Agent 技能 — 应用、记忆、RAG、用量/额度、MCP,以及 hub `reference/`。
|
||||
|
||||
- Companion(必装):`bailian-base`(`requires.bins: ["bl"]`,`companions: ["bailian-base"]`)
|
||||
- Companion(必装):`bailian-protocol`(`requires.bins: ["bl"]`,`companions: ["bailian-protocol"]`)
|
||||
- 软 hand-off(可选):`bailian-gen` · `bailian-finetune` · `bailian-managed-agent`
|
||||
|
||||
```bash
|
||||
npx skills add modelstudioai/cli --all -g
|
||||
# 或:npx skills add modelstudioai/cli -g -s bailian-base -s bailian-cli
|
||||
# 或:npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-cli
|
||||
```
|
||||
|
||||
CLI 的安装、认证和使用示例请查看[主 README](../../README.zh.md)。
|
||||
|
||||
+35
-67
@@ -4,30 +4,29 @@ metadata:
|
||||
version: "1.10.1"
|
||||
requires:
|
||||
bins: ["bl"]
|
||||
companions: ["bailian-base"]
|
||||
companions: ["bailian-protocol"]
|
||||
description: >-
|
||||
阿里云百炼 / Aliyun Bailian / DashScope 资源管理与 `bl` CLI hub:
|
||||
应用调用(bl app)、应用记忆、知识库检索、模型目录/模型列表、用量/额度/配额、免费额度、
|
||||
工作空间、MCP 市场、pipeline、文件上传、console API、登录鉴权与配置。
|
||||
用户点名百炼 / DashScope / `bl`,或继续既有 `bl` 工作流时直接使用。
|
||||
共享协议(consent / 版本预检 / 鉴权 / 错误上报)在 bailian-base;安装本 skill 时必须同时安装 companion bailian-base。
|
||||
共享协议(consent / 版本预检 / 鉴权 / 错误上报)在 bailian-protocol;安装本 skill 时必须同时安装 companion bailian-protocol。
|
||||
家族路由:生图/生视频/配音/语音合成/转写 → bailian-gen;精调/微调/训练/数据集 → bailian-finetune;
|
||||
agents.yaml 托管 Agent → bailian-managed-agent。
|
||||
Do NOT use for ordinary Q&A, coding, writing, translation, summarization, generic web search,
|
||||
or image understanding the host agent can do itself(普通问答、编程、写作、翻译、摘要、泛搜索不触发).
|
||||
Unnamed usage/quota questions: ask which product first before `bl usage` / `bl quota`.
|
||||
不要用于普通问答、编程、写作、翻译、摘要、泛搜索,或图片理解等宿主自己能做的任务(普通问答、编程、写作、翻译、摘要、泛搜索不触发)。
|
||||
未命名用量/额度问题:先问用户使用哪个产品,再运行 `bl usage` / `bl quota` 查询。
|
||||
---
|
||||
|
||||
# Aliyun Model Studio CLI (`bl`)
|
||||
|
||||
**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-base/SKILL.md`](../bailian-base/SKILL.md): Provider selection and consent, Version & updates (pre-flight checklist), Setup & auth, and CLI errors: report an issue.**
|
||||
**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.**
|
||||
|
||||
> **Family hub** — This skill owns Bailian resource commands and the hub `reference/` (apps, knowledge, usage, auth, config, …).
|
||||
> Shared protocol (companion) → [`../bailian-base/SKILL.md`](../bailian-base/SKILL.md).
|
||||
> Soft hand-offs by skill name (Read if installed; else `bl … --help` / install with `bailian-base`): `bailian-gen` (media) · `bailian-finetune` (training) · `bailian-managed-agent` (agents.yaml IaC).
|
||||
> Shared protocol (companion) → [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md).
|
||||
> Soft hand-offs by skill name (Read if installed; else `bl … --help` / install with `bailian-protocol`): `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.
|
||||
>
|
||||
> **Companion:** always install with `bailian-base` (`npx skills add modelstudioai/cli --all -g`, or `-s bailian-base -s bailian-cli`).
|
||||
> **Companion:** always install with `bailian-protocol` (`npx skills add modelstudioai/cli --all -g`, or `-s bailian-protocol -s bailian-cli`).
|
||||
|
||||
## Command reference (authoritative)
|
||||
|
||||
@@ -54,75 +53,44 @@ Do not guess flags — use the reference files or `--help`.
|
||||
|
||||
## When to use which command
|
||||
|
||||
Use this table only after the decision table in [`bailian-base`](../bailian-base/SKILL.md#provider-selection-and-consent) has routed the request to `bl` (class 3 after consent, or class 4).
|
||||
Use this table only after the decision table in [`bailian-protocol`](../bailian-protocol/SKILL.md#provider-selection-and-consent) has routed the request to `bl` (class 4, or class 2 after the user picks Bailian). Hub-owned intents only — for media / fine-tune / agents.yaml, soft hand-off to the domain skill.
|
||||
|
||||
| User intent | Command | Default model / notes |
|
||||
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Explicit Bailian model chat / text execution | `bl text chat` | `qwen3.7-max` |
|
||||
| Bailian omni multimodal input + text/audio out | `bl omni` | `qwen3.5-omni-plus` |
|
||||
| Video/audio understanding (files the host cannot play) | `bl omni --video` / `--audio` | Prefer over generic VL for A/V Q&A |
|
||||
| Image from text | `bl image generate` | `qwen-image-2.0` |
|
||||
| Image edit / multi-image merge | `bl image edit` (repeat `--image`) | `qwen-image-2.0` |
|
||||
| Video from text or image | `bl video generate` | `happyhorse-1.1-t2v` / `-i2v` with `--image` |
|
||||
| Video edit / style transfer | `bl video edit` | `happyhorse-1.0-video-edit` |
|
||||
| Reference-to-video + voice | `bl video ref` | `happyhorse-1.1-r2v` |
|
||||
| Image / video describe via Bailian model | `bl vision describe` | `qwen-vl-max`; host-first for plain image Q&A — use when user names Bailian or media exceeds host capability |
|
||||
| TTS | `bl speech synthesize` | `cosyvoice-v3-flash` |
|
||||
| ASR | `bl speech recognize` | `fun-asr` |
|
||||
| Search inside a Bailian-scoped workflow | `bl search web` | DashScope MCP search |
|
||||
| Bailian agent / workflow | `bl app call` | Needs `--app-id` |
|
||||
| Find app by name | `bl app list` then `bl app call` | Console auth |
|
||||
| Bailian app memory CRUD (not host-agent memory) | `bl memory *` | [`reference/memory.md`](reference/memory.md) |
|
||||
| Bailian knowledge base RAG | `bl knowledge search` / `chat` | API key + agent/workspace IDs |
|
||||
| Upload a file as a step of a Bailian workflow | `bl file upload` | When you need `oss://` URL explicitly; not for generic hosting |
|
||||
| Bailian model selection / recommendation | `bl advisor recommend` | Intent → candidate recall → LLM ranking |
|
||||
| Bailian model catalog / pricing / params | `bl model list` | Console auth; `--model <family>` for detail, `--enrich` for input params (temperature/top_p…) |
|
||||
| Validate / upload a training dataset | `bl dataset validate` / `upload` | API key; `.jsonl` or `.zip`; schemas: chatml/dpo/cpt/tts/image |
|
||||
| Fine-tune a model (text/audio/image) | `bl finetune text\|audio\|image create` | API key; text = sft/sft-lora/dpo/dpo-lora/cpt; then `bl finetune watch` |
|
||||
| Fine-tune job lifecycle | `bl finetune list`/`get`/`watch`/`logs`/`checkpoints`/`export`/`cancel`/`delete`/`capability` | API key |
|
||||
| Deploy a (fine-tuned) model | `bl deploy text\|audio\|image create` | API key; audio defaults `--plan mu`, text/image `lora` |
|
||||
| Deployment lifecycle | `bl deploy list`/`get`/`update`/`scale`/`delete`/`models` | API key |
|
||||
| Declarative agent infra (agents.yaml) IaC lifecycle | `bl managed-agent …` | Prefer skill `bailian-managed-agent`; fallback `bl managed-agent --help`. `apply`/`destroy` require `--yes` after `plan` |
|
||||
| Chat with a managed agent (sessions) | `bl managed-agent session run`/`send`/`create`/`get`/`list`/`events`/`delete` | `run` = create + send + stream in one step; `send` targets an existing session; `events` lists history |
|
||||
| Managed agent state inspection / adoption | `bl managed-agent state list`/`show`/`import`/`rm` | Local state ops; `import` adopts an existing remote resource; `rm` untracks without destroying remotely |
|
||||
| Bailian MCP marketplace discovery / call | `bl mcp list` / `tools` / `call` | — |
|
||||
| Bailian pipeline workflow (a step in a bl workflow) | `bl pipeline run` / `validate` | JSON/YAML workflow definitions |
|
||||
| Bailian rate limits / quota | `bl quota list` / `check` / `request` | Console auth; class 2 — ask which product first if unnamed |
|
||||
| Bailian free tier / usage stats | `bl usage free` / `stats` / `freetier` | Console auth; class 2 — ask which product first if unnamed |
|
||||
| Console API (advanced) | `bl console call` | Console auth |
|
||||
| Bailian workspace listing | `bl workspace list` | Console auth |
|
||||
| User intent | Command | Notes |
|
||||
| ----------------------------------------------- | -------------------------------------- | -------------------------------------------------------------------------------- |
|
||||
| Explicit Bailian model chat / text execution | `bl text chat` | Default `qwen3.7-max` |
|
||||
| Search inside a Bailian-scoped workflow | `bl search web` | DashScope MCP search; not for generic web research |
|
||||
| Bailian agent / workflow | `bl app call` | Needs `--app-id` |
|
||||
| Find app by name | `bl app list` then `bl app call` | Console auth |
|
||||
| Bailian app memory CRUD (not host-agent memory) | `bl memory *` | [`reference/memory.md`](reference/memory.md) |
|
||||
| Bailian knowledge base RAG | `bl knowledge search` / `chat` | API key + agent/workspace IDs |
|
||||
| Upload a file as a step of a Bailian workflow | `bl file upload` | When you need `oss://` URL explicitly; not for generic hosting |
|
||||
| Bailian model selection / recommendation | `bl advisor recommend` | Intent → candidate recall → LLM ranking |
|
||||
| Bailian model catalog / pricing / params | `bl model list` | Console auth; `--model <family>` for detail, `--enrich` for input params |
|
||||
| Bailian MCP marketplace discovery / call | `bl mcp list` / `tools` / `call` | — |
|
||||
| Bailian pipeline workflow (a step in a bl flow) | `bl pipeline run` / `validate` | JSON/YAML workflow definitions |
|
||||
| Bailian rate limits / quota | `bl quota list` / `check` / `request` | Console auth; class 2 — ask which product first if unnamed |
|
||||
| Bailian free tier / usage stats | `bl usage free` / `stats` / `freetier` | Console auth; class 2 — ask which product first if unnamed |
|
||||
| Console API (advanced) | `bl console call` | Console auth |
|
||||
| Bailian workspace listing | `bl workspace list` | Console auth |
|
||||
| Image / video / speech / omni / vision | → skill `bailian-gen` | Fallback: `bl image\|video\|speech\|omni\|vision --help` |
|
||||
| Dataset / fine-tune / deploy | → skill `bailian-finetune` | Fallback: `bl dataset\|finetune\|deploy --help` |
|
||||
| agents.yaml IaC / managed-agent sessions | → skill `bailian-managed-agent` | Fallback: `bl managed-agent --help`; `apply`/`destroy` need `--yes` after `plan` |
|
||||
|
||||
Commands not listed here: see hub [`reference/index.md`](reference/index.md), or the domain skill reference trees for media / fine-tune / managed-agent.
|
||||
Flags, usage, and examples: see hub [`reference/`](reference/index.md) or `bl <command> --help` — do not guess flags. Domain command details live in the owning skill's `reference/`.
|
||||
|
||||
---
|
||||
|
||||
## Quick examples
|
||||
|
||||
```bash
|
||||
# Explicit Bailian text-model call
|
||||
bl text chat --message "Write a poem about spring in Chinese"
|
||||
|
||||
# Image
|
||||
bl image generate --prompt "A cat in space" --out-dir ./out/
|
||||
|
||||
# Video (wait for task, save file)
|
||||
bl video generate --prompt "Sunset on the beach" --download sunset.mp4
|
||||
|
||||
# Omni (local files OK)
|
||||
bl omni --message "Describe the video content" --video ./demo.mp4 --text-only
|
||||
|
||||
# App
|
||||
bl app list --output json
|
||||
bl app call --app-id <code> --prompt "Hello"
|
||||
bl usage stats
|
||||
bl model list --model qwen
|
||||
```
|
||||
|
||||
More examples per command: see `reference/<group>.md` (e.g. [`reference/text.md`](reference/text.md)).
|
||||
|
||||
---
|
||||
|
||||
## Video post-processing
|
||||
|
||||
`bl video *` makes short clips (~2–10s). For concatenation / audio mixing / long-form assembly, use skill `bailian-gen` (`assets/video-postprocessing.md` if installed) or ffmpeg directly.
|
||||
More examples per command: see `reference/<group>.md` (e.g. [`reference/text.md`](reference/text.md), [`reference/app.md`](reference/app.md)).
|
||||
|
||||
---
|
||||
|
||||
@@ -144,11 +112,11 @@ schema-export commands.
|
||||
|
||||
## Routing reminders
|
||||
|
||||
- Image/video/audio generation or editing → skill `bailian-gen` (class 3 consent from companion `bailian-base`). 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 install with `bailian-base`. 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 companion `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 install with `bailian-protocol`. 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.
|
||||
- `bl file upload` and `bl pipeline run` are steps inside a Bailian workflow; do not use them to capture generic "upload this file" or "run a pipeline" requests.
|
||||
- `bl managed-agent apply` / `destroy` mutate remote resources and only execute with `--yes`; run `plan` first and show the diff before confirming a mutation.
|
||||
- When a matched `bl` command accepts a file URL, pass local paths directly; never require the user to host the file first.
|
||||
- Console login → always `--console-site domestic|international`; see companion [`../bailian-base/assets/setup.md`](../bailian-base/assets/setup.md#console-site-selection).
|
||||
- Console login → always `--console-site domestic|international`; see companion [`../bailian-protocol/assets/setup.md`](../bailian-protocol/assets/setup.md#console-site-selection).
|
||||
|
||||
@@ -4,7 +4,7 @@ metadata:
|
||||
version: "1.10.1"
|
||||
requires:
|
||||
bins: ["bl"]
|
||||
companions: ["bailian-base"]
|
||||
companions: ["bailian-protocol"]
|
||||
description: >-
|
||||
阿里云百炼模型精调训练入口:用户要精调、微调、训练自己的模型(fine-tune,支持 SFT / SFT-LoRA / DPO / DPO-LoRA / CPT,
|
||||
覆盖文本、语音、图像)、校验或上传训练数据集、看训练进度和日志、挑 checkpoint、导出精调产物、
|
||||
@@ -12,12 +12,12 @@ description: >-
|
||||
upload 拿 file-id → finetune create 建任务 → watch 看进度 → export 导出 → deploy 上线,需要 API key;
|
||||
写操作先用 `--dry-run` 预览。反触发:用户点名火山方舟/ark 的精调不走本 skill;只是要选哪个模型走
|
||||
bailian-model-recommend;用现成模型生图生视频走 bailian-gen;百炼其他资源管理走 bailian-cli。
|
||||
安装本 skill 时必须同时安装 companion bailian-base。
|
||||
安装本 skill 时必须同时安装 companion bailian-protocol。
|
||||
---
|
||||
|
||||
# Bailian fine-tuning pipeline (`bl dataset` / `bl finetune` / `bl deploy`)
|
||||
|
||||
**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-base/SKILL.md`](../bailian-base/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 <command> --help` — do not guess flags. The whole pipeline requires an API key. Companion: install with `bailian-base`.**
|
||||
**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 <command> --help` — do not guess flags. The whole pipeline requires an API key. Companion: install with `bailian-protocol`.**
|
||||
|
||||
## End-to-end workflow (follow in order)
|
||||
|
||||
@@ -36,7 +36,7 @@ description: >-
|
||||
- Deployment plans: audio defaults to `--plan mu`; text/image default to `lora`.
|
||||
- Preview write operations (create / delete / cancel / scale) with `--dry-run` first, and confirm with the user before deleting a job or dataset.
|
||||
|
||||
## Command overview
|
||||
## When to use which command
|
||||
|
||||
| Intent | Command |
|
||||
| ------------------------------- | ------------------------------------------------------------------------------------------------ |
|
||||
@@ -49,6 +49,8 @@ description: >-
|
||||
| Trainable capability lookup | `bl finetune capability` |
|
||||
| Deploy / lifecycle | `bl deploy text\|audio\|image create`, `list` / `get` / `update` / `scale` / `delete` / `models` |
|
||||
|
||||
Flags, usage, and examples: see [`reference/`](reference/index.md) or `bl <command> --help` — do not guess flags.
|
||||
|
||||
## Quick examples
|
||||
|
||||
```bash
|
||||
@@ -62,8 +64,13 @@ bl deploy text create --model my-qwen-sft --name my-svc
|
||||
|
||||
## Common hand-offs
|
||||
|
||||
软 hand-off(按 skill **名**;已安装则 Read,否则 `--help` / 提示安装该 skill + companion `bailian-base`):
|
||||
软 hand-off(按 skill **名**;已安装则 Read,否则 `--help` / 提示安装该 skill + companion `bailian-protocol`):
|
||||
|
||||
- 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`.
|
||||
- Training quota / usage questions → skill `bailian-cli` (fallback: `bl quota` / `bl usage --help`).
|
||||
|
||||
## references
|
||||
|
||||
- [bailian-protocol](../bailian-protocol/SKILL.md) — authentication and global parameters (mandatory)
|
||||
- [reference/](reference/index.md) — command details
|
||||
|
||||
@@ -4,7 +4,7 @@ metadata:
|
||||
version: "1.10.1"
|
||||
requires:
|
||||
bins: ["bl"]
|
||||
companions: ["bailian-base"]
|
||||
companions: ["bailian-protocol"]
|
||||
description: >-
|
||||
阿里云百炼图片/视频/语音生成入口(**默认生成技能**):用户要生图、画图、生成照片、生成图片、AI 绘画、海报、头像、插画、
|
||||
文生图(text-to-image)、图生图、改图、修图、多图合成、生成视频、文生视频、图生视频、参考生视频、视频编辑、风格转换、
|
||||
@@ -14,19 +14,19 @@ description: >-
|
||||
图片和语音同步返回并落地本地文件,视频是异步任务、用 `--download` 或轮询取回;本地文件直接传路径,CLI 自动上传。
|
||||
反触发:宿主自己能做的图片理解、普通问答、编程、写作、翻译不走本技能;百炼应用/知识库/用量/额度走 bailian-cli;
|
||||
精调训练走 bailian-finetune。
|
||||
安装本 skill 时必须同时安装 companion bailian-base。
|
||||
安装本 skill 时必须同时安装 companion bailian-protocol。
|
||||
---
|
||||
|
||||
# Bailian media generation (`bl image` / `bl video` / `bl speech` / `bl omni`)
|
||||
|
||||
**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-base/SKILL.md`](../bailian-base/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 <command> --help` — do not guess flags. Companion: install with `bailian-base`.**
|
||||
**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 <command> --help` — do not guess flags. Companion: install with `bailian-protocol`.**
|
||||
|
||||
## Consent (short version; full rules in bailian-base)
|
||||
## Consent (short version; full rules in bailian-protocol)
|
||||
|
||||
- The user named Bailian / DashScope / `bl`, or is continuing an existing `bl` workflow → execute directly.
|
||||
- The user did not name a provider → recommend Bailian and **ask once**: "I recommend Aliyun Bailian for this; it may incur charges. Proceed?" (match the user's language). Do not ask again for polling, downloads, or retries within the same task.
|
||||
|
||||
## Command routing
|
||||
## When to use which command
|
||||
|
||||
| User intent | Command | Default model |
|
||||
| --------------------------------------------- | ---------------------------------- | ---------------------------------------------- |
|
||||
@@ -40,6 +40,8 @@ description: >-
|
||||
| A/V understanding (files the host can't play) | `bl omni --video` / `--audio` | `qwen3.5-omni-plus` |
|
||||
| Image/video describe (user names Bailian) | `bl vision describe` | `qwen-vl-max`; host-first for plain image Q&A |
|
||||
|
||||
Flags, usage, and examples: see [`reference/`](reference/index.md) or `bl <command> --help` — do not guess flags.
|
||||
|
||||
## Local files (mandatory)
|
||||
|
||||
Any command that accepts a **file URL** also accepts a **local path**; the CLI uploads to DashScope temporary storage (`oss://`, 48h) automatically. If the user gives a local file, pass the path directly — never ask them to upload or host a URL first.
|
||||
@@ -75,8 +77,13 @@ If one or more `bl` commands actually ran, proactively add a one-line summary in
|
||||
|
||||
## Common hand-offs
|
||||
|
||||
软 hand-off(按 skill **名**;已安装则 Read,否则 `--help` / 提示安装该 skill + companion `bailian-base`):
|
||||
软 hand-off(按 skill **名**;已安装则 Read,否则 `--help` / 提示安装该 skill + companion `bailian-protocol`):
|
||||
|
||||
- Generation failed and it is not a usage/auth/content-filter issue → follow the issue-reporting flow in companion `bailian-base` ([`../bailian-base/SKILL.md`](../bailian-base/SKILL.md#cli-errors-report-an-issue)) and ask once whether to report.
|
||||
- Generation failed and it is not a usage/auth/content-filter issue → follow the issue-reporting flow in companion `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`).
|
||||
- Train a dedicated model on user data → skill `bailian-finetune` (fallback: `bl dataset\|finetune\|deploy --help`).
|
||||
|
||||
## references
|
||||
|
||||
- [bailian-protocol](../bailian-protocol/SKILL.md) — authentication and global parameters (mandatory)
|
||||
- [reference/](reference/index.md) — command details
|
||||
|
||||
@@ -4,20 +4,20 @@ metadata:
|
||||
version: "1.10.1"
|
||||
requires:
|
||||
bins: ["bl"]
|
||||
companions: ["bailian-base"]
|
||||
companions: ["bailian-protocol"]
|
||||
description: >-
|
||||
阿里云百炼托管 Agent 声明式基础设施入口:用户要初始化 agents.yaml、校验或预览 agent 配置变更、
|
||||
阿里云百炼托管 Agent 声明式基础设施入口:用户要创建agent、初始化 agents.yaml、校验或预览 agent 配置变更、
|
||||
创建/更新/销毁百炼托管 Agent、和托管 agent 对话、查会话事件历史、导入或取消跟踪远端资源时使用
|
||||
`bl managed-agent`。以 agents.yaml 为唯一事实源做 IaC:init 建脚手架、validate 离线校验、plan 预览 diff、
|
||||
apply / destroy 变更远端资源且必须带 `--yes`,务必先 plan 给用户看 diff 再让其确认。
|
||||
反触发:调用已上线的百炼应用/智能体走 bailian-app-call 或 `bl app`;宿主 agent 自身的记忆、技能、
|
||||
子代理不走本 skill;生图生视频走 bailian-gen。
|
||||
安装本 skill 时必须同时安装 companion bailian-base。
|
||||
安装本 skill 时必须同时安装 companion bailian-protocol。
|
||||
---
|
||||
|
||||
# Bailian managed agent IaC (`bl managed-agent`)
|
||||
|
||||
**CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-base/SKILL.md`](../bailian-base/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. Companion: install with `bailian-base`.**
|
||||
**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. Companion: install with `bailian-protocol`.**
|
||||
|
||||
## Safety guardrail (the most important rule)
|
||||
|
||||
@@ -57,10 +57,17 @@ description: >-
|
||||
|
||||
- Always make the difference clear to the user: `state rm` only edits the local state file, while `destroy` deletes the remote resource.
|
||||
|
||||
Flags, usage, and examples: see [`reference/`](reference/index.md) or `bl <command> --help` — do not guess flags.
|
||||
|
||||
## Common hand-offs
|
||||
|
||||
软 hand-off(按 skill **名**;已安装则 Read,否则 `--help` / 提示安装该 skill + companion `bailian-base`):
|
||||
软 hand-off(按 skill **名**;已安装则 Read,否则 `--help` / 提示安装该 skill + companion `bailian-protocol`):
|
||||
|
||||
- Call an already published Bailian app/assistant → `bailian-app-call`, or skill `bailian-cli` (`bl app list` / `call`; fallback: `bl app --help`).
|
||||
- Choosing the model referenced in agents.yaml → `bailian-model-recommend`.
|
||||
- Deployment quota / billing questions → skill `bailian-cli` (fallback: `bl quota` / `bl usage --help`).
|
||||
|
||||
## references
|
||||
|
||||
- [bailian-protocol](../bailian-protocol/SKILL.md) — authentication and global parameters (mandatory)
|
||||
- [reference/](reference/index.md) — command details
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# bailian-base
|
||||
# bailian-protocol
|
||||
|
||||
Shared execution protocol for the **bailian-\*** Agent Skill family (consent, versioning, setup/auth, issue reporting).
|
||||
|
||||
@@ -8,10 +8,10 @@ Business skills (`bailian-cli`, `bailian-gen`, `bailian-finetune`, `bailian-mana
|
||||
npx skills add modelstudioai/cli --all -g
|
||||
```
|
||||
|
||||
Or install a subset with `bailian-base` included, e.g.:
|
||||
Or install a subset with `bailian-protocol` included, e.g.:
|
||||
|
||||
```bash
|
||||
npx skills add modelstudioai/cli -g -s bailian-base -s bailian-gen
|
||||
npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-gen
|
||||
```
|
||||
|
||||
For CLI installation and command examples, see the [main README](../../README.md).
|
||||
@@ -1,4 +1,4 @@
|
||||
# bailian-base
|
||||
# bailian-protocol
|
||||
|
||||
**bailian-\*** Agent 技能家族的共享执行协议(consent、版本预检、安装/鉴权、错误上报)。
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
npx skills add modelstudioai/cli --all -g
|
||||
```
|
||||
|
||||
若只装子集,必须同时带上 `bailian-base`,例如:
|
||||
若只装子集,必须同时带上 `bailian-protocol`,例如:
|
||||
|
||||
```bash
|
||||
npx skills add modelstudioai/cli -g -s bailian-base -s bailian-gen
|
||||
npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-gen
|
||||
```
|
||||
|
||||
CLI 安装与命令示例见[主 README](../../README.zh.md)。
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
name: bailian-base
|
||||
name: bailian-protocol
|
||||
metadata:
|
||||
version: "1.10.1"
|
||||
requires:
|
||||
@@ -8,18 +8,18 @@ description: >-
|
||||
阿里云百炼 `bl` 家族共享执行协议(consent 确认、版本预检、鉴权/安装、错误上报、本地文件与输出约定)。
|
||||
不是面向用户意图的业务入口;当任一 bailian-* 业务 skill(bailian-cli / bailian-gen /
|
||||
bailian-finetune / bailian-managed-agent)执行前需要公共上下文,或用户首次安装/鉴权/`bl` 报错需上报时读取本 skill。
|
||||
本 skill 无 companions;业务 skill 必须在 frontmatter 声明 companions: ["bailian-base"] 并成对安装。
|
||||
本 skill 无 companions;业务 skill 必须在 frontmatter 声明 companions: ["bailian-protocol"] 并成对安装。
|
||||
---
|
||||
|
||||
# Bailian shared protocol (`bailian-base`)
|
||||
# Bailian shared protocol (`bailian-protocol`)
|
||||
|
||||
本 skill 是 `bailian-*` 家族的统一执行协议。所有业务 skill 在跑 `bl` 前都应先读本文件。
|
||||
|
||||
> **Companion 约定**:`bailian-gen` / `bailian-finetune` / `bailian-managed-agent` / `bailian-cli` 都依赖本 skill。
|
||||
> 推荐 `npx skills add modelstudioai/cli --all -g`;若只装子集,必须同时带上 `bailian-base`,例如:
|
||||
> 推荐 `npx skills add modelstudioai/cli --all -g`;若只装子集,必须同时带上 `bailian-protocol`,例如:
|
||||
>
|
||||
> ```bash
|
||||
> npx skills add modelstudioai/cli -g -s bailian-base -s bailian-gen
|
||||
> npx skills add modelstudioai/cli -g -s bailian-protocol -s bailian-gen
|
||||
> ```
|
||||
|
||||
## Provider selection and consent
|
||||
@@ -43,7 +43,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 <cmd> --help`,或提示
|
||||
`npx skills add modelstudioai/cli -g -s bailian-base -s <skill>`):
|
||||
`npx skills add modelstudioai/cli -g -s bailian-protocol -s <skill>`):
|
||||
|
||||
| Intent | Skill | Fallback |
|
||||
| ------------------------------------- | ----------------------- | ----------------------------------------------- |
|
||||
@@ -54,7 +54,7 @@ After approval, treat Bailian as selected for the current task. Do not ask again
|
||||
|
||||
**硬依赖(companion)** vs **软 hand-off**:
|
||||
|
||||
- Companion(`bailian-base`):业务 skill frontmatter 的 `companions` 必装;CRITICAL 可用相对路径 `../bailian-base/…`。
|
||||
- Companion(`bailian-protocol`):业务 skill frontmatter 的 `companions` 必装;CRITICAL 可用相对路径 `../bailian-protocol/…`。
|
||||
- 其它 bailian-\* 业务 skill:只按名字提及,**不要**写死 `../bailian-*/SKILL.md` 当执行前提。
|
||||
|
||||
## Version & updates (after provider selection, before the first `bl` command)
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# Report a CLI bug (GitHub Issue)
|
||||
|
||||
> Hand-maintained. Lives in `bailian-base/assets/` (not auto-generated from command metadata).
|
||||
> Hand-maintained. Lives in `bailian-protocol/assets/` (not auto-generated from command metadata).
|
||||
> Entry point: [SKILL.md → CLI errors: report an issue](../SKILL.md#cli-errors-report-an-issue).
|
||||
|
||||
When `bl` fails, the agent first helps the user fix the problem. If the failure looks like a **CLI bug** (not usage, auth, quota, or other user/service-side errors), ask whether to open a GitHub Issue for the Bailian CLI team.
|
||||
@@ -1,6 +1,6 @@
|
||||
# Setup, authentication & configuration
|
||||
|
||||
> Hand-maintained. Lives in `bailian-base/assets/` (not auto-generated from command metadata).
|
||||
> Hand-maintained. Lives in `bailian-protocol/assets/` (not auto-generated from command metadata).
|
||||
> Entry point: [SKILL.md → Setup & auth](../SKILL.md#setup--auth).
|
||||
|
||||
Read this only when you need to install `bl`, change credentials/endpoint, or
|
||||
@@ -13,14 +13,14 @@ inspect config keys. Day-to-day command routing lives in the business skills
|
||||
|
||||
```bash
|
||||
npm install -g bailian-cli
|
||||
# Recommended: install the full bailian-* skill family (includes bailian-base)
|
||||
# Recommended: install the full bailian-* skill family (includes bailian-protocol)
|
||||
npx skills add modelstudioai/cli --all -g
|
||||
|
||||
# Subset install: always include companion bailian-base with any business skill
|
||||
# npx skills add modelstudioai/cli -g -s bailian-base -s bailian-gen
|
||||
# npx skills add modelstudioai/cli -g -s bailian-base -s bailian-finetune
|
||||
# npx skills add modelstudioai/cli -g -s bailian-base -s bailian-managed-agent
|
||||
# npx skills add modelstudioai/cli -g -s bailian-base -s bailian-cli
|
||||
# Subset install: always include companion bailian-protocol with any business skill
|
||||
# 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
|
||||
```
|
||||
|
||||
Verify: `bl --version` (prints `bl X.Y.Z`).
|
||||
+3
-3
@@ -1,13 +1,13 @@
|
||||
# Version alignment & auto-update (agent)
|
||||
|
||||
> Hand-maintained. Lives in `bailian-base/assets/` (not auto-generated from command metadata).
|
||||
> Hand-maintained. Lives in `bailian-protocol/assets/` (not auto-generated from command metadata).
|
||||
> Entry point: [SKILL.md → Version & updates](../SKILL.md#version--updates-after-provider-selection-before-the-first-bl-command).
|
||||
|
||||
## Agent pre-flight checklist (MANDATORY)
|
||||
|
||||
**Do NOT run any `bl` command until you complete this checklist.** Run it **once per session**, before the first `bl` command. Cache the result — do not re-check before every command.
|
||||
|
||||
1. Read `metadata.version` from the installed `bailian-base/SKILL.md` frontmatter (all `bailian-*` skills share the same version).
|
||||
1. Read `metadata.version` from the installed `bailian-protocol/SKILL.md` frontmatter (all `bailian-*` skills share the same version).
|
||||
2. Check the installed CLI version:
|
||||
```bash
|
||||
bl --version
|
||||
@@ -42,7 +42,7 @@ npm install -g bailian-cli
|
||||
npx skills add modelstudioai/cli --all -g
|
||||
```
|
||||
|
||||
If you only need one business skill, still install companion `bailian-base` with it (see [SKILL.md companion note](../SKILL.md)).
|
||||
If you only need one business skill, still install companion `bailian-protocol` with it (see [SKILL.md companion note](../SKILL.md)).
|
||||
|
||||
## Mention it in the task summary
|
||||
|
||||
@@ -64,7 +64,7 @@ export async function runCheck(options = {}) {
|
||||
...(channel
|
||||
? []
|
||||
: [
|
||||
"skills/bailian-base/SKILL.md",
|
||||
"skills/bailian-protocol/SKILL.md",
|
||||
"skills/bailian-cli/SKILL.md",
|
||||
"skills/bailian-gen/SKILL.md",
|
||||
"skills/bailian-finetune/SKILL.md",
|
||||
|
||||
Reference in New Issue
Block a user