Skip to content

Commit 00b4d09

Browse files
committed
refactor(cli): rename bootstrap command to workspace init
- 将原有的 `bl bootstrap` 命令重命名为 `bl workspace init` - 更新相关文档,包括中文和英文变更日志 - 修改命令导出和引用,调整文件与变量命名对应新命令 - 保持初始化 Bailian 工作空间及开通后付费服务功能不变 - 删除旧的 `bl bootstrap` 文档,新增 `bl workspace init` 命令帮助文档 - 更新 CLI 命令索引,替换旧命令为新命令 - 优化命令实现细节,增强代码规范和异常处理一致性
1 parent 92719a1 commit 00b4d09

8 files changed

Lines changed: 36 additions & 50 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
1111
### Added
1212

1313
- **CLI access-token automation** — added `bl auth generate-access-token`; OpenAPI login can obtain and persist a Console access token, and Console requests can refresh an expired token with stored AK/SK credentials.
14-
- **`bl bootstrap`** — initializes a Bailian workspace, creates the Console user, and activates required postpaid services in one workflow.
14+
- **`bl workspace init`** — initializes a Bailian workspace, creates the Console user, and activates required postpaid services in one workflow.
1515
- **Named Config Profiles** — added isolated named profiles, persistent activation, and `bl config list`, `bl config use`, and `bl config ui` for profile management.
1616
- **Token Plan model Profile**`bl auth login --config token-plan --api-key ...` materializes the built-in Token Plan endpoint and default model settings for model calls.
1717
- **STS credentials** — OpenAPI authentication now accepts and signs requests with an optional security token.

CHANGELOG.zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
### 新增
1212

1313
- **CLI Access Token 自动化** —— 新增 `bl auth generate-access-token`;OpenAPI 登录可获取并保存 Console Access Token,Console 请求可使用已保存的 AK/SK 自动刷新过期 Token。
14-
- **`bl bootstrap`** —— 通过一条工作流初始化百炼工作空间、创建控制台用户并开通所需的后付费服务。
14+
- **`bl workspace init`** —— 通过一条工作流初始化百炼工作空间、创建控制台用户并开通所需的后付费服务。
1515
- **命名 Config Profile** —— 新增相互隔离的命名 Profile、持久化激活状态,以及用于管理 Profile 的 `bl config list``bl config use``bl config ui`
1616
- **Token Plan 模型 Profile** —— `bl auth login --config token-plan --api-key ...` 会物化 Token Plan 内置接入地址与默认模型配置,供模型命令直接使用。
1717
- **STS 凭证** —— OpenAPI 鉴权现支持可选 Security Token,并在签名请求中自动携带。

