Skip to content

Commit 6683ff1

Browse files
committed
Merge branch 'main' into feat/mcp-command
2 parents 73d9d7e + 3b11a62 commit 6683ff1

39 files changed

Lines changed: 1311 additions & 726 deletions

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
concurrency:
9+
group: ci-${{ github.ref }}
10+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
11+
12+
jobs:
13+
check:
14+
name: lint + typecheck + test
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: pnpm/action-setup@v4
20+
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: "22"
24+
cache: pnpm
25+
26+
- run: pnpm install --frozen-lockfile
27+
28+
- run: pnpm -r --filter "./packages/*" build
29+
30+
- run: pnpm run check
31+
32+
- run: pnpm test

.github/workflows/release.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Release
2+
3+
# Consolidated workflow because npm Trusted Publishers only allows ONE
4+
# (repo, workflow, environment) tuple per package — so stable + channel
5+
# must share a single workflow file.
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
mode:
11+
description: "Release mode"
12+
required: true
13+
type: choice
14+
options:
15+
- stable
16+
- channel
17+
channel:
18+
description: "dist-tag for channel mode (kebab-case, e.g. mcp/plugin/advisor). Reserved: latest/beta/alpha/next/rc/canary/dev. Ignored when mode=stable."
19+
required: false
20+
type: string
21+
22+
# Serialize stable globally; serialize channel per dist-tag name.
23+
concurrency:
24+
group: release-${{ inputs.mode }}-${{ inputs.channel }}
25+
cancel-in-progress: false
26+
27+
jobs:
28+
publish-stable:
29+
if: inputs.mode == 'stable'
30+
name: publish stable to npm + tag
31+
runs-on: ubuntu-latest
32+
environment: production # Required Reviewers gate
33+
permissions:
34+
contents: write # push lightweight tag to origin
35+
id-token: write # OIDC for npm Trusted Publishing + provenance
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- uses: pnpm/action-setup@v4
40+
41+
- uses: actions/setup-node@v4
42+
with:
43+
node-version: "22"
44+
cache: pnpm
45+
registry-url: "https://registry.npmjs.org/"
46+
47+
- name: Install gitleaks
48+
run: |
49+
set -euo pipefail
50+
GITLEAKS_VERSION=8.21.2
51+
curl -sSfL \
52+
"https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" \
53+
| sudo tar -xz -C /usr/local/bin gitleaks
54+
gitleaks version
55+
56+
- run: pnpm install --frozen-lockfile
57+
58+
- name: publish-stable
59+
run: node tools/release/publish-stable.mjs
60+
61+
publish-channel:
62+
if: inputs.mode == 'channel'
63+
name: publish beta to npm
64+
runs-on: ubuntu-latest
65+
permissions:
66+
contents: read # no tag, no Release; just publish
67+
id-token: write # OIDC for npm Trusted Publishing + provenance
68+
steps:
69+
- uses: actions/checkout@v4
70+
71+
- uses: pnpm/action-setup@v4
72+
73+
- uses: actions/setup-node@v4
74+
with:
75+
node-version: "22"
76+
cache: pnpm
77+
registry-url: "https://registry.npmjs.org/"
78+
79+
- name: Install gitleaks
80+
run: |
81+
set -euo pipefail
82+
GITLEAKS_VERSION=8.21.2
83+
curl -sSfL \
84+
"https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" \
85+
| sudo tar -xz -C /usr/local/bin gitleaks
86+
gitleaks version
87+
88+
- run: pnpm install --frozen-lockfile
89+
90+
- name: publish-channel
91+
run: node tools/release/publish-channel.mjs --channel "${{ inputs.channel }}"

CHANGELOG.md

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

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

