bailian-cli 0.0.0-beta-ca77c77-20260605
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +181 -0
- package/README_CN.md +176 -0
- package/dist/bailian.d.mts +3 -0
- package/dist/bailian.mjs +336 -0
- package/package.json +71 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 Aliyun Model Studio (DashScope) AI Platform
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="https://img.alicdn.com/imgextra/i1/O1CN01kGgO3z1N30OINgUoG_!!6000000001513-2-tps-1915-821.png" alt="Aliyun Model Studio CLI" />
|
|
4
|
+
|
|
5
|
+
**The official command-line interface for Aliyun Model Studio (DashScope) AI Platform**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/bailian-cli)
|
|
8
|
+
[](https://nodejs.org)
|
|
9
|
+
[](https://www.typescriptlang.org)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
|
|
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&)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
_Chat with Qwen, generate images & videos, understand images, call agents,_
|
|
17
|
+
_manage memory, search the web — all from your terminal._
|
|
18
|
+
|
|
19
|
+
_Built for AI Agents. Every command works as a structured tool call._
|
|
20
|
+
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
## Features
|
|
24
|
+
|
|
25
|
+
Equip your AI Agent out-of-the-box with these capabilities, composable across complex tasks:
|
|
26
|
+
|
|
27
|
+
- **Text chat** — Qwen3.7-max: major gains in agentic coding, frontend coding, and vibe coding
|
|
28
|
+
- **Multimodal (Omni)** — Full omni-modal support across text + image + audio + video
|
|
29
|
+
- **Image generation & editing** — Qwen-Image 2.0: pro text rendering, photorealism, strong semantic adherence, multi-image composition
|
|
30
|
+
- **Video generation & editing** — HappyHorse-1.0 series: text-/image-/reference-to-video and natural-language video editing (up to 9-image reference)
|
|
31
|
+
- **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
|
|
32
|
+
- **Image & video understanding** — Qwen-VL: long-form video analysis, chart/document parsing, visual reasoning, multilingual OCR
|
|
33
|
+
- **Knowledge base & memory** — Multimodal RAG retrieval and cross-session memory for personalized, coherent dialogue
|
|
34
|
+
- **App calls** — Invoke agents and workflows already published on Aliyun Model Studio
|
|
35
|
+
- **Web search** — Real-time internet retrieval for up-to-date, accurate answers
|
|
36
|
+
- **Console capabilities** — Browse Bailian apps (`app list`) and check free-tier quota (`usage free`)
|
|
37
|
+
- **Local file auto-upload** — Every URL parameter accepts a local path; uploaded to free temp storage with 48-hour validity
|
|
38
|
+
|
|
39
|
+
## Showcase: One-Sentence Cinematic Video
|
|
40
|
+
|
|
41
|
+
<p align="center">
|
|
42
|
+
<a href="https://cloud.video.taobao.com/vod/dS2F4huqbw5Nfe5L3wwb3grz2q2DNYD3retq8dU-iHo.mp4">
|
|
43
|
+
<img src="https://img.alicdn.com/imgextra/i1/O1CN01Q5052k232Hd36NodG_!!6000000007197-0-tps-2940-1656.jpg" alt="Click to play the demo video" width="720" />
|
|
44
|
+
</a>
|
|
45
|
+
</p>
|
|
46
|
+
|
|
47
|
+
<p align="center"><i>👆 Click the cover to play the full 2-minute demo</i></p>
|
|
48
|
+
|
|
49
|
+
A complete **2-minute, 16:9 cinematic short film** — produced end-to-end from a single natural-language sentence, with **zero manual editing**. This showcase demonstrates how an AI Agent can compose a multi-step creative pipeline by orchestrating three primitives:
|
|
50
|
+
|
|
51
|
+
- **[Qwen Code](https://github.com/QwenLM/qwen-code)** — the agentic coding model that interprets the user's intent and drives the workflow
|
|
52
|
+
- **[Aliyun Model Studio CLI](https://bailian.console.aliyun.com/cli?source_channel=cli_github&)** — invokes **HappyHorse 1.0**, Aliyun Model Studio's text-/image-/reference-to-video generation model
|
|
53
|
+
- **[spark-video Skill](https://github.com/JohnKeating1997/spark-video)** — handles scene decomposition, storyboarding, shot continuity, and final stitching
|
|
54
|
+
|
|
55
|
+
### The single prompt
|
|
56
|
+
|
|
57
|
+
> _"Generate a roughly 2-minute video in Japanese cinematic style — a sweet, innocent first-love story about a high-school girl. The plot should be heart-fluttering enough to make viewers want to fall in love. Aspect ratio: 16:9."_
|
|
58
|
+
>
|
|
59
|
+
> _(Original: "帮我生成一段日系影视风格,高中女生的青涩初恋故事,剧情高甜,让人看了想谈恋爱,2分钟左右的视频,尺寸是16:9")_
|
|
60
|
+
|
|
61
|
+
### How it works
|
|
62
|
+
|
|
63
|
+
1. **Qwen Code** parses the request, plans the narrative beats, and decides which tools to call.
|
|
64
|
+
2. The **spark-video Skill** breaks the story into shots, writes per-shot prompts, and enforces visual continuity (characters, lighting, palette, lens language).
|
|
65
|
+
3. **`bl video generate`** dispatches each shot to **HappyHorse 1.0** in parallel.
|
|
66
|
+
4. The skill stitches all clips back together into a single 16:9 / ~2-min deliverable.
|
|
67
|
+
|
|
68
|
+
No timeline scrubbing. No frame-by-frame editing. Just one sentence → one video.
|
|
69
|
+
|
|
70
|
+
## Installation
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npm install -g bailian-cli
|
|
74
|
+
npx skills add modelstudioai/skills --all -g
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
> Requires Node.js >= 22.12.
|
|
78
|
+
|
|
79
|
+
## Quick Start
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Authenticate, recommended
|
|
83
|
+
bl auth login --console
|
|
84
|
+
|
|
85
|
+
# Or authenticate with an API key
|
|
86
|
+
bl auth login --api-key sk-xxxxx
|
|
87
|
+
|
|
88
|
+
# Chat with Qwen
|
|
89
|
+
bl text chat --message "What is DashScope?"
|
|
90
|
+
|
|
91
|
+
# Multimodal chat (text + image + audio + video)
|
|
92
|
+
bl omni --message "Describe this image" --image ./photo.jpg
|
|
93
|
+
|
|
94
|
+
# Generate an image
|
|
95
|
+
bl image generate --prompt "A cat in a spacesuit" --out-dir ./images/
|
|
96
|
+
|
|
97
|
+
# Generate a video from local image
|
|
98
|
+
bl video generate --image ./cat.png --prompt "Make the cat move" --download cat.mp4
|
|
99
|
+
|
|
100
|
+
# Browser login (required for console capability commands)
|
|
101
|
+
bl auth login --console
|
|
102
|
+
|
|
103
|
+
# Browse apps / free-tier quota
|
|
104
|
+
bl app list
|
|
105
|
+
bl usage free --model qwen3-max
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
> More examples and scenarios: [Aliyun Model Studio CLI Site](https://bailian.console.aliyun.com/cli?source_channel=cli_github&)
|
|
109
|
+
|
|
110
|
+
## Authentication
|
|
111
|
+
|
|
112
|
+
### DashScope API Key
|
|
113
|
+
|
|
114
|
+
Required for most commands. Get your key from the [DashScope Console](https://bailian.console.aliyun.com/cli?source_channel=key_github&).
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Option 1: Environment variable
|
|
118
|
+
export DASHSCOPE_API_KEY=sk-xxxxx
|
|
119
|
+
|
|
120
|
+
# Option 2: Login command (persisted to ~/.bailian/config.json)
|
|
121
|
+
bl auth login --api-key sk-xxxxx
|
|
122
|
+
|
|
123
|
+
# Option 3: Per-command flag
|
|
124
|
+
bl text chat --api-key sk-xxxxx --message "Hello"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Console Login (OAuth)
|
|
128
|
+
|
|
129
|
+
Required for console capability commands (`app list`, `usage free`). Opens the Bailian console in your browser to sign in.
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
bl auth login --console
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Alibaba Cloud AK/SK (Knowledge Base only)
|
|
136
|
+
|
|
137
|
+
Required for `knowledge retrieve`. Get your AccessKey from [RAM Console](https://ram.console.aliyun.com/manage/ak).
|
|
138
|
+
|
|
139
|
+
> Recommended: create a RAM sub-account with minimum privileges instead of using the root account's AK/SK.
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
export ALIBABA_CLOUD_ACCESS_KEY_ID=LTAI5t...
|
|
143
|
+
export ALIBABA_CLOUD_ACCESS_KEY_SECRET=...
|
|
144
|
+
export BAILIAN_WORKSPACE_ID=ws-...
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Configuration
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# View current config
|
|
151
|
+
bl config show
|
|
152
|
+
|
|
153
|
+
# Set defaults
|
|
154
|
+
bl config set --key region --value us
|
|
155
|
+
bl config set --key default_text_model --value qwen-turbo
|
|
156
|
+
bl config set --key timeout --value 600
|
|
157
|
+
|
|
158
|
+
# Self-update to latest version
|
|
159
|
+
bl update
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Config file location: `~/.bailian/config.json`
|
|
163
|
+
|
|
164
|
+
## Links
|
|
165
|
+
|
|
166
|
+
| Resource | URL |
|
|
167
|
+
| :--------------------------- | :---------------------------------------------------------------- |
|
|
168
|
+
| Aliyun Model Studio CLI Site | https://bailian.console.aliyun.com/cli?source_channel=cli_github& |
|
|
169
|
+
| DashScope API Docs | https://help.aliyun.com/zh/model-studio/ |
|
|
170
|
+
| Qwen Model List | https://help.aliyun.com/zh/model-studio/getting-started/models |
|
|
171
|
+
| Aliyun Model Studio Console | https://bailian.console.aliyun.com/ |
|
|
172
|
+
| Get API Key | https://bailian.console.aliyun.com/cli?source_channel=key_github& |
|
|
173
|
+
| Get AccessKey | https://ram.console.aliyun.com/manage/ak |
|
|
174
|
+
|
|
175
|
+
## Changelog
|
|
176
|
+
|
|
177
|
+
Release notes for every version live in [CHANGELOG.md](https://github.com/modelstudioai/cli/blob/main/CHANGELOG.md).
|
|
178
|
+
|
|
179
|
+
## Contributing
|
|
180
|
+
|
|
181
|
+
Bug reports, feature requests, and PRs are welcome. See [CONTRIBUTING.md](https://github.com/modelstudioai/cli/blob/main/CONTRIBUTING.md) for developer setup, repo layout, and the workflow for adding or changing commands.
|
package/README_CN.md
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="https://img.alicdn.com/imgextra/i1/O1CN01kGgO3z1N30OINgUoG_!!6000000001513-2-tps-1915-821.png" alt="Aliyun Model Studio CLI" />
|
|
4
|
+
|
|
5
|
+
**阿里云百炼 (DashScope) AI 平台命令行工具**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/bailian-cli)
|
|
8
|
+
[](https://nodejs.org)
|
|
9
|
+
[](https://www.typescriptlang.org)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
|
|
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&)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
_千问对话、图像生成与编辑、视频生成与编辑、图像理解、语音合成与识别、_
|
|
17
|
+
_应用调用、记忆管理、知识检索、联网搜索 — 一行命令,触达所有 AI 能力。_
|
|
18
|
+
|
|
19
|
+
_专为 AI Agent 打造,每个命令均可作为结构化工具调用。_
|
|
20
|
+
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
## 功能特性
|
|
24
|
+
|
|
25
|
+
让您的 AI Agent 开箱即具备以下能力,并可在复杂任务中自动组合调用:
|
|
26
|
+
|
|
27
|
+
- **文本对话** — Qwen3.7-max:Agentic coding、前端编程、Vibe coding 等能力显著增强
|
|
28
|
+
- **全模态对话** — 文本 + 图像 + 音频 + 视频全模态支持
|
|
29
|
+
- **图像生成与编辑** — Qwen-Image 2.0:专业文字渲染、真实质感、强语义遵循、多图合成
|
|
30
|
+
- **视频生成与编辑** — HappyHorse-1.0 系列,支持文生 / 图生 / 参考生(最多 9 张图参考)/ 自然语言视频编辑
|
|
31
|
+
- **语音合成与识别** — CosyVoice 实时流式合成,5-20s 样本即可克隆;FunAudio-ASR 覆盖 30 种语种,含汉语七大方言与 20+ 口音官话
|
|
32
|
+
- **图像与视频理解** — Qwen-VL:长视频解析、复杂图表与文档识别、视觉推理、多语种 OCR
|
|
33
|
+
- **知识库与记忆库** — 多模态 RAG 检索 + 跨会话记忆,提供个性化连贯对话体验
|
|
34
|
+
- **应用调用** — 调用已发布在阿里云百炼平台上的智能体与工作流应用
|
|
35
|
+
- **联网搜索** — 实时互联网信息检索,提升回答准确性及时效性
|
|
36
|
+
- **控制台能力** — 浏览百炼应用(`app list`),查询模型免费额度(`usage free`)
|
|
37
|
+
- **本地文件自动上传** — 所有 URL 参数同时支持本地路径,免费临时存储 48 小时
|
|
38
|
+
|
|
39
|
+
## 示例:一句话生成一部电影短片
|
|
40
|
+
|
|
41
|
+
<p align="center">
|
|
42
|
+
<a href="https://cloud.video.taobao.com/vod/dS2F4huqbw5Nfe5L3wwb3grz2q2DNYD3retq8dU-iHo.mp4">
|
|
43
|
+
<img src="https://img.alicdn.com/imgextra/i1/O1CN01Q5052k232Hd36NodG_!!6000000007197-0-tps-2940-1656.jpg" alt="点击播放演示视频" width="720" />
|
|
44
|
+
</a>
|
|
45
|
+
</p>
|
|
46
|
+
|
|
47
|
+
<p align="center"><i>👆 点击封面播放完整 2 分钟演示</i></p>
|
|
48
|
+
|
|
49
|
+
一部完整的 **2 分钟、16:9 电影感短片** —— 由一句自然语言端到端生成,**全程零手动剪辑**。这个示例展示了 AI Agent 如何把三个基础能力编排成一条多步创作流水线:
|
|
50
|
+
|
|
51
|
+
- **[Qwen Code](https://github.com/QwenLM/qwen-code)** —— Agentic coding 模型,解析用户意图、驱动整个工作流
|
|
52
|
+
- **[阿里云百炼 CLI](https://github.com/modelstudioai/cli/)** —— 调用 **HappyHorse 1.0**,百炼的文生/图生/参考生视频模型
|
|
53
|
+
- **[spark-video Skill](https://github.com/JohnKeating1997/spark-video)** —— 负责场景拆分、分镜设计、镜头连贯性和最终拼接
|
|
54
|
+
|
|
55
|
+
### 唯一的提示词
|
|
56
|
+
|
|
57
|
+
> _"帮我生成一段日系影视风格,高中女生的青涩初恋故事,剧情高甜,让人看了想谈恋爱,2 分钟左右的视频,尺寸是 16:9"_
|
|
58
|
+
|
|
59
|
+
### 工作流程
|
|
60
|
+
|
|
61
|
+
1. **Qwen Code** 解析需求、规划叙事节奏,决定要调用哪些工具。
|
|
62
|
+
2. **spark-video Skill** 把故事拆成镜头、为每个镜头写提示词,并保证视觉连贯性(角色、光线、色调、镜头语言)。
|
|
63
|
+
3. **`bl video generate`** 把每个镜头并行下发给 **HappyHorse 1.0**。
|
|
64
|
+
4. Skill 把所有片段拼成最终的 16:9 / 约 2 分钟成片。
|
|
65
|
+
|
|
66
|
+
没有时间线拖拽,没有逐帧剪辑。一句话 → 一部短片。
|
|
67
|
+
|
|
68
|
+
## 安装
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm install -g bailian-cli
|
|
72
|
+
npx skills add modelstudioai/skills --all -g
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
> 需要预先安装 Node.js >= 22.12。
|
|
76
|
+
|
|
77
|
+
## 快速开始
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# 认证
|
|
81
|
+
bl auth login --api-key sk-xxxxx
|
|
82
|
+
|
|
83
|
+
# 和通义千问对话
|
|
84
|
+
bl text chat --message "你好,介绍一下阿里云百炼平台"
|
|
85
|
+
|
|
86
|
+
# 多模态对话(文本 + 图片 + 音频 + 视频)
|
|
87
|
+
bl omni --message "描述这张图片" --image ./photo.jpg
|
|
88
|
+
|
|
89
|
+
# 生成图片
|
|
90
|
+
bl image generate --prompt "一只穿太空服的猫在火星上" --out-dir ./images/
|
|
91
|
+
|
|
92
|
+
# 图生视频(本地文件自动上传)
|
|
93
|
+
bl video generate --image ./cat.png --prompt "让画面中的猫动起来" --download cat.mp4
|
|
94
|
+
|
|
95
|
+
# 浏览器登录(控制台能力相关命令需要)
|
|
96
|
+
bl auth login --console
|
|
97
|
+
|
|
98
|
+
# 浏览应用 / 免费额度
|
|
99
|
+
bl app list
|
|
100
|
+
bl usage free --model qwen3-max
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
> 更多案例与使用场景:[阿里云百炼 CLI 官方主页](https://bailian.console.aliyun.com/cli?source_channel=cli_github&)
|
|
104
|
+
|
|
105
|
+
## 认证方式
|
|
106
|
+
|
|
107
|
+
### DashScope API Key
|
|
108
|
+
|
|
109
|
+
大部分命令均需要 API Key。前往 [DashScope 控制台](https://bailian.console.aliyun.com/cli?source_channel=key_github&) 获取。
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# 方式一:环境变量
|
|
113
|
+
export DASHSCOPE_API_KEY=sk-xxxxx
|
|
114
|
+
|
|
115
|
+
# 方式二:登录命令(持久化到 ~/.bailian/config.json)
|
|
116
|
+
bl auth login --api-key sk-xxxxx
|
|
117
|
+
|
|
118
|
+
# 方式三:命令行参数
|
|
119
|
+
bl text chat --api-key sk-xxxxx --message "你好"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 控制台登录(OAuth)
|
|
123
|
+
|
|
124
|
+
控制台能力命令(`app list`、`usage free`)需要使用此登录方式。打开浏览器跳转百炼控制台完成登录。
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
bl auth login --console
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 阿里云 AK/SK(仅知识库检索)
|
|
131
|
+
|
|
132
|
+
`knowledge retrieve` 命令需要阿里云 AccessKey。前往 [RAM 控制台](https://ram.console.aliyun.com/manage/ak) 获取。
|
|
133
|
+
|
|
134
|
+
> 建议:创建 RAM 子账号并授予最小权限,避免使用主账号 AK/SK。
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
export ALIBABA_CLOUD_ACCESS_KEY_ID=LTAI5t...
|
|
138
|
+
export ALIBABA_CLOUD_ACCESS_KEY_SECRET=...
|
|
139
|
+
export BAILIAN_WORKSPACE_ID=ws-...
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## 配置
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# 查看当前配置
|
|
146
|
+
bl config show
|
|
147
|
+
|
|
148
|
+
# 设置默认值
|
|
149
|
+
bl config set --key region --value us
|
|
150
|
+
bl config set --key default_text_model --value qwen-turbo
|
|
151
|
+
bl config set --key timeout --value 600
|
|
152
|
+
|
|
153
|
+
# 自更新到最新版本
|
|
154
|
+
bl update
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
配置文件位置:`~/.bailian/config.json`
|
|
158
|
+
|
|
159
|
+
## 相关链接
|
|
160
|
+
|
|
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 |
|
|
169
|
+
|
|
170
|
+
## 更新日志
|
|
171
|
+
|
|
172
|
+
每个版本的变更详情记录在 [CHANGELOG_CN.md](https://github.com/modelstudioai/cli/blob/main/CHANGELOG_CN.md)。
|
|
173
|
+
|
|
174
|
+
## 参与贡献
|
|
175
|
+
|
|
176
|
+
欢迎提 Issue、Feature Request 和 PR。开发环境搭建、仓库结构、新增/修改命令的工作流请见 [CONTRIBUTING_CN.md](https://github.com/modelstudioai/cli/blob/main/CONTRIBUTING_CN.md)。
|