Skip to content

Commit 3909a17

Browse files
committed
Merge branch 'main' into feat/cli-skill-sync
2 parents 7461189 + 5ed15d3 commit 3909a17

46 files changed

Lines changed: 1548 additions & 739 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
66

77
[中文版](CHANGELOG.zh.md) · [README](README.md) · [Contributing](CONTRIBUTING.md)
88

9+
## [1.15.1] - 2026-08-17
10+
11+
### Added
12+
13+
- **Model permission management**`bl permission list` shows per-model inference / fine-tune / deploy grants; `bl permission grant` and `bl permission revoke` manage them, with `--all` to one-key grant inference for every model in the workspace (including future ones).
14+
15+
### Changed
16+
17+
- **`bl quota request` renamed to `bl quota update`** — set per-model QPM/TPM via `--rpm`/`--tpm` and clear custom limits with the new `--delete`; omitted fields keep their current values, and the old `quota request` path keeps working as an alias.
18+
- **`bl quota list` reworked** — now reads the model-limits API and shows per-model and workspace-level request/usage limits plus async queue/concurrency limits in a single table.
19+
- **`bl model list` no longer requires Console login** — the model catalog and `--enrich` parameter-schema endpoints are public.
20+
- **`bl skill init` output simplified** — per-skill status is now `success`/`failed` (previously `installed`) with an aggregate `success`/`partial`/`failed` result; the `publishedAt` and `agents` fields were removed.
21+
922
## [1.15.0] - 2026-08-14
1023

1124
### Added

CHANGELOG.zh.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@
66

77
[English](CHANGELOG.md) · [README](README.zh.md) · [参与贡献](CONTRIBUTING.zh.md)
88

9+
## [1.15.1] - 2026-08-17
10+
11+
### 新增
12+
13+
- **模型权限管理** —— `bl permission list` 查看各模型的推理 / 微调 / 部署授权;`bl permission grant``bl permission revoke` 负责授予和回收,支持 `--all` 一键为工作区全部模型(含后续新增模型)开启推理授权。
14+
15+
### 变更
16+
17+
- **`bl quota request` 更名为 `bl quota update`** —— 通过 `--rpm`/`--tpm` 设置单模型 QPM/TPM,新增 `--delete` 一键清除自定义限制;未指定的字段保持当前值,旧命令 `quota request` 仍作为别名可用。
18+
- **`bl quota list` 重构** —— 改从模型限制接口读取数据,单表展示模型级与工作区级的请求/用量限制及异步队列/并发限制。
19+
- **`bl model list` 不再需要控制台登录** —— 模型目录与 `--enrich` 参数结构端点均为公开接口。
20+
- **`bl skill init` 输出精简** —— 单技能状态改为 `success`/`failed`(原为 `installed`),新增 `success`/`partial`/`failed` 汇总结果;移除 `publishedAt``agents` 字段。
21+
922
## [1.15.0] - 2026-08-14
1023

