Skip to content

Commit 8153900

Browse files
committed
Merge branch 'main' into feat/token-plan-default-models
2 parents 4c566fd + 1f91fa4 commit 8153900

27 files changed

Lines changed: 206 additions & 629 deletions

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ 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.10.0] - 2026-07-19
10+
11+
### Added
12+
13+
- **`bl config agent`** — configure Claude Code, Qwen Code, OpenCode, OpenClaw, Hermes Agent, or Codex to use DashScope in one command.
14+
15+
### Changed
16+
17+
- The Bailian CLI Skill now routes only matching Bailian and multimodal tasks to `bl`, and asks for consent before provider-neutral remote or billable calls.
18+
19+
### Fixed
20+
21+
- Full `bl auth logout` now clears the model Base URL so later logins cannot inherit a stale custom or Token Plan endpoint.
22+
923
## [1.9.0] - 2026-07-17
1024

1125
### Added

CHANGELOG.zh.md

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

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

9+
## [1.10.0] - 2026-07-19
10+
11+
### 新增
12+
13+
- **`bl config agent`** —— 一键配置 Claude Code、Qwen Code、OpenCode、OpenClaw、Hermes Agent 和 Codex 接入百炼模型服务。
14+
15+
### 变更
16+
17+
- 百炼 CLI Skill 现在只将匹配的百炼任务与多模态任务路由到 `bl`,并会在调用与平台无关的远程或计费能力前征求同意。
18+
19+
### 修复
20+
21+
- 完整执行 `bl auth logout` 时会同时清除模型 Base URL,避免后续登录继承失效的自定义或 Token Plan 接入地址。
22+
923
## [1.9.0] - 2026-07-17
1024

1125
### 新增

INSTALL.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ npx skills add modelstudioai/cli --all -g
6969

7070
> 此方式同时打通 `app list``usage free` 等控制台能力,并自动配置 API Key 调用所需的鉴权信息。
7171
72-
### 备选:由 Agent 引导用户输入 API Key 后登录
72+
### 备选一:由 Agent 引导用户输入普通 API Key 后登录
7373

7474
适用于无法拉起浏览器的对话式安装(远程 SSH、CI 调试、纯终端环境等):
7575

@@ -80,6 +80,15 @@ npx skills add modelstudioai/cli --all -g
8080
3. 用户提供了 Key 之后,在**用户本机终端**执行(Agent 用终端工具跑,勿把 Key 写进回复正文):`bl auth login --api-key <用户提供的_Key>`
8181
4. 登录成功后执行 `bl auth status --output json` 确认;汇报时只使用 masked 字段,**禁止**回显完整 Key。
8282

83+
### 备选二:使用 Token Plan API Key
84+
85+
- 获取入口:[Token Plan 订阅详情](https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview)
86+
87+
1. 请用户从订阅详情页获取或复制 Token Plan API Key,勿要求用户发到公开渠道。
88+
2. 在用户本机终端执行:`bl auth login --config token-plan --api-key <用户提供的_Key>`
89+
3. `token-plan` Profile 已内置默认 Base URL;登录命令会先测试 Key,通过后才保存并激活该 Profile,无需另行配置或重复测试。
90+
4. 执行 `bl auth status --config token-plan --output json` 确认;汇报时只使用 masked 字段。
91+
8392
### 其他方式
8493

8594
- **环境变量**(不落盘到配置文件):在 shell 中配置 API Key 环境变量;变量名见 `bl auth status --help`,勿在对话中向用户解释底层命名。
@@ -93,16 +102,15 @@ npx skills add modelstudioai/cli --all -g
93102

94103
---
95104

96-
## 4. 最小功能验证
105+
## 4. 配置验证
97106

98-
在鉴权配置完成后执行
107+
API Key 登录命令本身已经完成可用性测试,通过后只需确认配置状态
99108

100109
```bash
101110
bl auth status --output json
102-
bl text chat --message "ping" --non-interactive --output json
103111
```
104112

105-
若失败:根据 stderr / JSON 中的 `hint``message` 排查(网络、Key 无效、`base_url` 等)。DashScope 端点:使用 `--base-url` / `bl config set --key base_url` / `DASHSCOPE_BASE_URL`,默认中国大陆 `https://dashscope.aliyuncs.com`
113+
无需再执行重复的模型调用测试。若登录失败,根据 stderr / JSON 中的 `hint``message` 排查(网络、Key 无效、`base_url` 等)。DashScope 端点:使用 `--base-url` / `bl config set --key base_url` / `DASHSCOPE_BASE_URL`,默认中国大陆 `https://dashscope.aliyuncs.com`
106114