9+
## [1.1.3] - 2026-06-02
10+
11+
### Added
12+
13+
- `bl auth login --console` now also obtains and saves a DashScope API key when none is configured, so a single browser login covers both OAuth and API-key setup.
14+
15+
### Changed
16+
17+
- API-key validation is more resilient: retries on transient network / 401 / 5xx errors and caps each attempt at 30s.
18+
19+
## [1.1.2] - 2026-05-29
20+
21+
### Changed
22+
23+
- Default vision model upgraded from `qwen-vl` to `qwen3-vl-plus` for stronger visual reasoning and chart/document parsing.
24+
25+
### Fixed
26+
27+
- TypeScript / lint issues surfaced after the 1.1.0 open-source cut.
28+
929
## [1.1.1] - 2026-05-29
1030

1131
Documentation-only release. No CLI or SDK behavior changes.

CHANGELOG_CN.md

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

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

9+
## [1.1.3] - 2026-06-02
10+
11+
### 新增
12+
13+
- `bl auth login --console` 在未配置 DashScope API Key 时会自动获取并保存,一次浏览器登录即可完成 OAuth 与 API Key 配置。
14+
15+
### 变更
16+
17+
- API Key 校验更稳健:网络 / 401 / 5xx 等瞬时错误会自动重试,单次请求超时上限收紧为 30 秒。
18+
19+
## [1.1.2] - 2026-05-29
20+
21+
### 变更
22+
23+
- 默认视觉模型由 `qwen-vl` 升级为 `qwen3-vl-plus`,视觉推理与图表/文档解析能力更强。
24+
25+
### 修复
26+
27+
- 修复 1.1.0 开源切换后暴露的 TypeScript / lint 问题。
28+
929
## [1.1.1] - 2026-05-29
1030

1131
仅文档更新,CLI 与 SDK 行为无变化。

INSTALL.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,26 +59,32 @@ npx skills add modelstudioai/skills --all -g
5959

6060
## 3. 鉴权(安装后必做才能调 API)
6161

62-
用户需具备阿里云百炼 **API Key**
62+
### 推荐:浏览器登录(控制台会话)
6363

