Skip to content

Commit f597b94

Browse files
Merge pull request #83 from modelstudioai/feat/composable-cli
Release 1.5.0: finetune / deploy / dataset / token-plan + composable CLI
2 parents 07875c3 + 750641d commit f597b94

194 files changed

Lines changed: 2221 additions & 1430 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.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ node_modules
1212
dist
1313
dist-ssr
1414
tools/generated
15+
.node-version
1516

1617
*.local
1718

CHANGELOG.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,29 @@
22

33
All notable changes to `bailian-cli` and `bailian-cli-core` are documented here.
44

5-
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). The two packages share a single version number — they are always released together.
5+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). The `bailian-cli`, `bailian-cli-core`, `bailian-cli-runtime`, and `bailian-cli-commands` packages share a single version number — they are always released together.
66

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

9+
## [1.5.0] - 2026-07-01
10+
11+
### Added
12+
13+
- Model fine-tuning — `bl finetune`: create, list, get, watch, and cancel jobs; fetch training logs; list checkpoints; export a checkpoint as a deployable model; and query training capability (by model or by training type). Supports `sft`, `sft-lora`, `dpo`, `dpo-lora`, and `cpt` training types.
14+
- Model deployment — `bl deploy`: create, list, get, update (rate limits), scale, and delete deployments; list deployable models and plans.
15+
- Dataset management — `bl dataset`: upload, list, get, and delete dataset files, plus `bl dataset validate` to check a local `.jsonl` before uploading (ChatML / DPO / CPT formats).
16+
- Token Plan management — `bl token-plan`: list subscription seats, add members, batch-assign seats, and create a per-seat API key.
17+
- Automatic update check: after a command finishes, the CLI checks npm for a newer release (throttled) and shows an `Update available` hint; a major stable-version gap upgrades itself automatically. Skipped with `--quiet` or when running `bl update`.
18+
- Composable packages: `bailian-cli-runtime` (CLI framework) and `bailian-cli-commands` (command library) are now published alongside `bailian-cli-core`, and a new sibling CLI `knowledge-studio-cli` (`kscli`) ships on top of them. `bl` behavior is unchanged.
19+
20+
### Removed
21+
22+
- `bl config export-schema` (exported CLI commands as Anthropic/OpenAI-compatible JSON tool schemas) has been removed.
23+
24+
### Fixed
25+
26+
- Console gateway commands (`bl console call`, etc.) now surface a readable message when the gateway returns a non-string `errorCode`, instead of `[object Object]`.
27+
928
## [1.4.2] - 2026-06-24
1029

1130
### Added

CHANGELOG.zh.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,29 @@
22

33
`bailian-cli``bailian-cli-core` 的所有重要变更都记录在此。
44

5-
格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/spec/v2.0.0.html)两个包共享一个版本号,总是一起发布。
5+
格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/spec/v2.0.0.html)`bailian-cli``bailian-cli-core``bailian-cli-runtime``bailian-cli-commands` 共享一个版本号,总是一起发布。
66

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

9+
## [1.5.0] - 2026-07-01
10+
11+
### 新增
12+
13+
- 模型精调 —— `bl finetune`:创建、列出、查询、观察、取消训练任务;拉取训练日志;列出 checkpoint;将 checkpoint 导出为可部署模型;查询训练能力(按模型或按训练类型)。支持 `sft``sft-lora``dpo``dpo-lora``cpt` 训练类型。
14+
- 模型部署 —— `bl deploy`:创建、列出、查询、更新(限流)、扩缩容、删除部署;列出可部署模型与套餐。
15+
- 数据集管理 —— `bl dataset`:上传、列出、查询、删除数据集文件,并新增 `bl dataset validate` 在上传前本地校验 `.jsonl`(ChatML / DPO / CPT 格式)。
16+
- Token Plan 管理 —— `bl token-plan`:列出订阅座位、添加成员、批量分配座位、为座位创建 API Key。
17+
- 自动更新检查:命令执行完成后,CLI 会(节流地)检查 npm 上是否有新版本并提示 `Update available`;若与稳定版存在大版本差距则自动升级。`--quiet` 或执行 `bl update` 时跳过。
18+
- 可组合包:`bailian-cli-runtime`(CLI 框架)与 `bailian-cli-commands`(命令库)现在与 `bailian-cli-core` 一起发布,并在其之上新增了同家族 CLI `knowledge-studio-cli`(`kscli`)。`bl` 行为保持不变。
19+
20+
### 已移除
21+
22+
- 移除 `bl config export-schema` 命令(原用于把 CLI 命令导出为 Anthropic/OpenAI 兼容的 JSON tool schema)。
23+
24+
### 修复
25+
26+
- 控制台网关类命令(`bl console call` 等)在网关返回非字符串 `errorCode` 时,现在会给出可读的错误信息,而不是 `[object Object]`
27+
928
## [1.4.2] - 2026-06-24
1029

