Skip to content

Commit 4e0d2f3

Browse files
committed
merge: merge main branch into feat/plugin
2 parents 04c4bca + efa624d commit 4e0d2f3

104 files changed

Lines changed: 5819 additions & 173 deletions

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525

2626
- run: pnpm install --frozen-lockfile
2727

28+
- run: pnpm run sync:skill-assets
29+
2830
- run: pnpm -r --filter "./packages/*" build
2931

3032
- run: pnpm run check

.vite-hooks/pre-commit

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1+
#!/usr/bin/env sh
2+
set -eu
3+
4+
# Regenerate skill reference + SKILL metadata (needs bailian-cli-core dist).
5+
pnpm run sync:skill-assets
6+
7+
# Stage generator output so it is included in this commit.
8+
git add skills/bailian-cli/reference skills/bailian-cli/SKILL.md
9+
110
vp staged

AGENTS.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ packages/cli/
2525
└── tests/e2e/
2626
```
2727

28-
Skill / 命令手册不再随 npm 包发布,改由独立的 `npx add skills` 机制安装`tools/generate-reference.ts` 仍然从 `catalog.ts` 生成命令手册到 `tools/generated/reference/`(gitignore,临时),等新机制接入后再迁走
28+
Skill / 命令手册随 `skills/bailian-cli/` `npx skills add modelstudioai/cli` 安装`tools/generate-reference.ts` `catalog.ts` 生成命令手册到 `skills/bailian-cli/reference/`(纳入 git);与 `tools/sync-skill-metadata.ts` 一起在 **pre-commit**`.vite-hooks/pre-commit`)及根脚本 `pnpm run sync:skill-assets` 中执行
2929

3030
非代码资产:
3131

3232
- `tools/release/` — 发版自动化(CI 驱动,见 `.github/workflows/publish.yml`
33-
- `tools/generate-reference.ts` — 从 `catalog.ts` 生成命令手册(临时输出到 `tools/generated/reference/`)
34-
- `README.md` / `README_CN.md` — npm 和 GitHub 主页
33+
- `tools/generate-reference.ts` — 从 `catalog.ts` 生成命令手册到 `skills/bailian-cli/reference/`
34+
- `tools/sync-skill-metadata.ts` — 从 `packages/cli/package.json` 同步 `skills/bailian-cli/SKILL.md``metadata.version`(与 `generate:reference` 一并由根目录 `pnpm run sync:skill-assets` 及 pre-commit 执行)
35+
- `README.md` / `README.zh.md` — npm 和 GitHub 主页
3536

3637
约定:
3738

CHANGELOG.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,44 @@ All notable changes to `bailian-cli` and `bailian-cli-core` are documented here.
44

55
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.
66

7-
[中文版](CHANGELOG_CN.md) · [README](README.md) · [Contributing](CONTRIBUTING.md)
7+
[中文版](CHANGELOG.zh.md) · [README](README.md) · [Contributing](CONTRIBUTING.md)
8+
9+
## [1.2.1] - 2026-06-09
10+
11+
### Changed
12+
13+
- Skill install command updated from `npx skills add modelstudioai/skills` to `npx skills add modelstudioai/cli --all -g` across all READMEs and docs.
14+
- `bl update` now automatically updates the `bailian-cli` agent skill after CLI upgrade.
15+
- Renamed `README_CN.md` to `README.zh.md` (ISO 639 convention) across the entire repo.
16+
17+
### Added
18+
19+
- Official skill (`skills/bailian-cli/`) now ships in this repository with pre-commit auto-generation of reference docs and SKILL.md version sync.
20+
- Bilingual READMEs (EN + CN) for the `bailian-cli` skill.
21+
22+
## [1.2.0] - 2026-06-05
23+
24+
### Added
25+
26+
- `bl mcp` command group: `bl mcp list` to list MCP servers, `bl mcp tools <server>` to inspect available tools, and `bl mcp call <server>.<tool>` to invoke a tool with `--arg k=v` or `--json`.
27+
- `bl advisor recommend` — describe your task in natural language and get intelligent model recommendations ranked by fit, with context-window, pricing, and capability details.
28+
29+
### Fixed
30+
31+
- Image/video watermark was always on regardless of config; now respects `bl config set watermark false`.
32+
- Paired flags (e.g. `--watermark` / `--no-watermark`) are properly mutually exclusive.
33+
- Null-value flag validation no longer crashes on missing optional arguments.
34+
- **Security**: credentials no longer leak to on-disk logs; file permissions tightened.
35+
- **Security**: `base_url` / `console_gateway_url` validated as real HTTP(S) URLs.
36+
- **Security**: script/JS `code` fields require a string literal (blocks untrusted-code RCE).
37+
- **Security**: URL path segments are percent-encoded; SSE buffer is bounded.
38+
- **Security**: pipeline planning, pointer traversal, and concurrency hardened.
39+
- MCP commands now handle auth _after_ arg validation and dry-run checks.
40+
41+
### Changed
42+
43+
- Flag default-value text is now unified and de-duplicated across all commands.
44+
- Illegal/unknown flag names surface a clear error instead of silently ignoring.
845

946
## [1.1.3] - 2026-06-02
1047

CHANGELOG_CN.md renamed to CHANGELOG.zh.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,44 @@
44

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

7-
[English](CHANGELOG.md) · [README](README_CN.md) · [参与贡献](CONTRIBUTING_CN.md)
7+
[English](CHANGELOG.md) · [README](README.zh.md) · [参与贡献](CONTRIBUTING.zh.md)
8+
9+
## [1.2.1] - 2026-06-09
10+
11+
### 变更
12+
13+
- Skill 安装命令从 `npx skills add modelstudioai/skills` 更新为 `npx skills add modelstudioai/cli --all -g`,所有 README 和文档已同步。
14+
- `bl update` 现在会在 CLI 升级后自动更新 `bailian-cli` agent skill。
15+
- 全仓库 `README_CN.md` 统一重命名为 `README.zh.md`(ISO 639 命名规范)。
16+
17+
### 新增
18+
19+
- 官方 skill(`skills/bailian-cli/`)迁入本仓库,pre-commit 自动生成 reference 文档并同步 SKILL.md 版本号。
20+
- `bailian-cli` skill 新增中英文双语 README。
21+
22+
## [1.2.0] - 2026-06-05
23+
24+
### 新增
25+
26+
- `bl mcp` 命令组:`bl mcp list` 列出 MCP 服务器,`bl mcp tools <server>` 查看可用工具,`bl mcp call <server>.<tool>` 通过 `--arg k=v``--json` 调用工具。
27+
- `bl advisor recommend` — 用自然语言描述任务需求,智能推荐最合适的模型,展示上下文窗口、定价及能力详情。
28+
29+
### 修复
30+
31+
- 图片/视频水印始终开启的问题,现在正确遵守 `bl config set watermark false` 配置。
32+
- 成对 flag(如 `--watermark` / `--no-watermark`)现已正确互斥。
33+
- 可选参数为空时 flag 校验不再崩溃。
34+
- **安全**:凭据不再泄漏到磁盘日志,文件权限已收紧。
35+
- **安全**:校验 `base_url` / `console_gateway_url` 为合法 HTTP(S) URL。
36+
- **安全**:script/JS `code` 字段强制为字符串字面量(阻止不可信代码 RCE)。
37+
- **安全**:URL 路径段已百分号编码,SSE 缓冲区设上限。
38+
- **安全**:流水线规划、指针遍历及并发安全加固。
39+
- MCP 命令现在在参数校验和 dry-run 检查之后才处理鉴权。
40+
41+
### 变更
42+
43+
- 所有命令的 flag 默认值文案统一并去重。
44+
- 非法/未知 flag 名称现在会报明确错误,而非静默忽略。
845

946
## [1.1.3] - 2026-06-02
1047

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Developer guide for `bailian-cli` — the official CLI for Aliyun Model Studio (DashScope). For end-user usage, see [README.md](README.md).
44

5-
[中文版](CONTRIBUTING_CN.md) · [README](README.md) · [Changelog](CHANGELOG.md)
5+
[中文版](CONTRIBUTING.zh.md) · [README](README.md) · [Changelog](CHANGELOG.md)
66

77
## Prerequisites
88

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# 参与贡献 bailian-cli
22

3-
`bailian-cli` 是阿里云百炼(DashScope)的官方 CLI。本文是面向**开发者**的指南;终端用户请看 [README_CN.md](README_CN.md)
3+
`bailian-cli` 是阿里云百炼(DashScope)的官方 CLI。本文是面向**开发者**的指南;终端用户请看 [README.zh.md](README.zh.md)
44

5-
[English](CONTRIBUTING.md) · [README](README_CN.md) · [更新日志](CHANGELOG_CN.md)
5+
[English](CONTRIBUTING.md) · [README](README.zh.md) · [更新日志](CHANGELOG.zh.md)
66

77
## 环境要求
88

INSTALL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ which bl # Windows 可用 where bl
5050
CLI 校验通过后,在本机终端执行:
5151

5252
```bash
53-
npx skills add modelstudioai/skills --all -g
53+
npx skills add modelstudioai/cli --all -g
5454
```
5555

56-
完整说明见 [百炼Skills](https://github.com/modelstudioai/skills)安装成功后,用中文简要说明已安装的 skills 及用户可做什么。
56+
安装成功后,用中文简要说明已安装的 skills 及用户可做什么。
5757

5858
---
5959

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178c6)](https://www.typescriptlang.org)
1010
[![License](https://img.shields.io/badge/license-Apache%202.0-blue)](LICENSE)
1111

12-
[Aliyun Model Studio CLI Site](https://bailian.console.aliyun.com/cli?source_channel=cli_github&) · [中文文档](https://github.com/modelstudioai/cli/blob/main/README_CN.md) · [API Documentation](https://help.aliyun.com/zh/model-studio/) · [Get API Key](https://bailian.console.aliyun.com/cli?source_channel=key_github&)
12+
[Aliyun Model Studio CLI Site](https://bailian.console.aliyun.com/cli?source_channel=cli_github&) · [中文文档](https://github.com/modelstudioai/cli/blob/main/README.zh.md) · [API Documentation](https://help.aliyun.com/zh/model-studio/) · [Get API Key](https://bailian.console.aliyun.com/cli?source_channel=key_github&)
1313

1414
---
1515

@@ -32,7 +32,9 @@ Equip your AI Agent out-of-the-box with these capabilities, composable across co
3232
- **Image & video understanding** — Qwen-VL: long-form video analysis, chart/document parsing, visual reasoning, multilingual OCR
3333
- **Knowledge base & memory** — Multimodal RAG retrieval and cross-session memory for personalized, coherent dialogue
3434
- **App calls** — Invoke agents and workflows already published on Aliyun Model Studio
35+
- **MCP integration** — Orchestrate Bailian MCP servers: list services, inspect tools, and invoke any tool directly from the terminal
3536
- **Web search** — Real-time internet retrieval for up-to-date, accurate answers
37+
- **Model recommendation** — Describe your scenario and get best-fit model suggestions; supports scoped search, model comparison, and alternative discovery
3638
- **Console capabilities** — Browse Bailian apps (`app list`) and check free-tier quota (`usage free`)
3739
- **Local file auto-upload** — Every URL parameter accepts a local path; uploaded to free temp storage with 48-hour validity
3840

@@ -71,7 +73,7 @@ No timeline scrubbing. No frame-by-frame editing. Just one sentence → one vide
7173

7274
```bash
7375
npm install -g bailian-cli
74-
npx skills add modelstudioai/skills --all -g
76+
npx skills add modelstudioai/cli --all -g
7577
```
7678

7779
> Requires Node.js >= 22.12.
@@ -97,6 +99,12 @@ bl image generate --prompt "A cat in a spacesuit" --out-dir ./images/
9799
# Generate a video from local image
98100
bl video generate --image ./cat.png --prompt "Make the cat move" --download cat.mp4
99101

102+
# Model recommendation — find the best model for your use case
103+
bl advisor recommend --message "I need a visual-understanding chatbot"
104+
105+
# Compare specific models
106+
bl advisor recommend --message "qwen-max vs deepseek-v3 for code generation"
107+
100108
# Browser login (required for console capability commands)
101109
bl auth login --console
102110

README_CN.md renamed to README.zh.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_
3232
- **图像与视频理解** — Qwen-VL:长视频解析、复杂图表与文档识别、视觉推理、多语种 OCR
3333
- **知识库与记忆库** — 多模态 RAG 检索 + 跨会话记忆,提供个性化连贯对话体验
3434
- **应用调用** — 调用已发布在阿里云百炼平台上的智能体与工作流应用
35+
- **MCP 集成** — 统一调度百炼 MCP 服务:列出服务、查看工具、直接在终端调用任意工具
3536
- **联网搜索** — 实时互联网信息检索,提升回答准确性及时效性
37+
- **模型推荐** — 描述你的场景,智能推荐最适合的模型;支持限定范围搜索、模型对比和替代发现
3638
- **控制台能力** — 浏览百炼应用(`app list`),查询模型免费额度(`usage free`
3739
- **本地文件自动上传** — 所有 URL 参数同时支持本地路径,免费临时存储 48 小时
3840

@@ -69,7 +71,7 @@ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_
6971

7072
```bash
7173
npm install -g bailian-cli
72-
npx skills add modelstudioai/skills --all -g
74+
npx skills add modelstudioai/cli --all -g
7375
```
7476

7577
> 需要预先安装 Node.js >= 22.12。
@@ -92,6 +94,12 @@ bl image generate --prompt "一只穿太空服的猫在火星上" --out-dir ./im
9294
# 图生视频(本地文件自动上传)
9395
bl video generate --image ./cat.png --prompt "让画面中的猫动起来" --download cat.mp4
9496

97+
# 模型推荐 — 根据场景推荐最适合的模型
98+
bl advisor recommend --message "我要做一个能理解图片的客服机器人"
99+
100+
# 对比特定模型
101+
bl advisor recommend --message "qwen-max 和 deepseek-v3 哪个更适合做代码生成"
102+
95103
# 浏览器登录(控制台能力相关命令需要)
96104
bl auth login --console
97105

@@ -169,8 +177,8 @@ bl update
169177

170178
## 更新日志
171179

172-
每个版本的变更详情记录在 [CHANGELOG_CN.md](https://github.com/modelstudioai/cli/blob/main/CHANGELOG_CN.md)
180+
每个版本的变更详情记录在 [CHANGELOG.zh.md](https://github.com/modelstudioai/cli/blob/main/CHANGELOG.zh.md)
173181

174182
## 参与贡献
175183

176-
欢迎提 Issue、Feature Request 和 PR。开发环境搭建、仓库结构、新增/修改命令的工作流请见 [CONTRIBUTING_CN.md](https://github.com/modelstudioai/cli/blob/main/CONTRIBUTING_CN.md)
184+
欢迎提 Issue、Feature Request 和 PR。开发环境搭建、仓库结构、新增/修改命令的工作流请见 [CONTRIBUTING.zh.md](https://github.com/modelstudioai/cli/blob/main/CONTRIBUTING.zh.md)

0 commit comments

Comments
 (0)