1124
### 新增

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bailian-cli",
3-
"version": "1.14.3",
3+
"version": "1.15.1",
44
"description": "CLI for Aliyun Model Studio (DashScope) AI Platform.",
55
"keywords": [
66
"agent",

packages/cli/src/commands.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,12 @@ import {
5353
modelList,
5454
workspaceList,
5555
quotaList,
56-
quotaRequest,
56+
quotaUpdate,
5757
quotaHistory,
5858
quotaCheck,
59+
permissionList,
60+
permissionGrant,
61+
permissionRevoke,
5962
datasetUpload,
6063
datasetList,
6164
datasetGet,
@@ -178,9 +181,12 @@ export const commands: Record<string, AnyCommand> = {
178181
"model list": modelList,
179182
"workspace list": workspaceList,
180183
"quota list": quotaList,
181-
"quota request": quotaRequest,
184+
"quota update": quotaUpdate,
182185
"quota history": quotaHistory,
183186
"quota check": quotaCheck,
187+
"permission list": permissionList,
188+
"permission grant": permissionGrant,
189+
"permission revoke": permissionRevoke,
184190
"dataset upload": datasetUpload,
185191
"dataset list": datasetList,
186192
"dataset get": datasetGet,
@@ -243,3 +249,13 @@ export const commands: Record<string, AnyCommand> = {
243249
"managed-agent session events": managedAgentSessionEvents,
244250
"managed-agent skill-list": managedAgentSkillList,
245251
};
252+
253+
/**
254+
* Runtime-only aliases for renamed commands: dispatched by the CLI (merged in
255+
* main.ts) but kept out of the canonical map so generate-reference.ts only
256+
* documents the canonical path.
257+
*/
258+
export const commandAliases: Record<string, AnyCommand> = {
259+
// Pre-migration name of "quota update".
260+
"quota request": quotaUpdate,
261+
};

packages/cli/src/main.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createCli } from "bailian-cli-runtime";
2-
import { commands } from "./commands.ts";
2+
import { commandAliases, commands } from "./commands.ts";
33
import { commandPackPolicy } from "./command-pack-policy.ts";
44
import pkg from "../package.json" with { type: "json" };
55

@@ -10,11 +10,14 @@ const quickStartTasks = [
1010
"Help me analyze this video and write a Xiaohongshu-style post",
1111
] as const;
1212

13-
void createCli(commands, {
14-
binName: "bl",
15-
version: pkg.version,
16-
clientName: "bailian-cli",
17-
npmPackage: "bailian-cli",
18-
quickStartTasks,
19-
commandPacks: commandPackPolicy,
20-
}).run();
13+
void createCli(
14+
{ ...commands, ...commandAliases },
15+
{
16+
binName: "bl",
17+
version: pkg.version,
18+
clientName: "bailian-cli",
19+
npmPackage: "bailian-cli",
20+
quickStartTasks,
21+
commandPacks: commandPackPolicy,
22+
},
23+
).run();

packages/commands/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bailian-cli-commands",
3-
"version": "1.14.3",
3+
"version": "1.15.1",
44
"description": "Command library for bailian-cli products (knowledge, memory, media, …). See https://www.npmjs.com/package/bailian-cli for usage.",
55
"homepage": "https://bailian.console.aliyun.com/cli",
66
"bugs": {

packages/commands/src/commands/finetune/capability.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,28 @@
11
import {
22
defineCommand,
3-
fetchModelList,
3+
fetchModelListAll,
44
fetchModelCapability,
55
listSupportedTrainingTypes,
66
modelSupportsTrainingType,
77
isTrainingTypeCli,
88
trainingTypeMethodVariant,
99
TRAINING_TYPES_CLI,
10-
callConsoleGateway,
11-
effectiveConsoleGatewayConfig,
10+
anonymousConsoleCall,
1211
UsageError,
1312
type Settings,
1413
type ModelCapability,
1514
type FlagsDef,
1615
} from "bailian-cli-core";
1716
import { emitResult, emitBare } from "bailian-cli-runtime";
1817

19-
const PAGE_SIZE = 50;
20-
2118
/**
2219
* Page through every foundation-model page (listFoundationModels, public — no
2320
* console login needed, so the gateway is called anonymously). Returns raw
2421
* records so capability fields (`supports` / `trainingTypes`) are preserved
2522
* for filtering.
2623
*/
2724
async function fetchAllFoundationModels(settings: Settings): Promise<ModelCapability[]> {
28-
const eff = effectiveConsoleGatewayConfig(settings);
29-
const call = (api: string, data: Record<string, unknown>) =>
30-
callConsoleGateway(
31-
{ region: eff.consoleRegion, site: eff.consoleSite, switchAgent: eff.consoleSwitchAgent },
32-
settings.timeout,
33-
{ api, data },
34-
);
35-
const first = await fetchModelList(call, { pageNo: 1, pageSize: PAGE_SIZE });
36-
const all = [...first.models];
37-
const totalPages = Math.ceil(first.total / PAGE_SIZE);
38-
for (let pageNo = 2; pageNo <= totalPages; pageNo++) {
39-
const result = await fetchModelList(call, { pageNo, pageSize: PAGE_SIZE });
40-
all.push(...result.models);
41-
}
25+
const all = await fetchModelListAll(anonymousConsoleCall(settings));
4226
return all as ModelCapability[];
4327
}
4428

packages/commands/src/commands/model/list.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
anonymousConsoleCall,
23
defineCommand,
34
detectOutputFormat,
45
fetchModelDetail,
@@ -290,7 +291,7 @@ function printPredictConfigTable(entries: PredictConfigEntry[]): void {
290291

291292
export default defineCommand({
292293
description: "Browse model families or show detailed model info in the Bailian model marketplace",
293-
auth: "console",
294+
auth: "none",
294295
usageArgs:
295296
"[--model <model>] [--page <n>] [--page-size <n>] [--provider <p>] [--capability <c>] [--feature <f>] [--enrich]",
296297
flags: LIST_FLAGS,
@@ -302,10 +303,14 @@ export default defineCommand({
302303
"--model qwen-max --enrich --output json",
303304
"--feature function-calling --output json",
304305
],
306+
notes: [
307+
"Both the catalog and --enrich parameter-schema endpoints are public — no console login needed.",
308+
],
305309
async run(ctx) {
306310
const { settings, flags } = ctx;
307311
const format = settings.outputExplicit ? detectOutputFormat(settings.output) : "json";
308312
const modelKey = flags.model;
313+
const call = anonymousConsoleCall(settings);
309314

310315
// ── Detail mode ──
311316
if (modelKey) {
@@ -316,7 +321,7 @@ export default defineCommand({
316321
return;
317322
}
318323

319-
const detail = await fetchModelDetail(ctx.client.console.bind(ctx.client), modelKey);
324+
const detail = await fetchModelDetail(call, modelKey);
320325

321326
if (!detail) {
322327
emitBare(`Model "${modelKey}" not found.`);
@@ -328,10 +333,7 @@ export default defineCommand({
328333
await Promise.all(
329334
trunkItems.map(async (item) => {
330335
if (!item.model) return;
331-
const config = await fetchPredictConfig(
332-
ctx.client.console.bind(ctx.client),
333-
item.model,
334-
);
336+
const config = await fetchPredictConfig(call, item.model);
335337
if (config) item.predictConfig = config;
336338
}),
337339
);
@@ -361,7 +363,7 @@ export default defineCommand({
361363
return;
362364
}
363365

364-
const { total, groups } = await fetchModelGroups(ctx.client.console.bind(ctx.client), params);
366+
const { total, groups } = await fetchModelGroups(call, params);
365367

366368
if (format === "json") {
367369
emitResult(formatBrowseJson(groups, total), format);
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { defineCommand } from "bailian-cli-core";
2+
import { runPermissionChange, validatePermissionChange } from "./shared.ts";
3+
4+
export default defineCommand({
5+
description: "Grant model permissions (inference / finetune / deploy)",
6+
auth: "apiKey",
7+
usageArgs: "--model <models> [--action <actions>] | --all",
8+
flags: {
9+
model: {
10+
type: "string",
11+
valueHint: "<models>",
12+
description: "Model ID(s), comma-separated (max 20)",
13+
},
14+
action: {
15+
type: "string",
16+
valueHint: "<actions>",
17+
description:
18+
"Permission action(s), comma-separated: inference, finetune, deploy (default: inference)",
19+
},
20+
all: {
21+
type: "switch",
22+
description:
23+
"One-key grant inference for all models in the workspace (including future ones)",
24+
},
25+
},
26+
exampleArgs: [
27+
"--model qwen-plus",
28+
"--model qwen-plus,qwen3-max --action inference,finetune",
29+
"--all",
30+
"--model qwen-plus --dry-run --output json",
31+
],
32+
notes: [
33+
"Grants apply to the business workspace your API key belongs to.",
34+
"--all maps to the server one-key switch (access_all_entities: OPEN) and only covers inference.",
35+
"Actions you omit keep their current grants (server-side tri-state patch).",
36+
],
37+
validate: (flags) => validatePermissionChange(flags),
38+
async run(ctx) {
39+
await runPermissionChange(ctx, ctx.flags, true);
40+
},
41+
});

0 commit comments

Comments
 (0)