bailian-cli 1.0.1 → 1.0.2

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/README.md CHANGED
@@ -35,6 +35,7 @@ Equip your AI Agent out-of-the-box with these capabilities, composable across co
35
35
  - **Knowledge base & memory** — Multimodal RAG retrieval and cross-session memory for personalized, coherent dialogue
36
36
  - **App calls** — Invoke agents and workflows already published on Aliyun Model Studio
37
37
  - **Web search** — Real-time internet retrieval for up-to-date, accurate answers
38
+ - **Console capabilities** — Browse foundation models (`model list`), Bailian apps (`app list`), and check free-tier quota (`usage free`)
38
39
  - **Local file auto-upload** — Every URL parameter accepts a local path; uploaded to free temp storage with 48-hour validity
39
40
 
40
41
  <p align="center">
@@ -66,6 +67,14 @@ bl image generate --prompt "A cat in a spacesuit" --out-dir ./images/
66
67
 
67
68
  # Generate a video from local image
68
69
  bl video generate --image ./cat.png --prompt "Make the cat move" --download cat.mp4
70
+
71
+ # Browser login (required for console capability commands)
72
+ bl auth login --console
73
+
74
+ # Browse models / apps / free-tier quota
75
+ bl model list --name qwen
76
+ bl app list
77
+ bl usage free --model qwen3-max
69
78
  ```
70
79
 
71
80
  > More examples and scenarios: [Aliyun Model Studio CLI Site](https://bailian.console.aliyun.com/cli)
@@ -87,6 +96,14 @@ bl auth login --api-key sk-xxxxx
87
96
  bl text chat --api-key sk-xxxxx --message "Hello"
88
97
  ```
89
98
 
99
+ ### Console Login (OAuth)
100
+
101
+ Required for console capability commands (`model list`, `app list`, `usage free`). Opens the Bailian console in your browser to sign in.
102
+
103
+ ```bash
104
+ bl auth login --console
105
+ ```
106
+
90
107
  ### Alibaba Cloud AK/SK (Knowledge Base only)
91
108
 