1130
### 新增

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
"ready": "vp check && vp run -r test && vp run -r build",
1717
"prepare": "vp config",
1818
"check": "vp check",
19-
"sync:skill-assets": "pnpm --filter bailian-cli-core run build && pnpm --filter bailian-cli run generate:reference && pnpm --filter bailian-cli run sync:skill-version",
19+
"sync:skill-assets": "pnpm --filter \"bailian-cli^...\" run build && pnpm --filter bailian-cli run generate:reference && pnpm --filter bailian-cli run sync:skill-version",
2020
"dev": "pnpm -F bailian-cli-core dev",
2121
"bl": "pnpm -F bailian-cli dev",
22+
"kscli": "pnpm -F knowledge-studio-cli dev",
2223
"test": "vp test",
2324
"release:check": "node tools/release/check.mjs",
2425
"wiki:crawl": "node tools/wiki-crawler/index.mjs",

packages/cli/package.json

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bailian-cli",
3-
"version": "1.4.2",
3+
"version": "1.5.0",
44
"description": "CLI for Aliyun Model Studio (DashScope) AI Platform.",
55
"keywords": [
66
"agent",
@@ -33,6 +33,10 @@
3333
"./package.json": "./package.json"
3434
},
3535
"publishConfig": {
36+
"exports": {
37+
".": "./dist/bailian.mjs",
38+
"./package.json": "./package.json"
39+
},
3640
"registry": "https://registry.npmjs.org/"
3741
},
3842
"scripts": {
@@ -44,32 +48,23 @@
4448
"check": "vp check"
4549
},
4650
"dependencies": {
51+
"bailian-cli-commands": "workspace:*",
4752
"bailian-cli-core": "workspace:*",
48-
"boxen": "catalog:",
49-
"chalk": "catalog:",
50-
"undici": "catalog:"
53+
"bailian-cli-runtime": "workspace:*"
5154
},
5255
"devDependencies": {
5356
"@clack/prompts": "^0.7.0",
5457
"@types/node": "catalog:",
5558
"@typescript/native-preview": "7.0.0-dev.20260328.1",
5659
"ajv": "catalog:",
60+
"boxen": "catalog:",
61+
"chalk": "catalog:",
5762
"typescript": "^6.0.2",
58-
"vite-plus": "catalog:",
63+
"undici": "catalog:",
64+
"vite-plus": "0.1.22",
5965
"yaml": "catalog:"
6066
},
6167
"engines": {
6268
"node": ">=22.12.0"
63-
},
64-
"inlinedDependencies": {
65-
"@clack/core": "0.3.5",
66-
"@clack/prompts": "0.7.0",
67-
"ajv": "8.20.0",
68-
"fast-deep-equal": "3.1.3",
69-
"fast-uri": "3.1.2",
70-
"json-schema-traverse": "1.0.0",
71-
"picocolors": "1.1.1",
72-
"sisteransi": "1.0.5",
73-
"yaml": "2.8.3"
7469
}
7570
}

