Skip to content

Commit 68560c7

Browse files
authored
docs(guide): reorder flow (install→key→auth→use) + one-line CLI install with GitHub URL + emphasize modelstudioai repos (#16)
Reorder guide steps to install→key→auth→use flow. Add one-line CLI install prompt with github.com/modelstudioai/cli URL. Emphasize GitHub repo links throughout (7+ hooks for Star/Clone KPI). Absorb Method B agent dialog table into Step 5, eliminating 3 duplications.
1 parent dde3d46 commit 68560c7

1 file changed

Lines changed: 113 additions & 85 deletions

File tree

guide/index.md

Lines changed: 113 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
layout: doc
33
title: 完整上手教程
44
permalink: /guide/
5-
description: "5 步从零到一:注册阿里云百炼、获取 API Key、安装 CLI、加载 Skill、跑出你的第一个 AI 产物。覆盖 Cursor、Qwen Code、Claude Desktop、OpenWork 等主流 Agent 集成路径"
6-
keywords: "阿里云百炼上手,百炼 CLI 安装,API Key 获取,bailian-cli 教程,AI Agent 入门,Qwen 调用,Cursor 集成,Claude Desktop,Quick Start"
5+
description: "6 步从零到一:装好 bailian-cli → 拿 API Key → 登录 → 加载 Skill → 在 Agent 里说人话 → 跑出第一支视频。源码全开源在 github.com/modelstudioai"
6+
keywords: "阿里云百炼上手,bailian-cli 安装,modelstudioai GitHub,API Key 获取,AI Agent 入门,Qwen 调用,Cursor 集成,Claude Desktop,Quick Start"
77
---
88

99
# 完整上手教程
1010

11-
本教程带你走通 **阿里云百炼 → CLI → Skills → AI Agent** 的完整链路。
11+
本教程带你走通 **阿里云百炼 → CLI → Skills → AI Agent** 的完整链路。所有工具源码都在 [`github.com/modelstudioai`](https://github.com/modelstudioai) ——觉得好用,每个仓库顺手 ⭐ Star。
1212

1313
> ⏱️ 预计用时:15–25 分钟
1414
> 🚀 在 Workshop 现场?请直接查看 [Workshop 手册 →](/workshop/)
@@ -21,27 +21,27 @@ keywords: "阿里云百炼上手,百炼 CLI 安装,API Key 获取,bailian-cli
2121
阿里云百炼平台(Aliyun Model Studio / DashScope)
2222
↑ 提供 AI 模型 API(文本/图像/视频/语音/向量等)
2323
24-
阿里云百炼 CLI(命令 bl)
24+
阿里云百炼 CLI(命令 bl) ← 源码 github.com/modelstudioai/cli
2525
↑ 命令行工具,每条命令即 AI Agent 的结构化工具调用
2626
2727
你的 AI Agent 环境
2828
• 终端:直接 bl 调用
2929
• Cursor / Qwen Code / Claude Desktop / Windsurf / Cline / Trae:作为工具
30-
• OpenWork(开源桌面 Agent):开箱即用
30+
• OpenWork(开源桌面 Agent):开箱即用 ← 源码 github.com/modelstudioai/openwork
3131
↑ 加载
3232
33-
Skills(可复用的 AI 能力模块)
33+
Skills(可复用的 AI 能力模块) ← 源码 github.com/modelstudioai/skills
3434
• 官方 first-party:bailian-cli、bailian-docs-llm-wiki、spark-video
3535
• 精选社区:canvas-design、frontend-design、marketing-writer 等
3636
```
3737

3838
各组件职责:
3939

4040
- **阿里云百炼**:模型 API 服务平台(DashScope)
41-
- **阿里云百炼 CLI(`bl`**:把模型能力封装成结构化命令
41+
- **阿里云百炼 CLI(`bl`**:把模型能力封装成结构化命令,源码 [`modelstudioai/cli`](https://github.com/modelstudioai/cli)
4242
- **AI Agent 环境**:调用 `bl` 的载体——可以是任意支持 shell 或 MCP 的 Agent
43-
- **OpenWork**:开源桌面 Agent,已内置 CLI 与 Skills 体系
44-
- **Skills**:把多步工作流打包成可复用的能力模块
43+
- **OpenWork**:开源桌面 Agent,已内置 CLI 与 Skills 体系,源码 [`modelstudioai/openwork`](https://github.com/modelstudioai/openwork)
44+
- **Skills**:把多步工作流打包成可复用的能力模块,集合在 [`modelstudioai/skills`](https://github.com/modelstudioai/skills)
4545

4646
---
4747

@@ -60,94 +60,93 @@ Skills(可复用的 AI 能力模块)
6060
| <img src="/guide/assets/bailian-cli-card-03-cli.jpg" width="100"> **CLI(`bl`** |**万能遥控器**」——一句话或一行命令,让 Agent 调用模型超市里任何一个模型 |
6161
| <img src="/guide/assets/bailian-cli-card-04-mcp.jpg" width="100"> **MCP** |**通用插头**」——AI 世界的 USB-C,让任意 Agent 一插即用百炼能力 |
6262

63-
> 👶 **小白专属**:如果你看不懂下方任何一条命令,**完全没关系**——本教程支持纯对话路径,所有命令都可以让 Agent 替你跑。继续往下看 Step 2
63+
> 👶 **小白专属**:如果你看不懂下方任何一条命令,**完全没关系**——本教程支持纯对话路径,所有命令都可以让 Agent 替你跑。继续往下看。
6464
6565
---
6666

67-
## 第一步:注册阿里云百炼并获取 API Key
67+
## 第一步:让 AI 帮你装好百炼 CLI
6868

69-
### 1.1 注册账号
69+
最快的装法——**对你的 AI 助手说一句话**(OpenWork / Cursor / Qoder / Claude Desktop / Windsurf / Trae 任一都能听懂):
7070

71-
前往阿里云百炼平台,使用阿里云账号登录(无账号需先注册)。
72-
73-
### 1.2 创建 API Key
74-
75-
[获取 API Key →]({{ site.bailian_apikey_url }})
76-
77-
1. 点击「创建 API Key」
78-
2. 给 Key 取个名称(如 `my-cli-key`
79-
3. 复制并妥善保存(仅创建时可见完整值)
80-
81-
### 1.3 关于免费额度
82-
83-
阿里云百炼为新用户提供免费 token 额度,足够本教程与日常探索。安装 CLI 后可用 `bl usage free` 实时查询余量。
84-
85-
[阿里云百炼 CLI 控制台 →]({{ site.bailian_cli_url }})
86-
87-
---
71+
> https://github.com/modelstudioai/cli 这里,帮我全局安装阿里云百炼 CLI(bailian-cli),装完确认一下版本。我的 Node.js 版本你也帮我检查一下,要求 ≥ 22.12。
8872
89-
## 第二步:选择你的运行环境
73+
Agent 会自动判断你的环境、装 Node(如果没装或版本过低)、跑 `npm install -g bailian-cli`、验证 `bl --version`,全程你只看结果,**不需要你打任何命令字符**
9074

91-
> **不想敲命令?跳过本节直接看 Step 4。**
92-
>
93-
> 如果你**不熟悉终端、不会 npm、看见命令行就头大**——选下面的「方式 C:OpenWork 桌面 Agent」就够了。下载 .dmg/.exe 双击安装,跟微信一样傻瓜。CLI、Skills 在 OpenWork 里全部内置好了,**你只需要在对话框里说人话**
94-
>
95-
> > 帮我安装阿里云百炼,跑一下你内置的 demo
96-
>
97-
> Agent 会自动替你完成所有命令行操作并把结果贴回来。后续 Step 5 的「让 Agent 调用 Skill」、Step 6 的「跑通你的第一支视频广告」**全部都是纯对话**,不需要打任何字符的命令。
75+
> 💎 **源码即文档**:bailian-cli 完整源代码托管在 [`github.com/modelstudioai/cli`](https://github.com/modelstudioai/cli)。觉得好用?顺手 ⭐ Star——开源项目最直接的「投票」,你的 Star 数会直接显示在仓库主页。
9876
9977
### 我应该选哪条路径?
10078

10179
| 你的现状 | 推荐路径 | 大概体验 |
10280
|---------|----------|---------|
103-
| 完全没装过任何 AI Agent,看见黑色终端就紧张 | 方式 C(OpenWork) | 像装微信一样,下载即用,全程对话 |
104-
| 已经在用 Cursor / Qoder / Claude Desktop | 方式 B | 零额外配置,把命令交给你已有的 Agent |
81+
| 完全没装过任何 AI Agent,看见黑色终端就紧张 | 方式 C(OpenWork) | 像装微信一样,下载即用,CLI 已内置 |
82+
| 已经在用 Cursor / Qoder / Claude Desktop | 方式 B | 把上面那句话粘进对话框,Agent 替你装 |
10583
| 习惯命令行,想要最轻量 | 方式 A | 一行 npm install,全靠肌肉记忆 |
10684

10785
拿不准?**默认选方式 C**
10886

109-
阿里云百炼 CLI 是为 AI Agent 而生的——任何支持 shell 命令或 MCP 工具的 Agent 都能直接使用它。挑选适合你的方式:
110-
11187
### 方式 A:终端直接安装(最轻量)
11288

11389
```bash
11490
npm install -g bailian-cli
11591
bl --version
11692
```
11793

94+
npm 拉取的就是 [`github.com/modelstudioai/cli`](https://github.com/modelstudioai/cli) 的发布版本——每次 `npm install` 都会触发该仓库的一次访问数据。
95+
11896
> ⚙️ **环境前置说明**
11997
> - `bailian-cli` 本体(`bl` 命令):**Node.js ≥ 22.12**(package.json engines 字段硬要求,低于此版本 `npm install` 会直接报错)
12098
> - `skills` CLI(`npx skills add ...`,第四步用到):Node.js ≥ 18 即可
12199
>
122100
> 没装 Node 或版本低于 22.12?建议直接装最新 LTS(v22 或更高)一劳永逸,推荐使用 [nvm](https://github.com/nvm-sh/nvm) / [fnm](https://github.com/Schniz/fnm) 管理版本。
123101
124-
### 方式 B:在主流 AI Agent 框架中使用
102+
### 方式 B:让你已有的 Agent 替你装
125103

126-
只要 Agent 装了 `bailian-cli`(按「方式 A」一句话装好),就能在对话里**直接说人话**调用百炼能力——无需关心底层命令。
104+
如果你已经在用 Cursor / Qoder / Claude Desktop / Windsurf / Cline / Trae 等任一 AI Agent——直接把页面顶部那句话粘进它的对话框:
127105

128-
| 框架 | 在它里面怎么用(直接对话) |
129-
|------|---------|
130-
| **Cursor** | 在 Composer 里说:「**帮我用百炼生成一张赛博朋克风格的猫**」。Cursor 会自动调度百炼并把生成的图片路径贴回对话 |
131-
| **Qwen Code** | 直接对它提需求,Qwen Code 会把任务派给百炼完成。完整示例见 [Showcase](/showcase/) |
132-
| **Claude Desktop / Claude Code** | 对 Claude 说:「**用百炼帮我做一段 30 秒的产品介绍视频,卖点是 XXX**」。Claude 会自主跑通整条链路 |
133-
| **Windsurf / Cline / Trae** | 同样——在对话框里说需求,Agent 自主完成;不需要你打任何命令 |
106+
> https://github.com/modelstudioai/cli 这里,帮我全局安装阿里云百炼 CLI(bailian-cli),装完确认一下版本。我的 Node.js 版本你也帮我检查一下,要求 ≥ 22.12。
134107
135-
> 💡 **想接入百炼托管的官方 MCP 服务**(如官方天气、日历、知识库等)?查看 [`/cli/` 的「MCP 集成」一节](/cli/#核心能力),里面有专门的接入指引
108+
Agent 会自己判断 Node 环境、跑 `npm install -g bailian-cli`、验证 `bl --version`,全程你只看结果。装好之后该 Agent 就具备调用百炼任意能力的本事——第五步会演示具体怎么对话
136109

137-
### 方式 C:使用 OpenWork(开源桌面 Agent)
110+
### 方式 C:使用 OpenWork(开源桌面 Agent,已内置 CLI
138111

139-
[OpenWork](/openwork/) 是阿里云百炼团队开源的桌面 Agent,已内置 CLI、Skills 体系与对话界面,下载安装即用:
112+
[OpenWork](/openwork/) 是阿里云百炼团队开源的桌面 Agent,已内置 CLI、Skills 体系与对话界面,下载安装即用——**不需要额外装 bailian-cli**
140113

141-
[前往 GitHub Releases →](https://github.com/modelstudioai/openwork/releases)
114+
[前往 GitHub Releases →](https://github.com/modelstudioai/openwork/releases) · 源码 [`github.com/modelstudioai/openwork`](https://github.com/modelstudioai/openwork)(觉得好用顺手 ⭐ Star)
142115

143116
- macOS:下载 `.dmg`,拖入「应用程序」
144117
- Windows:下载 `.exe`,按提示安装
145118
- Linux:下载 `.AppImage``.deb`
146119

147120
---
148121

122+
## 第二步:注册阿里云百炼并获取 API Key
123+
124+
CLI 已经装好了,接下来给它一把"钥匙"——API Key。
125+
126+
### 2.1 注册账号
127+
128+
前往阿里云百炼平台,使用阿里云账号登录(无账号需先注册)。
129+
130+
### 2.2 创建 API Key
131+
132+
[获取 API Key →]({{ site.bailian_apikey_url }})
133+
134+
1. 点击「创建 API Key」
135+
2. 给 Key 取个名称(如 `my-cli-key`
136+
3. 复制并妥善保存(仅创建时可见完整值)
137+
138+
### 2.3 关于免费额度
139+
140+
阿里云百炼为新用户提供免费 token 额度,足够本教程与日常探索。安装 CLI 后可用 `bl usage free` 实时查询余量。
141+
142+
[阿里云百炼 CLI 控制台 →]({{ site.bailian_cli_url }})
143+
144+
---
145+
149146
## 第三步:登录与验证
150147

148+
把刚才拿到的 Key 配进 CLI,就能开始用了。
149+
151150
### 推荐:浏览器 OAuth 登录
152151

153152
```bash
@@ -182,6 +181,8 @@ bl text chat --message "你好,介绍一下你自己"
182181

183182
Skills 是阿里云百炼团队验证过的 AI 能力模块,让 Agent 能完成更复杂的工作流。
184183

184+
> 🌐 **这些 Skills 都源自 modelstudioai org**:CLI Skill 在 [`github.com/modelstudioai/cli`](https://github.com/modelstudioai/cli),精选扩展集合在 [`github.com/modelstudioai/skills`](https://github.com/modelstudioai/skills)`npx skills add` 实质就是从对应 GitHub repo clone——**你的每次安装,都会成为这些仓库的一次 Clone 数据点**(在 GitHub Traffic Insights 里直接可见)。觉得好用顺手 ⭐ Star 两个 repo。
185+
185186
### 一键自动安装(推荐)
186187

187188
把这段话粘进你的 Agent:
@@ -196,10 +197,10 @@ Skills 是阿里云百炼团队验证过的 AI 能力模块,让 Agent 能完
196197
### 手动安装
197198

198199
```bash
199-
# 核心 bailian-cli skill
200+
# 核心 bailian-cli skill(拉自 github.com/modelstudioai/cli)
200201
npx skills add modelstudioai/cli --all -g
201202

202-
# 精选扩展 skills
203+
# 精选扩展 skills(拉自 github.com/modelstudioai/skills)
203204
npx skills add modelstudioai/skills
204205
```
205206

@@ -211,59 +212,70 @@ npx skills add modelstudioai/skills
211212

212213
> 💬 **不必打命令——对 Agent 说人话就行**
213214
>
214-
> 下面给的命令是「**最底层操作**」,方便高级用户做精细控制。如果你在 OpenWork / Cursor / Qoder / Claude Desktop 里,**完全可以不打任何命令**,直接对 Agent 说:
215-
>
216-
> > 帮我用 bailian-cli 生成一张图,主题是"穿宇航服的猫,赛博朋克风格"
217-
>
218-
> Agent 会自动选择正确的 `bl image generate` 命令、补齐参数、跑完后把结果路径告诉你。
219-
>
220-
> **判断你是不是在对话流里**:你能否用中文一句话提需求、Agent 直接给结果?是→你已经在对话流里,下面的命令直接当作"原理科普"读就行。
215+
> 下面给的命令是「**最底层操作**」,方便高级用户做精细控制。在 OpenWork / Cursor / Qoder / Claude Desktop 等任一 Agent 里,**完全可以不打任何命令**,直接说人话,Agent 会自动选择正确的 `bl` 子命令、补齐参数、跑完后把结果路径告诉你。
216+
217+
### 在你常用的 Agent 里都怎么用
218+
219+
只要 Agent 已经装了 `bailian-cli`(按第一步装好),就能在对话里直接说人话调用百炼能力——下面是几个常见 Agent 的对话示例:
220+
221+
| 框架 | 直接对它说 |
222+
|------|---------|
223+
| **Cursor** | 「帮我用百炼生成一张赛博朋克风格的猫」——Cursor 自动调度 `bl image generate` 并把图片路径贴回 |
224+
| **Qwen Code** | 直接说需求,Qwen Code 会把任务派给百炼。完整示例见 [Showcase](/showcase/) |
225+
| **Claude Desktop / Claude Code** | 「用百炼帮我做一段 30 秒的产品介绍视频,卖点是 XXX」 |
226+
| **Windsurf / Cline / Trae** | 同样——在对话框说需求,Agent 自主完成 |
227+
| **OpenWork** | 内置 CLI 与 Skills,直接在对话框说需求即可 |
228+
229+
> 💡 **想接入百炼托管的官方 MCP 服务**(如官方天气、日历、知识库等)?查看 [`/cli/` 的「MCP 集成」一节](/cli/#核心能力),里面有专门的接入指引。
230+
231+
### 直接对 Agent 说人话即可(举例)
232+
233+
```
234+
> 帮我用 bailian-cli 生成一张图,主题是"穿宇航服的猫,赛博朋克风格"
235+
[Agent 自动跑 bl image generate,把图片路径贴回]
236+
237+
> 帮我设计一张以「自由 + 蝴蝶」为主题的视觉海报
238+
[Agent 自动激活 canvas-design skill 完成创作]
239+
240+
> 给我做一支 30 秒的产品广告视频,产品图:./product.jpg,卖点是"轻便、续航长"
241+
[Agent 自动激活 spark-video skill 完成出片]
242+
```
243+
244+
### 命令底层操作(高级用户参考)
221245

222246
现在你已经具备完整的 CLI + Skills 环境。挑一个场景试试:
223247

224-
### 文本对话
248+
#### 文本对话
225249

226250
```bash
227251
bl text chat --message "解释一下 RAG 是什么"
228252
```
229253

230-
### 多模态理解
254+
#### 多模态理解
231255

232256
```bash
233257
bl omni --message "描述这张图" --image ./photo.jpg
234258
```
235259

236-
### 图像生成
260+
#### 图像生成
237261

238262
```bash
239263
bl image generate --prompt "一只穿宇航服的猫,赛博朋克风格" --out-dir ./images/
240264
```
241265

242-
### 视频生成(图生视频)
266+
#### 视频生成(图生视频)
243267

244268
```bash
245269
bl video generate --image ./cat.png --prompt "让猫动起来" --download cat.mp4
246270
```
247271

248-
### 让 Agent 调用 Skill
249-
250-
直接对你的 Agent 说:
251-
252-
```
253-
> 帮我设计一张以「自由 + 蝴蝶」为主题的视觉海报
254-
[Agent 自动激活 canvas-design skill 完成创作]
255-
256-
> 给我做一支 30 秒的产品广告视频,产品图:./product.jpg,卖点是"轻便、续航长"
257-
[Agent 自动激活 spark-video skill 完成出片]
258-
```
259-
260-
### 查询免费额度
272+
#### 查询免费额度
261273

262274
```bash
263275
bl usage free --model qwen3-max
264276
```
265277

266-
### 模型选型建议
278+
#### 模型选型建议
267279

268280
```bash
269281
bl advisor recommend --message "我需要做一个能看图回答的对话机器人"
@@ -297,7 +309,7 @@ bl advisor recommend --message "我需要做一个能看图回答的对话机器
297309

298310
Agent 会**按顺序自动**
299311

300-
1. `git clone https://github.com/modelstudioai/awesome-happyhorse-prompts`
312+
1. `git clone https://github.com/modelstudioai/awesome-happyhorse-prompts`**这一步直接给该仓库贡献了一个 Clone 数据点**
301313
2.`cases/r2v-1.1.md` 第 3 个 case 的完整 prompt(9 镜头日剧 CM 分镜)
302314
3. 加载 `assets/` 目录下的 3×3 故事板图(**这就是为什么必须 clone**——R2V 模型必须吃故事板图)
303315
4. 调用 `bl video ref`(HappyHorse 1.1 R2V 模型)
@@ -307,9 +319,17 @@ Agent 会**按顺序自动**:
307319

308320
不想 clone 也想感受一下?打开 [HappyHorse 1.1 文生视频体验页]({{ site.happyhorse_t2v_url }}),直接在网页上输入 prompt 就能出片。但**只有 clone 仓库**才能拿到 Happy Run Citrus 这一套完整的故事板图,跑出和示例一模一样的成片。
309321

310-
### 跑通了?
322+
### 跑通了?你已经为开源做了 3 件事
323+
324+
每跑一次这个 demo,你实际上:
311325

312-
-[`modelstudioai/awesome-happyhorse-prompts`](https://github.com/modelstudioai/awesome-happyhorse-prompts) 点个 ⭐ Star
326+
1.[`modelstudioai/awesome-happyhorse-prompts`](https://github.com/modelstudioai/awesome-happyhorse-prompts) 贡献了一次 **Clone**(GitHub Traffic Insights 直接可见)
327+
2. 通过装 CLI / `npx skills add`[`modelstudioai/cli`](https://github.com/modelstudioai/cli)[`modelstudioai/skills`](https://github.com/modelstudioai/skills) 各 +1 Clone
328+
3. 调用 `bl video ref` 验证了 HappyHorse 1.1 R2V 模型——欢迎把成片提到 [Showcase](/showcase/) 让更多人看到
329+
330+
如果觉得这套工具链好用,**帮我们一件事**
331+
332+
- ⭐ 给 [`modelstudioai`](https://github.com/modelstudioai) 全家桶(cli / skills / openwork / awesome-happyhorse-prompts / livetranslatedemo)点 Star
313333
- 把你的成片提交到 [Showcase](/showcase/)
314334
- 改 prompt 换品牌,做属于你自己的产品广告
315335

@@ -319,7 +339,15 @@ Agent 会**按顺序自动**:
319339

320340
## 进阶
321341

322-
### 探索更多
342+
### 探索更多 GitHub 仓库(觉得好用顺手 ⭐ Star)
343+
344+
- 百炼 CLI 源码 → [`github.com/modelstudioai/cli`](https://github.com/modelstudioai/cli)
345+
- 精选 Skills 集合 → [`github.com/modelstudioai/skills`](https://github.com/modelstudioai/skills)
346+
- OpenWork 桌面 Agent → [`github.com/modelstudioai/openwork`](https://github.com/modelstudioai/openwork)
347+
- HappyHorse 视频 prompt 案例库 → [`github.com/modelstudioai/awesome-happyhorse-prompts`](https://github.com/modelstudioai/awesome-happyhorse-prompts)
348+
- 整个 modelstudioai 全家桶 → [`github.com/modelstudioai`](https://github.com/modelstudioai)
349+
350+
### 站内导航
323351

324352
- [精选 Skills 列表 →](/skills/)
325353
- [阿里云百炼 CLI 完整文档 →](/cli/)
@@ -335,7 +363,7 @@ Agent 会**按顺序自动**:
335363

336364
- 分享你的使用案例 → [Showcase →](/showcase/)
337365
- 贡献你的 Skill → [Skills 贡献指南](https://github.com/modelstudioai/skills/issues/new)
338-
- 提 Issue / PR → [GitHub Org](https://github.com/modelstudioai)
366+
- 提 Issue / PR → [GitHub Org(modelstudioai)](https://github.com/modelstudioai)
339367

340368
---
341369

0 commit comments

Comments
 (0)