92
109
  Required for `knowledge retrieve`. Get your AccessKey from [RAM Console](https://ram.console.aliyun.com/manage/ak).
package/README_CN.md ADDED
@@ -0,0 +1,145 @@
1
+ <div align="center">
2
+
3
+ <img src="https://img.alicdn.com/imgextra/i1/O1CN01RSQFUD1jN5IBzHORt_!!6000000004535-2-tps-2440-521.png" alt="Aliyun Model Studio CLI" width="420" />
4
+
5
+ # >\_ Aliyun Model Studio CLI
6
+
7
+ **阿里云百炼 (DashScope) AI 平台命令行工具**
8
+
9
+ [![npm version](https://img.shields.io/npm/v/bailian-cli?color=0969da&label=npm)](https://www.npmjs.com/package/bailian-cli)
10
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D22.12-brightgreen)](https://nodejs.org)
11
+ [![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178c6)](https://www.typescriptlang.org)
12
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue)](LICENSE)
13
+
14
+ [阿里云百炼 CLI 官方主页](https://bailian.console.aliyun.com/cli) · [English](README.md) · [API 文档](https://help.aliyun.com/zh/model-studio/) · [获取 API Key](https://bailian.console.aliyun.com/cn-beijing/?tab=app#/api-key)
15
+
16
+ ---
17
+
18
+ _千问对话、图像生成与编辑、视频生成与编辑、图像理解、语音合成与识别、_
19
+ _应用调用、记忆管理、知识检索、联网搜索 — 一行命令,触达所有 AI 能力。_
20
+
21
+ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_
22
+
23
+ </div>
24
+
25
+ ## 功能特性
26
+
27
+ 让您的 AI Agent 开箱即具备以下能力,并可在复杂任务中自动组合调用:
28
+
29
+ - **文本对话** — Qwen3.6-plus:Agentic coding、前端编程、Vibe coding 等能力显著增强
30
+ - **全模态对话** — 文本 + 图像 + 音频 + 视频全模态支持
31
+ - **图像生成与编辑** — Qwen-Image 2.0:专业文字渲染、真实质感、强语义遵循、多图合成
32
+ - **视频生成与编辑** — HappyHorse-1.0 系列,支持文生 / 图生 / 参考生(最多 9 张图参考)/ 自然语言视频编辑
33
+ - **语音合成与识别** — CosyVoice 实时流式合成,5-20s 样本即可克隆;FunAudio-ASR 覆盖 30 种语种,含汉语七大方言与 20+ 口音官话
34
+ - **图像与视频理解** — Qwen-VL:长视频解析、复杂图表与文档识别、视觉推理、多语种 OCR
35
+ - **知识库与记忆库** — 多模态 RAG 检索 + 跨会话记忆,提供个性化连贯对话体验
36
+ - **应用调用** — 调用已发布在阿里云百炼平台上的智能体与工作流应用
37
+ - **联网搜索** — 实时互联网信息检索,提升回答准确性及时效性
38
+ - **控制台能力** — 浏览基础模型(`model list`)、百炼应用(`app list`),查询模型免费额度(`usage free`)
39
+ - **本地文件自动上传** — 所有 URL 参数同时支持本地路径,免费临时存储 48 小时
40
+
41
+ <p align="center">
42
+ <img src="https://img.alicdn.com/imgextra/i1/O1CN01Df2LiL1IcCkXJROYz_!!6000000000913-2-tps-759-426.png" alt="bl --help" width="720" />
43
+ </p>
44
+
45
+ ## 安装
46
+
47
+ ```bash
48
+ npm install -g bailian-cli
49
+ ```
50
+
51
+ > 需要预先安装 Node.js >= 22.12。
52
+
53
+ ## 快速开始
54
+
55
+ ```bash
56
+ # 认证
57
+ bl auth login --api-key sk-xxxxx
58
+
59
+ # 和通义千问对话
60
+ bl text chat --message "你好,介绍一下阿里云百炼平台"
61
+
62
+ # 多模态对话(文本 + 图片 + 音频 + 视频)
63
+ bl omni --message "描述这张图片" --image ./photo.jpg
64
+
65
+ # 生成图片
66
+ bl image generate --prompt "一只穿太空服的猫在火星上" --out-dir ./images/
67
+
68
+ # 图生视频(本地文件自动上传)
69
+ bl video generate --image ./cat.png --prompt "让画面中的猫动起来" --download cat.mp4
70
+
71
+ # 浏览器登录(控制台能力相关命令需要)
72
+ bl auth login --console
73
+
74
+ # 浏览模型 / 应用 / 免费额度
75
+ bl model list --name qwen
76
+ bl app list
77
+ bl usage free --model qwen3-max
78
+ ```
79
+
80
+ > 更多案例与使用场景:[阿里云百炼 CLI 官方主页](https://bailian.console.aliyun.com/cli)
81
+
82
+ ## 认证方式
83
+
84
+ ### DashScope API Key
85
+
86
+ 大部分命令均需要 API Key。前往 [DashScope 控制台](https://bailian.console.aliyun.com/cn-beijing/?tab=app#/api-key) 获取。
87
+
88
+ ```bash
89
+ # 方式一:环境变量
90
+ export DASHSCOPE_API_KEY=sk-xxxxx
91
+
92
+ # 方式二:登录命令(持久化到 ~/.bailian/config.json)
93
+ bl auth login --api-key sk-xxxxx
94
+
95
+ # 方式三:命令行参数
96
+ bl text chat --api-key sk-xxxxx --message "你好"
97
+ ```
98
+
99
+ ### 控制台登录(OAuth)
100
+
101
+ 控制台能力命令(`model list`、`app list`、`usage free`)需要使用此登录方式。打开浏览器跳转百炼控制台完成登录。
102
+
103
+ ```bash
104
+ bl auth login --console
105
+ ```
106
+
107
+ ### 阿里云 AK/SK(仅知识库检索)
108
+
109
+ `knowledge retrieve` 命令需要阿里云 AccessKey。前往 [RAM 控制台](https://ram.console.aliyun.com/manage/ak) 获取。
110
+
111
+ > 建议:创建 RAM 子账号并授予最小权限,避免使用主账号 AK/SK。
112
+
113
+ ```bash
114
+ export ALIBABA_CLOUD_ACCESS_KEY_ID=LTAI5t...
115
+ export ALIBABA_CLOUD_ACCESS_KEY_SECRET=...
116
+ export BAILIAN_WORKSPACE_ID=ws-...
117
+ ```
118
+
119
+ ## 配置
120
+
121
+ ```bash
122
+ # 查看当前配置
123
+ bl config show
124
+
125
+ # 设置默认值
126
+ bl config set --key region --value us
127
+ bl config set --key default_text_model --value qwen-turbo
128
+ bl config set --key timeout --value 600
129
+
130
+ # 自更新到最新版本
131
+ bl update
132
+ ```
133
+
134
+ 配置文件位置:`~/.bailian/config.json`
135
+
136
+ ## 相关链接
137
+
138
+ | 资源 | 地址 |
139
+ | :---------------------- | :-------------------------------------------------------------- |
140
+ | 阿里云百炼 CLI 官方主页 | https://bailian.console.aliyun.com/cli |
141
+ | DashScope API 文档 | https://help.aliyun.com/zh/model-studio/ |
142
+ | 通义千问模型列表 | https://help.aliyun.com/zh/model-studio/getting-started/models |
143
+ | 阿里云百炼控制台 | https://bailian.console.aliyun.com/ |
144
+ | 获取 API Key | https://bailian.console.aliyun.com/cn-beijing/?tab=app#/api-key |
145
+ | 获取 AccessKey | https://ram.console.aliyun.com/manage/ak |