107115
---
108116

@@ -112,6 +120,6 @@ bl text chat --message "ping" --non-interactive --output json
112120
| ----------------------- | -------------------- | --------------------------------------------------------------- |
113121
| `bl: command not found` | 全局 bin 不在 PATH | 检查 `npm prefix -g` 与 PATH |
114122
| 安装报错 engines | Node 版本过低 | 升级到 ≥ 22.12 |
115-
| 401 / 鉴权失败 | 未 login 或 Key 无效 | 引导用户更新 Key `bl auth login --api-key` |
123+
| 401 / 鉴权失败 | 未 login 或 Key 无效 | Key 类型重新执行普通或 Token Plan 登录命令 |
116124
| 企业网络无法访问 npm | 代理 / 镜像 | 配置 registry 或代理后再装 |
117125
| 本机只有 pnpm、没有 npm | Agent 误用 pnpm 安装 | 先装/修好 **npm**,再用 `npm install -g bailian-cli`;勿用 pnpm |

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Equip your AI Agent out-of-the-box with these capabilities, composable across co
3030
- **Video generation & editing** — happyhorse-1.1 series: text-/image-/reference-to-video and natural-language video editing (up to 9-image reference)
3131
- **Speech synthesis & recognition** — CosyVoice streaming TTS, voice cloning from 5–20s samples; FunAudio-ASR covers 30 languages including 7 Chinese dialects and 20+ Mandarin accents
3232
- **Image & video understanding** — Qwen-VL: long-form video analysis, chart/document parsing, visual reasoning, multilingual OCR
33+
- **Coding agent setup** — Configure Claude Code, Qwen Code, OpenCode, OpenClaw, Hermes Agent, or Codex to use DashScope with `bl config agent`
3334

3435
> **Note:** The features below are currently available only to China site (aliyun.com) account holders and are not yet supported for international / global site accounts.
3536
@@ -91,6 +92,12 @@ bl auth login --console
9192
# Or authenticate with an API key
9293
bl auth login --api-key sk-xxxxx
9394

95+
# Or use Token Plan (Base URL built in; the key is tested during login)
96+
bl auth login --config token-plan --api-key sk-sp-xxxxx
97+
98+
# Configure a coding agent to use DashScope
99+
bl config agent --agent codex --base-url https://dashscope.aliyuncs.com/compatible-mode/v1 --api-key sk-xxxxx --model qwen3-coder-plus
100+
94101
# Chat with Qwen
95102
bl text chat --message "What is DashScope?"
96103

@@ -159,6 +166,15 @@ bl auth login --api-key sk-xxxxx
159166
bl text chat --api-key sk-xxxxx --message "Hello"
160167
```
161168

169+
### Token Plan API Key
170+
171+
Get or copy the API key from the [Token Plan subscription overview](https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview).
172+
The CLI has the default Token Plan Base URL built in. Login tests the key first, then saves and activates the `token-plan` config only when validation succeeds.
173+
174+
```bash
175+
bl auth login --config token-plan --api-key sk-sp-xxxxx
176+
```
177+
162178
### Console Login (OAuth)
163179

164180
Required for console capability commands (`model list`, `app list`, `usage summary/free/stats`, `workspace list`, `quota list/request/check/history`). Opens the Bailian console in your browser to sign in.
@@ -209,6 +225,7 @@ Config file location: `~/.bailian/config.json`
209225
| Qwen Model List | https://help.aliyun.com/zh/model-studio/getting-started/models |
210226
| Aliyun Model Studio Console | https://bailian.console.aliyun.com/?source_channel=cli_github |
211227
| Get API Key | https://bailian.console.aliyun.com/cn-beijing/?source_channel=key_github&tab=app#/api-key |
228+
| Get Token Plan API Key | https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview |
212229
| Get AccessKey | https://ram.console.aliyun.com/manage/ak |
213230

214231
## Changelog

README.zh.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_
3030
- **视频生成与编辑** — happyhorse-1.1 系列,支持文生 / 图生 / 参考生(最多 9 张图参考)/ 自然语言视频编辑
3131
- **语音合成与识别** — CosyVoice 实时流式合成,5-20s 样本即可克隆;FunAudio-ASR 覆盖 30 种语种,含汉语七大方言与 20+ 口音官话
3232
- **图像与视频理解** — Qwen-VL:长视频解析、复杂图表与文档识别、视觉推理、多语种 OCR
33+
- **Coding Agent 配置** — 使用 `bl config agent` 将 Claude Code、Qwen Code、OpenCode、OpenClaw、Hermes Agent 或 Codex 配置为使用 DashScope
3334

3435
> **注意:** 以下功能目前仅对中国站(aliyun.com)账号开放,国际站 / 全球站账号暂不支持。
3536
@@ -89,6 +90,12 @@ bl auth login --console
8990
# 或使用 API key 认证
9091
bl auth login --api-key sk-xxxxx
9192

93+
# 或使用 Token Plan(已内置 Base URL,登录时自动测试 Key)
94+
bl auth login --config token-plan --api-key sk-sp-xxxxx
95+
96+
# 配置 Coding Agent 使用 DashScope
97+
bl config agent --agent codex --base-url https://dashscope.aliyuncs.com/compatible-mode/v1 --api-key sk-xxxxx --model qwen3-coder-plus
98+
9299
# 和通义千问对话
93100
bl text chat --message "你好,介绍一下阿里云百炼平台"
94101

@@ -157,6 +164,15 @@ bl auth login --api-key sk-xxxxx
157164
bl text chat --api-key sk-xxxxx --message "你好"
158165
```
159166