packages/cli/src/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ import {
8383
tokenPlanCreateKey,
8484
tokenPlanAssignSeats,
8585
tokenPlanAddMember,
86-
bootstrap,
86+
workspaceInit,
8787
pluginInstall,
8888
pluginLink,
8989
pluginList,
@@ -179,7 +179,7 @@ export const commands: Record<string, AnyCommand> = {
179179
"token-plan create-key": tokenPlanCreateKey,
180180
"token-plan assign-seats": tokenPlanAssignSeats,
181181
"token-plan add-member": tokenPlanAddMember,
182-
bootstrap: bootstrap,
182+
"workspace init": workspaceInit,
183183
"plugin install": pluginInstall,
184184
"plugin link": pluginLink,
185185
"plugin list": pluginList,

packages/commands/src/commands/bootstrap/index.ts renamed to packages/commands/src/commands/workspace/init.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export default defineCommand({
139139
const { accessKeyId, accessKeySecret } = flags;
140140
if (!accessKeyId || !accessKeySecret) {
141141
throw new BailianError(
142-
"bootstrap requires --access-key-id and --access-key-secret.",
142+
"workspace init requires --access-key-id and --access-key-secret.",
143143
ExitCode.USAGE,
144144
);
145145
}
@@ -224,8 +224,8 @@ export default defineCommand({
224224
},
225225
});
226226
} catch (err) {
227-
// Re-running bootstrap is idempotent: an already-existing user is not
228-
// fatal, so swallow it and continue with the remaining steps.
227+
// Re-running workspace init is idempotent: an already-existing user is
228+
// not fatal, so swallow it and continue with the remaining steps.
229229
if (!(err instanceof BailianError) || !/already exists/i.test(err.message)) {
230230
throw err;
231231
}

packages/commands/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export { default as tokenPlanListSeats } from "./commands/token-plan/list-seats.
9090
export { default as tokenPlanCreateKey } from "./commands/token-plan/create-key.ts";
9191
export { default as tokenPlanAssignSeats } from "./commands/token-plan/assign-seats.ts";
9292
export { default as tokenPlanAddMember } from "./commands/token-plan/add-member.ts";
93-
export { default as bootstrap } from "./commands/bootstrap/index.ts";
93+
export { default as workspaceInit } from "./commands/workspace/init.ts";
9494
export { default as pluginInstall } from "./commands/plugin/install.ts";
9595
export { default as pluginLink } from "./commands/plugin/link.ts";
9696
export { default as pluginList } from "./commands/plugin/list.ts";

skills/bailian-cli/reference/bootstrap.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

skills/bailian-cli/reference/index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Use this index for the full quick index and global flags.
1717
| `bl auth login` | Authenticate with API key, console browser login, or OpenAPI AK/SK (credentials can coexist) | [auth.md](auth.md) |
1818
| `bl auth logout` | Clear stored credentials | [auth.md](auth.md) |
1919
| `bl auth status` | Show current authentication state | [auth.md](auth.md) |
20-
| `bl bootstrap` | Initialize Bailian workspace and activate postpaid services | [bootstrap.md](bootstrap.md) |
2120
| `bl config list` | List config profiles and show the active profile | [config.md](config.md) |
2221
| `bl config set` | Set a config value | [config.md](config.md) |
2322
| `bl config show` | Display current configuration | [config.md](config.md) |
@@ -97,6 +96,7 @@ Use this index for the full quick index and global flags.
9796
| `bl video ref` | Reference-to-video generation (happyhorse-1.1-r2v / wan2.6-r2v): multi-subject, multi-shot with voice | [video.md](video.md) |
9897
| `bl video task get` | Query async task status | [video.md](video.md) |
9998
| `bl vision describe` | Describe an image or video using Qwen-VL | [vision.md](vision.md) |
99+
| `bl workspace init` | Initialize Bailian workspace and activate postpaid services | [workspace.md](workspace.md) |
100100
| `bl workspace list` | List all workspaces | [workspace.md](workspace.md) |
101101

102102
## By group
@@ -106,7 +106,6 @@ Use this index for the full quick index and global flags.
106106
| `advisor` | `recommend` | [advisor.md](advisor.md) |
107107
| `app` | `call`, `list` | [app.md](app.md) |
108108
| `auth` | `generate-access-token`, `login`, `logout`, `status` | [auth.md](auth.md) |
109-
| `bootstrap` | `(root)` | [bootstrap.md](bootstrap.md) |
110109
| `config` | `list`, `set`, `show`, `ui`, `use` | [config.md](config.md) |
111110
| `console` | `call` | [console.md](console.md) |
112111
| `dataset` | `delete`, `get`, `list`, `upload`, `validate` | [dataset.md](dataset.md) |
@@ -130,7 +129,7 @@ Use this index for the full quick index and global flags.
130129
| `usage` | `free`, `freetier`, `stats`, `summary` | [usage.md](usage.md) |
131130
| `video` | `download`, `edit`, `generate`, `ref`, `task get` | [video.md](video.md) |
132131
| `vision` | `describe` | [vision.md](vision.md) |
133-
| `workspace` | `list` | [workspace.md](workspace.md) |
132+
| `workspace` | `init`, `list` | [workspace.md](workspace.md) |
134133

135134
## Global flags
136135

skills/bailian-cli/reference/workspace.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,35 @@ Index: [index.md](index.md)
77

88
## Commands in this group
99

10-
| Command | Description |
11-
| ------------------- | ------------------- |
12-
| `bl workspace list` | List all workspaces |
10+
| Command | Description |
11+
| ------------------- | ----------------------------------------------------------- |
12+
| `bl workspace init` | Initialize Bailian workspace and activate postpaid services |
13+
| `bl workspace list` | List all workspaces |
1314

1415
## Command details
1516

17+
### `bl workspace init`
18+
19+
| Field | Value |
20+
| --------------- | ------------------------------------------------------------------------------------------------ |
21+
| **Name** | `workspace init` |
22+
| **Description** | Initialize Bailian workspace and activate postpaid services |
23+
| **Usage** | `bl workspace init --access-key-id <id> --access-key-secret <secret> [--security-token <token>]` |
24+
25+
#### Flags
26+
27+
| Flag | Type | Required | Description |
28+
| ------------------------------ | ------ | -------- | ------------------------------------------- |
29+
| `--access-key-id <id>` | string | no | Alibaba Cloud Access Key ID |
30+
| `--access-key-secret <secret>` | string | no | Alibaba Cloud Access Key Secret |
31+
| `--security-token <token>` | string | no | Alibaba Cloud STS Security Token (optional) |
32+
33+
#### Examples
34+
35+
```bash
36+
bl workspace init --access-key-id LTAIxxxxx --access-key-secret xxxxx
37+
```
38+
1639
### `bl workspace list`
1740

1841
| Field | Value |

0 commit comments

Comments
 (0)