packages/cli/src/commands.ts

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
import type { Command } from "bailian-cli-core";
2+
import {
3+
authLogin,
4+
authStatus,
5+
authLogout,
6+
textChat,
7+
textOmni,
8+
imageGenerate,
9+
imageEdit,
10+
videoGenerate,
11+
videoEdit,
12+
videoRef,
13+
videoTaskGet,
14+
videoDownload,
15+
visionDescribe,
16+
configShow,
17+
configSet,
18+
update,
19+
appCall,
20+
appList,
21+
memoryAdd,
22+
memorySearch,
23+
memoryList,
24+
memoryUpdate,
25+
memoryDelete,
26+
memoryProfileCreate,
27+
memoryProfileGet,
28+
knowledgeRetrieve,
29+
mcpCall,
30+
mcpList,
31+
mcpTools,
32+
searchWeb,
33+
speechSynthesize,
34+
speechRecognize,
35+
fileUpload,
36+
consoleCall,
37+
usageFree,
38+
usageFreetier,
39+
usageStats,
40+
pipelineRun,
41+
pipelineValidate,
42+
advisorRecommend,
43+
workspaceList,
44+
quotaList,
45+
quotaRequest,
46+
quotaHistory,
47+
quotaCheck,
48+
datasetUpload,
49+
datasetList,
50+
datasetGet,
51+
datasetDelete,
52+
datasetValidate,
53+
finetuneCreate,
54+
finetuneList,
55+
finetuneGet,
56+
finetuneCancel,
57+
finetuneDelete,
58+
finetuneLogs,
59+
finetuneCheckpoints,
60+
finetuneExport,
61+
finetuneWatch,
62+
finetuneCapability,
63+
deployCreate,
64+
deployList,
65+
deployGet,
66+
deployModels,
67+
deployScale,
68+
deployUpdate,
69+
deployDelete,
70+
tokenPlanListSeats,
71+
tokenPlanCreateKey,
72+
tokenPlanAssignSeats,
73+
tokenPlanAddMember,
74+
} from "bailian-cli-commands";
75+
76+
// Full bailian-cli product: every command, exposed under the `bl` binary.
77+
// The command paths below are this product's decision — the command library
78+
// ships no presets, so the map is spelled out here. Kept in its own module
79+
// (no side effects) so tools like generate-reference.ts can import it without
80+
// starting the CLI.
81+
export const commands: Record<string, Command> = {
82+
"auth login": authLogin,
83+
"auth status": authStatus,
84+
"auth logout": authLogout,
85+
"text chat": textChat,
86+
omni: textOmni,
87+
"image generate": imageGenerate,
88+
"image edit": imageEdit,
89+
"video generate": videoGenerate,
90+
"video edit": videoEdit,
91+
"video ref": videoRef,
92+
"video task get": videoTaskGet,
93+
"video download": videoDownload,
94+
"vision describe": visionDescribe,
95+
"config show": configShow,
96+
"config set": configSet,
97+
update,
98+
"app call": appCall,
99+
"app list": appList,
100+
"memory add": memoryAdd,
101+
"memory search": memorySearch,
102+
"memory list": memoryList,
103+
"memory update": memoryUpdate,
104+
"memory delete": memoryDelete,
105+
"memory profile create": memoryProfileCreate,
106+
"memory profile get": memoryProfileGet,
107+
"knowledge retrieve": knowledgeRetrieve,
108+
"mcp call": mcpCall,
109+
"mcp list": mcpList,
110+
"mcp tools": mcpTools,
111+
"search web": searchWeb,
112+
"speech synthesize": speechSynthesize,
113+
"speech recognize": speechRecognize,
114+
"file upload": fileUpload,
115+
"console call": consoleCall,
116+
"usage free": usageFree,
117+
"usage freetier": usageFreetier,
118+
"usage stats": usageStats,
119+
"pipeline run": pipelineRun,
120+
"pipeline validate": pipelineValidate,
121+
"advisor recommend": advisorRecommend,
122+
"workspace list": workspaceList,
123+
"quota list": quotaList,
124+
"quota request": quotaRequest,
125+
"quota history": quotaHistory,
126+
"quota check": quotaCheck,
127+
"dataset upload": datasetUpload,
128+
"dataset list": datasetList,
129+
"dataset get": datasetGet,
130+
"dataset delete": datasetDelete,
131+
"dataset validate": datasetValidate,
132+
"finetune create": finetuneCreate,
133+
"finetune list": finetuneList,
134+
"finetune get": finetuneGet,
135+
"finetune cancel": finetuneCancel,
136+
"finetune delete": finetuneDelete,
137+
"finetune logs": finetuneLogs,
138+
"finetune checkpoints": finetuneCheckpoints,
139+
"finetune export": finetuneExport,
140+
"finetune watch": finetuneWatch,
141+
"finetune capability": finetuneCapability,
142+
"deploy create": deployCreate,
143+
"deploy list": deployList,
144+
"deploy get": deployGet,
145+
"deploy models": deployModels,
146+
"deploy scale": deployScale,
147+
"deploy update": deployUpdate,
148+
"deploy delete": deployDelete,
149+
"token-plan list-seats": tokenPlanListSeats,
150+
"token-plan create-key": tokenPlanCreateKey,
151+
"token-plan assign-seats": tokenPlanAssignSeats,
152+
"token-plan add-member": tokenPlanAddMember,
153+
};

0 commit comments

Comments
 (0)