64-
- 获取入口:[百炼控制台 API Key](https://bailian.console.aliyun.com/cn-beijing/?tab=app#/api-key)
64+
适用于本机交互式安装,无需用户手动复制 API Key:
65+
66+
1. 执行 `bl auth status --output json`,判断是否已配置。
67+
2. 若未配置,在**用户本机终端**执行 `bl auth login --console`;命令会拉起浏览器完成阿里云控制台登录授权。
68+
3. 登录成功后执行 `bl auth status --output json` 确认;汇报时只使用 masked 字段,**禁止**回显完整凭据。
69+
70+
> 此方式同时打通 `app list``usage free` 等控制台能力,并自动配置 API Key 调用所需的鉴权信息。
6571
66-
### 推荐:由 Agent 引导用户输入后登录
72+
### 备选:由 Agent 引导用户输入 API Key 后登录
6773

68-
适用于对话式安装(Cursor、Claude 等):
74+
适用于无法拉起浏览器的对话式安装(远程 SSH、CI 调试、纯终端环境等):
75+
76+
- 获取入口:[百炼控制台 API Key](https://bailian.console.aliyun.com/cn-beijing/?tab=app#/api-key)
6977

7078
1. 执行 `bl auth status --output json`,判断是否已配置。
7179
2. 若未配置或后续 API 校验失败,**请用户粘贴 API Key**(可说明从上述控制台复制;勿要求用户发到公开渠道)。
7280
3. 用户提供了 Key 之后,在**用户本机终端**执行(Agent 用终端工具跑,勿把 Key 写进回复正文):`bl auth login --api-key <用户提供的_Key>`
73-
7481
4. 登录成功后执行 `bl auth status --output json` 确认;汇报时只使用 masked 字段,**禁止**回显完整 Key。
7582

7683
### 其他方式
7784

7885
- **环境变量**(不落盘到配置文件):在 shell 中配置 API Key 环境变量;变量名见 `bl auth status --help`,勿在对话中向用户解释底层命名。
7986
- **写入配置文件**(持久化,与 `auth login` 落盘相同):`bl config set --key api_key --value <key>``--key api-key` 亦可)。**不会**`bl auth login --api-key` 那样先校验 Key 是否可用;Agent 引导安装时仍**优先**`auth login`
8087
- **命令行临时传入**:需要 API Key 的 `bl` 子命令可在**当次**执行附加全局 `--api-key <key>`,仅本次生效、不落盘(例:`bl text chat --api-key sk-xxx --message "你好"`)。与上文持久化方式不是同一用途。
81-
- **浏览器登录(控制台会话)**`bl auth login --console`,用于 `app list``usage free` 等控制台能力;与 API Key 登录可并存,详见 `bl auth login --help`
8288

8389
### Agent 安全约束
8490

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ npx skills add modelstudioai/skills --all -g
7979
## Quick Start
8080

8181
```bash
82-
# Authenticate
82+
# Authenticate, recommended
83+
bl auth login --console
84+
85+
# Or authenticate with an API key
8386
bl auth login --api-key sk-xxxxx
8487

8588
# Chat with Qwen

README_CN.md

Lines changed: 11 additions & 11 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-
[阿里云百炼 CLI 官方主页](https://bailian.console.aliyun.com/cli) · [English](https://github.com/modelstudioai/cli/blob/main/README.md) · [API 文档](https://help.aliyun.com/zh/model-studio/) · [获取 API Key](https://bailian.console.aliyun.com/cn-beijing/?tab=app#/api-key)
12+
[阿里云百炼 CLI 官方主页](https://bailian.console.aliyun.com/cli?source_channel=cli_github&) · [English](https://github.com/modelstudioai/cli/blob/main/README.md) · [API 文档](https://help.aliyun.com/zh/model-studio/) · [获取 API Key](https://bailian.console.aliyun.com/cli?source_channel=key_github&)
1313

1414
---
1515

@@ -100,13 +100,13 @@ bl app list
100100
bl usage free --model qwen3-max
101101
```
102102

103-
> 更多案例与使用场景:[阿里云百炼 CLI 官方主页](https://bailian.console.aliyun.com/cli)
103+
> 更多案例与使用场景:[阿里云百炼 CLI 官方主页](https://bailian.console.aliyun.com/cli?source_channel=cli_github&)
104104
105105
## 认证方式
106106

107107
### DashScope API Key
108108

109-
大部分命令均需要 API Key。前往 [DashScope 控制台](https://bailian.console.aliyun.com/cn-beijing/?tab=app#/api-key) 获取。
109+
大部分命令均需要 API Key。前往 [DashScope 控制台](https://bailian.console.aliyun.com/cli?source_channel=key_github&) 获取。
110110

111111
```bash
112112
# 方式一:环境变量
@@ -158,14 +158,14 @@ bl update
158158

159159
## 相关链接
160160

161-
| 资源 | 地址 |
162-
| :---------------------- | :-------------------------------------------------------------- |
163-
| 阿里云百炼 CLI 官方主页 | https://bailian.console.aliyun.com/cli |
164-
| DashScope API 文档 | https://help.aliyun.com/zh/model-studio/ |
165-
| 通义千问模型列表 | https://help.aliyun.com/zh/model-studio/getting-started/models |
166-
| 阿里云百炼控制台 | https://bailian.console.aliyun.com/ |
167-
| 获取 API Key | https://bailian.console.aliyun.com/cn-beijing/?tab=app#/api-key |
168-
| 获取 AccessKey | https://ram.console.aliyun.com/manage/ak |
161+
| 资源 | 地址 |
162+
| :---------------------- | :---------------------------------------------------------------- |
163+
| 阿里云百炼 CLI 官方主页 | https://bailian.console.aliyun.com/cli?source_channel=cli_github& |
164+
| DashScope API 文档 | https://help.aliyun.com/zh/model-studio/ |
165+
| 通义千问模型列表 | https://help.aliyun.com/zh/model-studio/getting-started/models |
166+
| 阿里云百炼控制台 | https://bailian.console.aliyun.com/ |
167+
| 获取 API Key | https://bailian.console.aliyun.com/cli?source_channel=key_github& |
168+
| 获取 AccessKey | https://ram.console.aliyun.com/manage/ak |
169169

170170
## 更新日志
171171

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
"dev": "pnpm -F bailian-cli-core dev",
2020
"bl": "pnpm -F bailian-cli dev",
2121
"test": "vp test",
22-
"release:check": "node tools/release.mjs check",
23-
"release:publish": "node tools/release.mjs publish",
22+
"release:check": "node tools/release/check.mjs",
2423
"wiki:crawl": "node tools/wiki-crawler/index.mjs",
2524
"test:stress": "node packages/cli/tests/stress/run.mjs"
2625
},

packages/cli/README_CN.md

Lines changed: 11 additions & 11 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-
[阿里云百炼 CLI 官方主页](https://bailian.console.aliyun.com/cli) · [English](https://github.com/modelstudioai/cli/blob/main/README.md) · [API 文档](https://help.aliyun.com/zh/model-studio/) · [获取 API Key](https://bailian.console.aliyun.com/cn-beijing/?tab=app#/api-key)
12+
[阿里云百炼 CLI 官方主页](https://bailian.console.aliyun.com/cli?source_channel=cli_github&) · [English](https://github.com/modelstudioai/cli/blob/main/README.md) · [API 文档](https://help.aliyun.com/zh/model-studio/) · [获取 API Key](https://bailian.console.aliyun.com/cli?source_channel=key_github&)
1313

1414
---
1515

@@ -100,13 +100,13 @@ bl app list
100100
bl usage free --model qwen3-max
101101
```
102102

103-
> 更多案例与使用场景:[阿里云百炼 CLI 官方主页](https://bailian.console.aliyun.com/cli)
103+
> 更多案例与使用场景:[阿里云百炼 CLI 官方主页](https://bailian.console.aliyun.com/cli?source_channel=cli_github&)
104104
105105
## 认证方式
106106

107107
### DashScope API Key
108108

109-
大部分命令均需要 API Key。前往 [DashScope 控制台](https://bailian.console.aliyun.com/cn-beijing/?tab=app#/api-key) 获取。
109+
大部分命令均需要 API Key。前往 [DashScope 控制台](https://bailian.console.aliyun.com/cli?source_channel=key_github&) 获取。
110110

111111
```bash
112112
# 方式一:环境变量
@@ -158,14 +158,14 @@ bl update
158158

159159
## 相关链接
160160

161-
| 资源 | 地址 |
162-
| :---------------------- | :-------------------------------------------------------------- |
163-
| 阿里云百炼 CLI 官方主页 | https://bailian.console.aliyun.com/cli |
164-
| DashScope API 文档 | https://help.aliyun.com/zh/model-studio/ |
165-
| 通义千问模型列表 | https://help.aliyun.com/zh/model-studio/getting-started/models |
166-
| 阿里云百炼控制台 | https://bailian.console.aliyun.com/ |
167-
| 获取 API Key | https://bailian.console.aliyun.com/cn-beijing/?tab=app#/api-key |
168-
| 获取 AccessKey | https://ram.console.aliyun.com/manage/ak |
161+
| 资源 | 地址 |
162+
| :---------------------- | :---------------------------------------------------------------- |
163+
| 阿里云百炼 CLI 官方主页 | https://bailian.console.aliyun.com/cli?source_channel=cli_github& |
164+
| DashScope API 文档 | https://help.aliyun.com/zh/model-studio/ |
165+
| 通义千问模型列表 | https://help.aliyun.com/zh/model-studio/getting-started/models |
166+
| 阿里云百炼控制台 | https://bailian.console.aliyun.com/ |
167+
| 获取 API Key | https://bailian.console.aliyun.com/cli?source_channel=key_github& |
168+
| 获取 AccessKey | https://ram.console.aliyun.com/manage/ak |
169169

170170
## 更新日志
171171

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.1.1",
3+
"version": "1.1.3",
44
"description": "CLI for Aliyun Model Studio (DashScope) AI Platform.",
55
"keywords": [
66
"agent",

0 commit comments

Comments
 (0)