167+
### Token Plan API Key
168+
169+
前往 [Token Plan 订阅详情](https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview) 获取或复制 API Key。
170+
CLI 已内置 Token Plan 的默认 Base URL;登录命令会先测试 Key,通过后才保存并激活 `token-plan` 配置。
171+
172+
```bash
173+
bl auth login --config token-plan --api-key sk-sp-xxxxx
174+
```
175+
160176
### 控制台登录(OAuth)
161177

162178
控制台能力命令(`model list``app list``usage summary/free/stats``workspace list``quota list/request/check/history`)需要使用此登录方式。打开浏览器跳转百炼控制台完成登录。
@@ -207,6 +223,7 @@ bl update
207223
| 通义千问模型列表 | https://help.aliyun.com/zh/model-studio/getting-started/models |
208224
| 阿里云百炼控制台 | https://bailian.console.aliyun.com/?source_channel=cli_github |
209225
| 获取 API Key | https://bailian.console.aliyun.com/cn-beijing/?source_channel=key_github&tab=app#/api-key |
226+
| 获取 Token Plan API Key | https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview |
210227
| 获取 AccessKey | https://ram.console.aliyun.com/manage/ak |
211228

212229
## 更新日志

docs/agents/auth-change.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ defineCommand({ auth }) → runtime/authStage → ctx.client → command.run(ctx
3838
- `bl auth login --open-api ...` 只更新 `access_key_id` / `access_key_secret`
3939
- `bl auth logout --console` 只清 `access_token`
4040
- `bl auth logout --open-api` 只清 `access_key_id` / `access_key_secret` / `security_token`
41-
- `bl auth logout``api_key` + `access_token` + `access_key_*`
41+
- `bl auth logout``api_key` + `base_url` + `access_token` + `access_key_*`
4242

4343
解析分工:
4444

docs/agents/cli-e2e-tests.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ describe.skipIf(<ready>)("e2e: <topic>(DashScope …)", () => {
8585

8686
## 安全与例外
8787

88-
- **禁止真实破坏性操作**`auth logout` 只用 `--dry-run``config set` 只用 `--dry-run`
88+
- **禁止破坏真实用户配置**`auth logout` 默认只用 `--dry-run`;需要验证实际落盘时,必须通过
89+
`BAILIAN_CONFIG_DIR` 指向隔离 fixture;`config set` 只用 `--dry-run`
8990
- **不加 dry-run**`dryRun``resolveFileUrl` / `resolveCredential` / 上传**之后**的命令(如 `image edit``speech recognize``--url`
9091
- **`--list-voices` 等旁路**:先于 `--text` 校验的 flag,缺参用例勿带该 flag
9192
- 新增 required option → 至少一条缺参用例;改 dry-run 输出 → 更新对应断言

docs/agents/url-change.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ runtime/src/urls.ts ← 用户面控制台 URL(cn-only)
1919
BAILIAN_CONSOLE_ROOT bailian.console.aliyun.com
2020
BAILIAN_CONSOLE BAILIAN_CONSOLE_ROOT/cn-beijing
2121
API_KEY_PAGE BAILIAN_CONSOLE/?tab=app#/api-key
22+
TOKEN_PLAN_PAGE BAILIAN_CONSOLE_ROOT/cn-beijing?tab=plan#/efm/subscription/overview
2223
2324
core/files/upload.ts ← 文件上传 endpoint(cn-pinned)
2425
UPLOAD_API ${REGIONS.cn}/api/v1/uploads

0 commit comments

Comments
 (0)