From 1f8b9ace7eeec1ce8c11ebc26263ca5a1fdba22e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A5=E9=BA=92?= Date: Fri, 7 Aug 2026 15:27:46 +0800 Subject: [PATCH 1/2] docs: refine auth maintenance guidance --- docs/agents/auth-change.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/agents/auth-change.md b/docs/agents/auth-change.md index 7f17373b..b11a1f91 100644 --- a/docs/agents/auth-change.md +++ b/docs/agents/auth-change.md @@ -25,7 +25,7 @@ defineCommand({ auth }) → runtime/authStage → ctx.client → command.run(ctx 当前 command 鉴权域(`AuthRequirement`): - `apiKey` — DashScope / OpenAI-compatible 模型域,用 API key 与 model base URL -- `console` — Bailian Console Gateway,用 console access token + region/site/switchAgent/workspace +- `console` — Bailian Console Gateway,用 console access token + region/site/switchAgent;`workspace_id` 是独立的 Settings 作用域,不属于 credential - `openapi` — 阿里云 OpenAPI 签名域,用 AccessKey ID/Secret 调用 Token Plan 等 OpenAPI - `none` — 本地命令、登录/配置类命令、无需 credential 的命令 @@ -35,7 +35,7 @@ defineCommand({ auth }) → runtime/authStage → ctx.client → command.run(ctx - `bl auth login --api-key ...` 只更新 `api_key` / `base_url` - `bl auth login --console` 只更新 `access_token` 以及回调携带的 console 作用域字段 -- `bl auth login --open-api ...` 只更新 `access_key_id` / `access_key_secret` +- `bl auth login --open-api ...` 更新 `access_key_id` / `access_key_secret`,同时会调用 OpenAPI 生成 CLI `access_token` 并一并写入;即一次 `--open-api` 登录同时产生 `openapi` 与 `console` 域凭证 - `bl auth logout --console` 只清 `access_token` - `bl auth logout --open-api` 只清 `access_key_id` / `access_key_secret` / `security_token` - `bl auth logout` 清 `api_key` + `base_url` + `access_token` + `access_key_*` @@ -78,6 +78,9 @@ defineCommand({ auth }) → runtime/authStage → ctx.client → command.run(ctx - 如新增鉴权域,扩展 `AuthRequirement` - 更新 `credentialFlagDefs()` 暴露该域可见的 flag - 必要时新增 `*_AUTH_FLAGS` + - `workspace_id` 是作用域字段而非 credential,不要把它放进 `ConsoleCredential`;读取方式按命令 `auth` 域区分: + - `auth: "console"` 命令通过 `CONSOLE_AUTH_FLAGS` 自动获得 `--workspace-id`,由 `buildSettings()` 解析到 `settings.workspaceId`,命令统一从 `settings.workspaceId` 读取 + - `auth: "apiKey"`/`"openapi"`/`"none"` 命令如需 `--workspace-id`,必须自声明 flag;因它不会进入 credential/global flags,命令从 `ctx.flags.workspaceId` 读取(可回退到 `settings.workspaceId`) - [ ] `packages/core/src/auth/types.ts`: - 新增 credential 类型 / source / scope 字段 - [ ] `packages/core/src/auth/resolver.ts`: @@ -131,6 +134,8 @@ defineCommand({ auth }) → runtime/authStage → ctx.client → command.run(ctx ## 完成后自查 +本仓库同时存在 `bl`(packages/cli) 与 `kscli`(packages/kscli) 两个入口,二者共享 core/runtime 鉴权链路,但暴露的命令不同。如果改动会影响两个入口共用的命令或错误提示,再分别验证它们各自实际暴露的路径;不要假设 `kscli` 也有 `bl auth *` 命令。 + ```sh # 各种凭证组合 unset DASHSCOPE_API_KEY ALIBABA_CLOUD_ACCESS_KEY_ID ALIBABA_CLOUD_ACCESS_KEY_SECRET @@ -150,9 +155,11 @@ Console 登录/网关相关改动: ```sh pnpm -F bailian-cli exec tsx src/main.ts auth login --console -pnpm -F bailian-cli exec tsx src/main.ts usage stats --dry-run --output json +pnpm -F bailian-cli exec tsx src/main.ts usage stats --dry-run --output json --workspace-id ws-xxx ``` +注意:`usage stats --dry-run` 仍会先校验 workspace,必须传入 `--workspace-id`(或 `BAILIAN_WORKSPACE_ID` / config `workspace_id`)。 + ## 常见漏点 - ✗ 加了新 token 来源但忘了改 resolver 优先级,实际不生效 From 03839766bc644e5036f7fa7c80fb151cdea66a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A5=E9=BA=92?= Date: Fri, 7 Aug 2026 17:15:26 +0800 Subject: [PATCH 2/2] docs: update READMEs --- README.md | 206 +++++++++++++------------------------ README.zh.md | 207 +++++++++++++------------------------- packages/cli/README.md | 206 +++++++++++++------------------------ packages/cli/README.zh.md | 207 +++++++++++++------------------------- 4 files changed, 284 insertions(+), 542 deletions(-) diff --git a/README.md b/README.md index bced4e78..dc019efb 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,9 @@ --- -_Chat with Qwen, generate images & videos, understand images, call agents,_ -_manage memory, search the web — all from your terminal._ +_Chat with Qwen, generate and edit images and videos, understand images, synthesize_ +_and recognize speech, call apps, manage memory, retrieve knowledge, search the web —_ +_every AI capability, one command away._ _Built for AI Agents. Every command works as a structured tool call._ @@ -22,28 +23,16 @@ _Built for AI Agents. Every command works as a structured tool call._ ## Features -Equip your AI Agent out-of-the-box with these capabilities, composable across complex tasks: +- **Model generation** — Full-modality generation across text, image, video, and speech, with editing and reference-based generation +- **Asset understanding** — Parse and ask questions about images, documents, audio, and long videos +- **App orchestration** — Call Managed Agents, agents, and workflows published on Aliyun Model Studio, wired to knowledge bases, memory, web search, and MCP tools +- **Training & deployment** — Validate and upload datasets, fine-tune models, deploy dedicated models as endpoints +- **Account operations** — Login, UI-based configuration, model marketplace, usage and quota, rate-limit increases, team seat management +- **Plan onboarding** — Connect subscription plans such as Token Plan to the CLI and common coding agents in one step -- **Text chat** — Qwen3.8-max: major gains in agentic coding, frontend coding, and vibe coding -- **Multimodal (Omni)** — Full omni-modal support across text + image + audio + video -- **Image generation & editing** — Qwen-Image 3.0: pro text rendering, photorealism, strong semantic adherence, multi-image composition -- **Video generation & editing** — happyhorse-1.1 series: text-/image-/reference-to-video and natural-language video editing (up to 9-image reference) -- **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 -- **Image & video understanding** — Qwen-VL: long-form video analysis, chart/document parsing, visual reasoning, multilingual OCR -- **Coding agent setup** — Configure Claude Code, Qwen Code, OpenCode, OpenClaw, Hermes Agent, or Codex to use DashScope with `bl config agent` +> **Note:** App orchestration, training & deployment, account operations, and plan onboarding are currently available only to China site (aliyun.com) account holders and are not yet supported for international / global site accounts. -> **Note:** The features below are currently available only to China site (aliyun.com) account holders and are not yet supported for international / global site accounts. - -- **Knowledge base & memory** — Multimodal RAG retrieval and cross-session memory for personalized, coherent dialogue -- **App calls** — Invoke agents and workflows already published on Aliyun Model Studio -- **MCP integration** — Orchestrate Bailian MCP servers: list services, inspect tools, and invoke any tool directly from the terminal -- **Web search** — Real-time internet retrieval for up-to-date, accurate answers -- **Model recommendation** — Describe your scenario and get best-fit model suggestions; supports scoped search, model comparison, and alternative discovery -- **Fine-tuning & deployment** — Upload datasets, create text/audio/image fine-tune jobs (`finetune text|audio|image create`; text covers SFT/LoRA/DPO/CPT), probe job status non-blockingly (`finetune watch`), query per-model training capability (`finetune capability`), and deploy trained models as endpoints (`deploy text|audio|image create`) -- **Console capabilities** — Browse the model marketplace (`model list`) and Bailian apps (`app list`), review a unified usage view (`usage summary`), check free-tier quota (`usage free`), view model usage statistics (`usage stats`), manage workspaces (`workspace list`), and manage rate limits (`quota list/request/check/history`) -- **Local file auto-upload** — Every URL parameter accepts a local path; uploaded to free temp storage with 48-hour validity - -## Showcase: One-Sentence Cinematic Video +## Showcase 1: A Cinematic Short Film from One Sentence

@@ -56,129 +45,77 @@ Equip your AI Agent out-of-the-box with these capabilities, composable across co 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: - **[Qwen Code](https://github.com/QwenLM/qwen-code)** — the agentic coding model that interprets the user's intent and drives the workflow -- **[Aliyun Model Studio CLI](https://bailian.console.aliyun.com/cli?source_channel=cli_github&)** — invokes **HappyHorse 1.1**, Aliyun Model Studio's text-/image-/reference-to-video generation model +- **[Aliyun Model Studio CLI](https://github.com/modelstudioai/cli/)** — invokes **HappyHorse 1.1**, Aliyun Model Studio's text-/image-/reference-to-video generation model - **[spark-video Skill](https://github.com/JohnKeating1997/spark-video)** — handles scene decomposition, storyboarding, shot continuity, and final stitching ### The single prompt > _"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."_ -> -> _(Original: "帮我生成一段日系影视风格,高中女生的青涩初恋故事,剧情高甜,让人看了想谈恋爱,2分钟左右的视频,尺寸是16:9")_ - -### How it works - -1. **Qwen Code** parses the request, plans the narrative beats, and decides which tools to call. -2. The **spark-video Skill** breaks the story into shots, writes per-shot prompts, and enforces visual continuity (characters, lighting, palette, lens language). -3. **`bl video generate`** dispatches each shot to **HappyHorse 1.1** in parallel. -4. The skill stitches all clips back together into a single 16:9 / ~2-min deliverable. - -No timeline scrubbing. No frame-by-frame editing. Just one sentence → one video. - -## Installation -```bash -# Recommended — no Node required -curl -fsSL https://bailian.aliyun.com/cli/install.sh | bash +## Showcase 2: A Short-Film Director Managed Agent from One Sentence -# Windows (PowerShell) -irm https://bailian.aliyun.com/cli/install.ps1 | iex +

+ + Click to play the demo video + +

-# Node users / developers (Node.js >= 18.17) -npm install -g bailian-cli +

👆 Click the cover to play the full demo

-# Agent skills -npx skills add modelstudioai/cli --all -g -``` +One sentence builds a reusable cloud-side short-film director for storyboarding, storyboard image generation, and video creation: -> Binary install does not require Node.js. `npm install -g` remains fully supported. +- **[Qwen Code](https://github.com/QwenLM/qwen-code)** — understands the requirement and generates the agent configuration +- **[Aliyun Model Studio CLI](https://github.com/modelstudioai/cli/)** — validates the configuration, previews the changes, and completes the deployment +- **[Managed Agent](https://bailian.console.aliyun.com/cn-beijing/?tab=managed-agents#/managed-agents/quick-start)** — runs the director role along with its skills and tools in the cloud -## Quick Start - -```bash -# Authenticate, recommended -bl auth login --console +### The single prompt -# Or authenticate with an API key -bl auth login --api-key sk-xxxxx +> _"Build me a Managed Agent app that can produce short films — a director expert that generates videos and can also design the matching storyboards."_ -# Or use Token Plan (Base URL built in; the key is tested during login) -bl auth login --config token-plan --api-key sk-sp-xxxxx +## Installation -# Configure a coding agent to use DashScope -bl config agent --agent codex --base-url https://dashscope.aliyuncs.com/compatible-mode/v1 --api-key sk-xxxxx --model qwen3-coder-plus +**Agent install (recommended)** -# Chat with Qwen -bl text chat --message "What is DashScope?" +Send the following to your Agent — it will detect your environment, then install and verify the CLI for you: -# Multimodal chat (text + image + audio + video) -bl omni --message "Describe this image" --image ./photo.jpg +```text +Please read https://bailian.aliyun.com/cli/install.md and install the Aliyun Model Studio CLI for me +``` -# Generate an image -bl image generate --prompt "A cat in a spacesuit" --out-dir ./images/ +**Manual install (npm)** -# Generate a video from local image -bl video generate --image ./cat.png --prompt "Make the cat move" --download cat.mp4 +```bash +npm install -g bailian-cli +npx skills add modelstudioai/cli --all -g +``` -# Model recommendation — find the best model for your use case -bl advisor recommend --message "I need a visual-understanding chatbot" +> Requires Node.js >= 18.17. -# Compare specific models -bl advisor recommend --message "qwen-max vs deepseek-v3 for code generation" +## Quick Start -# Browser login (required for console capability commands) -bl auth login --console +Once installed, just describe your task to your AI Agent — no need to assemble commands by hand. -# Fine-tune & deploy — a one-shot train-to-serve workflow -bl dataset upload --file ./train.jsonl # Upload a .jsonl dataset (validated first) -bl finetune text create --model qwen3-8b --datasets ./train.jsonl --training-type sft-lora # Local paths auto-upload -bl finetune watch --job-id ft-xxx --output json # Non-blocking probe (running/succeeded return 0; failed/canceled report an error) -bl finetune capability --model qwen3-8b # Which training types a model supports -bl deploy text create --model qwen3-8b --name my-svc --plan mu # Deploy the trained model as an endpoint - -# Browse models / apps / free-tier quota / usage statistics / workspaces -bl model list # Browse model families and pricing -bl app list -bl usage summary # Unified view: free-tier quota + recent usage overview -bl usage free # Free-tier quota across models (add --model/--expiring/--sort) -bl usage stats --workspace-id # Model usage statistics (add --model for per-model) -bl workspace list # List all workspaces - -# Rate limit management (list / check / request / history) -bl quota list # View RPM/TPM limits (add --model to filter) -bl quota check # Current usage vs rate limits (add --model/--period) -bl quota request --model qwen3.6-plus --tpm 6000000 # Request a temporary TPM increase -bl quota history # View quota-change history - -# Token Plan team management (requires AK/SK, see auth below) -bl token-plan list-seats # View subscription seat details -bl token-plan add-member --account-name dev --org-id org_xxx -bl token-plan assign-seats --workspace-id ws_xxx --seat-type standard --account-id acc_xxx -bl token-plan create-key --account-id acc_xxx --workspace-id ws_xxx -``` +| Scenario | What to say to your Agent | +| ------------------------ | --------------------------------------------------------------------------------- | +| Managed Agent | "Create a Managed Agent that can generate short-film storyboards and videos." | +| Image & video generation | "Generate an image of a cat in a spacesuit on Mars, then turn it into a video." | +| Usage & quota | "Show my recent model usage, free-tier quota, and rate limits." | +| Model selection | "Recommend a model for image understanding and customer support." | +| About Bailian CLI | "Tell me what Bailian CLI can do for me, and suggest how to use it for my needs." | > More examples and scenarios: [Aliyun Model Studio CLI Site](https://bailian.console.aliyun.com/cli?source_channel=cli_github&) ## Authentication -### DashScope API Key +### API Key Required for most commands. Get your key from the [DashScope Console](https://bailian.console.aliyun.com/cn-beijing/?source_channel=key_github&tab=app#/api-key). ```bash -# Option 1: Environment variable -export DASHSCOPE_API_KEY=sk-xxxxx - -# Option 2: Login command (persisted to ~/.bailian/config.json) bl auth login --api-key sk-xxxxx - -# Option 3: Per-command flag -bl text chat --api-key sk-xxxxx --message "Hello" ``` -### Token Plan API Key - -Get or copy the API key from the [Token Plan subscription overview](https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview). -The CLI has the default Token Plan Base URL built in. Login tests the key first, then saves and activates the `token-plan` config only when validation succeeds. +Get or copy your Token Plan API key from the [Token Plan subscription overview](https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview). ```bash bl auth login --config token-plan --api-key sk-sp-xxxxx @@ -186,26 +123,20 @@ bl auth login --config token-plan --api-key sk-sp-xxxxx ### Console Login (OAuth) -Required for console capability commands (`model list`, `app list`, `usage summary/free/stats`, `workspace list`, `quota list/request/check/history`). Opens the Bailian console in your browser to sign in. +Required for console capability commands (model list, app list, MCP list, workspace, usage queries, rate-limit increases, direct console calls). Opens the Bailian console in your browser to sign in. ```bash bl auth login --console ``` -### Alibaba Cloud OpenAPI AK/SK (Token Plan only) +### Alibaba Cloud OpenAPI AK/SK -Required for the `token-plan` command group. Get your AccessKey from [RAM Console](https://ram.console.aliyun.com/manage/ak). +Token Plan seat and member management requires an Alibaba Cloud AccessKey. Get yours from the [RAM Console](https://ram.console.aliyun.com/manage/ak). > Recommended: create a RAM sub-account with minimum privileges instead of using the root account's AK/SK. ```bash -# Option 1: Login command (persisted to ~/.bailian/config.json) bl auth login --open-api --access-key-id LTAI5t... --access-key-secret ... - -# Option 2: Environment variables -export ALIBABA_CLOUD_ACCESS_KEY_ID=LTAI5t... -export ALIBABA_CLOUD_ACCESS_KEY_SECRET=... -export BAILIAN_WORKSPACE_ID=ws-... ``` ## Configuration @@ -214,18 +145,31 @@ export BAILIAN_WORKSPACE_ID=ws-... # View current config bl config show -# Set defaults -bl config set --key base_url --value https://dashscope-us.aliyuncs.com -bl config set --key default_text_model --value qwen-turbo -bl config set --key timeout --value 600 +# List all config profiles +bl config list -# Self-update to latest or a specific version -bl update -bl update --to 0.1.14 +# Switch config profile +bl config use --name token-plan ``` Config file location: `~/.bailian/config.json` +## Update + +```bash +bl update +``` + +Upgrades the CLI to the latest version and refreshes the installed Agent Skills. Release notes for every version live in [CHANGELOG.md](https://github.com/modelstudioai/cli/blob/main/CHANGELOG.md). + +## Contributing + +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. + +Scan the QR code to join the Aliyun Model Studio CLI DingTalk user group for usage help, troubleshooting, bug reports, and tips from other users. + +Aliyun Model Studio CLI DingTalk user group + ## Links | Resource | URL | @@ -237,11 +181,3 @@ Config file location: `~/.bailian/config.json` | Get API Key | https://bailian.console.aliyun.com/cn-beijing/?source_channel=key_github&tab=app#/api-key | | Get Token Plan API Key | https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview | | Get AccessKey | https://ram.console.aliyun.com/manage/ak | - -## Changelog - -Release notes for every version live in [CHANGELOG.md](https://github.com/modelstudioai/cli/blob/main/CHANGELOG.md). - -## Contributing - -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. diff --git a/README.zh.md b/README.zh.md index d09397c3..aa00be96 100644 --- a/README.zh.md +++ b/README.zh.md @@ -22,28 +22,16 @@ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_ ## 功能特性 -让您的 AI Agent 开箱即具备以下能力,并可在复杂任务中自动组合调用: +- **模型生成** — 文本、图像、视频、语音全模态生成,支持编辑与参考生成 +- **素材理解** — 图像、文档、音频、长视频的解析与问答 +- **应用编排** — 调用百炼已发布的 Managed Agent、智能体和工作流,接入知识库、记忆库、联网搜索与 MCP 工具 +- **模型训推** — 数据集校验上传、模型精调、专属模型部署上线 +- **账号运维** — 授权登录、界面化配置、模型市场、用量与额度、限流提额、团队席位管理 +- **套餐接入** — 支持 Token Plan 等订阅计划一键接到 CLI 和常见 Coding Agent -- **文本对话** — Qwen3.8-max:Agentic coding、前端编程、Vibe coding 等能力显著增强 -- **全模态对话** — 文本 + 图像 + 音频 + 视频全模态支持 -- **图像生成与编辑** — Qwen-Image 3.0:专业文字渲染、真实质感、强语义遵循、多图合成 -- **视频生成与编辑** — happyhorse-1.1 系列,支持文生 / 图生 / 参考生(最多 9 张图参考)/ 自然语言视频编辑 -- **语音合成与识别** — CosyVoice 实时流式合成,5-20s 样本即可克隆;FunAudio-ASR 覆盖 30 种语种,含汉语七大方言与 20+ 口音官话 -- **图像与视频理解** — Qwen-VL:长视频解析、复杂图表与文档识别、视觉推理、多语种 OCR -- **Coding Agent 配置** — 使用 `bl config agent` 将 Claude Code、Qwen Code、OpenCode、OpenClaw、Hermes Agent 或 Codex 配置为使用 DashScope +> **注意:** 应用编排、模型训推、账号运维和套餐接入目前仅支持中国站(aliyun.com)账号,暂不支持国际站 / 全球站账号。 -> **注意:** 以下功能目前仅对中国站(aliyun.com)账号开放,国际站 / 全球站账号暂不支持。 - -- **知识库与记忆库** — 多模态 RAG 检索 + 跨会话记忆,提供个性化连贯对话体验 -- **应用调用** — 调用已发布在阿里云百炼平台上的智能体与工作流应用 -- **MCP 集成** — 统一调度百炼 MCP 服务:列出服务、查看工具、直接在终端调用任意工具 -- **联网搜索** — 实时互联网信息检索,提升回答准确性及时效性 -- **模型推荐** — 描述你的场景,智能推荐最适合的模型;支持限定范围搜索、模型对比和替代发现 -- **微调与部署** — 上传数据集、创建文本/音频/图像调优任务(`finetune text|audio|image create`;文本涵盖 SFT/LoRA/DPO/CPT)、非阻塞探测任务状态(`finetune watch`)、按模型查训练能力(`finetune capability`),并把训练好的模型部署为推理服务(`deploy text|audio|image create`) -- **控制台能力** — 浏览模型市场(`model list`)和百炼应用(`app list`),查看统一用量视图(`usage summary`),查询模型免费额度(`usage free`),查看模型用量统计(`usage stats`),管理业务空间(`workspace list`),管理限流与提额(`quota list/request/check/history`) -- **本地文件自动上传** — 所有 URL 参数同时支持本地路径,免费临时存储 48 小时 - -## 示例:一句话生成一部电影短片 +## 示例 1:一句话生成一部电影短片

@@ -53,130 +41,80 @@ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_

👆 点击封面播放完整 2 分钟演示

-一部完整的 **2 分钟、16:9 电影感短片** —— 由一句自然语言端到端生成,**全程零手动剪辑**。这个示例展示了 AI Agent 如何把三个基础能力编排成一条多步创作流水线: +一部完整的 **2 分钟、16:9 电影感短片** —— 由一句自然语言端到端生成,**全程零手动剪辑**。这个示例展示了 AI Agent 如何把三个基础能力编排成一条多步创作流水线: -- **[Qwen Code](https://github.com/QwenLM/qwen-code)** —— Agentic coding 模型,解析用户意图、驱动整个工作流 -- **[阿里云百炼 CLI](https://github.com/modelstudioai/cli/)** —— 调用 **HappyHorse 1.1**,百炼的文生/图生/参考生视频模型 +- **[Qwen Code](https://github.com/QwenLM/qwen-code)** —— Agentic coding 模型,解析用户意图、驱动整个工作流 +- **[阿里云百炼 CLI](https://github.com/modelstudioai/cli/)** —— 调用 **HappyHorse 1.1**,百炼的文生/图生/参考生视频模型 - **[spark-video Skill](https://github.com/JohnKeating1997/spark-video)** —— 负责场景拆分、分镜设计、镜头连贯性和最终拼接 ### 唯一的提示词 -> _"帮我生成一段日系影视风格,高中女生的青涩初恋故事,剧情高甜,让人看了想谈恋爱,2 分钟左右的视频,尺寸是 16:9"_ - -### 工作流程 - -1. **Qwen Code** 解析需求、规划叙事节奏,决定要调用哪些工具。 -2. **spark-video Skill** 把故事拆成镜头、为每个镜头写提示词,并保证视觉连贯性(角色、光线、色调、镜头语言)。 -3. **`bl video generate`** 把每个镜头并行下发给 **HappyHorse 1.1**。 -4. Skill 把所有片段拼成最终的 16:9 / 约 2 分钟成片。 - -没有时间线拖拽,没有逐帧剪辑。一句话 → 一部短片。 - -## 安装 +> _“帮我生成一段日系影视风格,高中女生的青涩初恋故事,剧情高甜,让人看了想谈恋爱,2 分钟左右的视频,尺寸是 16:9。”_ -```bash -# 推荐 — 无需本机 Node.js -curl -fsSL https://bailian.aliyun.com/cli/install.sh | bash +## 示例 2:一句话构建短片导演 Managed Agent -# Windows(PowerShell) -irm https://bailian.aliyun.com/cli/install.ps1 | iex +

+ + 点击播放演示视频 + +

-# Node 用户 / 开发者(需要 Node.js >= 18.17) -npm install -g bailian-cli +

👆 点击封面播放完整演示

-# Agent skills -npx skills add modelstudioai/cli --all -g -``` +一句话构建一个可复用的云端短片导演,用于分镜设计、分镜图生成和视频创作: -> 二进制安装不依赖 Node.js。`npm install -g` 长期保留。 +- **[Qwen Code](https://github.com/QwenLM/qwen-code)** —— 理解需求并生成 Agent 配置 +- **[阿里云百炼 CLI](https://github.com/modelstudioai/cli/)** —— 校验配置、预览变更并完成部署 +- **[Managed Agent](https://bailian.console.aliyun.com/cn-beijing/?tab=managed-agents#/managed-agents/quick-start)** —— 在云端运行导演角色及其 Skill 和工具 -## 快速开始 - -```bash -# 认证(推荐浏览器登录) -bl auth login --console +### 唯一的提示词 -# 或使用 API key 认证 -bl auth login --api-key sk-xxxxx +> _“帮我构建一个 managedagent 应用,能够实现短片拍摄,导演专家生成视频,然后也能进行设计对应的分镜图。”_ -# 或使用 Token Plan(已内置 Base URL,登录时自动测试 Key) -bl auth login --config token-plan --api-key sk-sp-xxxxx +## 安装 -# 配置 Coding Agent 使用 DashScope -bl config agent --agent codex --base-url https://dashscope.aliyuncs.com/compatible-mode/v1 --api-key sk-xxxxx --model qwen3-coder-plus +**Agent 安装(推荐)** -# 和通义千问对话 -bl text chat --message "你好,介绍一下阿里云百炼平台" +把下面这句话发给你的 Agent,它会自行判断环境并完成安装与校验: -# 多模态对话(文本 + 图片 + 音频 + 视频) -bl omni --message "描述这张图片" --image ./photo.jpg +```text +请阅读:https://bailian.aliyun.com/cli/install.md 并按照说明为我安装阿里云百炼 CLI +``` -# 生成图片 -bl image generate --prompt "一只穿太空服的猫在火星上" --out-dir ./images/ +**手动安装(npm)** -# 图生视频(本地文件自动上传) -bl video generate --image ./cat.png --prompt "让画面中的猫动起来" --download cat.mp4 +```bash +npm install -g bailian-cli +npx skills add modelstudioai/cli --all -g +``` -# 模型推荐 — 根据场景推荐最适合的模型 -bl advisor recommend --message "我要做一个能理解图片的客服机器人" +> 需要预先安装 Node.js >= 18.17。 -# 对比特定模型 -bl advisor recommend --message "qwen-max 和 deepseek-v3 哪个更适合做代码生成" +## 快速开始 -# 浏览器登录(控制台能力相关命令需要) -bl auth login --console +安装完成后,直接在 AI Agent 中描述你的任务,无需手动拼接命令。 -# 微调与部署 — 从训练到服务的一站式流程 -bl dataset upload --file ./train.jsonl # 上传 .jsonl 数据集(先校验) -bl finetune text create --model qwen3-8b --datasets ./train.jsonl --training-type sft-lora # 本地路径自动上传 -bl finetune watch --job-id ft-xxx --output json # 非阻塞探测(运行中/成功返回 0;失败/取消报错) -bl finetune capability --model qwen3-8b # 查询模型支持哪些训练方式 -bl deploy text create --model qwen3-8b --name my-svc --plan mu # 把训练好的模型部署为推理服务 - -# 浏览模型 / 应用 / 免费额度 / 用量统计 / 业务空间 -bl model list # 浏览模型系列与价格信息 -bl app list -bl usage summary # 统一视图:免费额度 + 近期用量概览 -bl usage free # 各模型免费额度(可加 --model/--expiring/--sort) -bl usage stats --workspace-id # 模型用量统计(加 --model 查单模型) -bl workspace list # 列出所有业务空间 - -# 限流管理与提额(list / check / request / history) -bl quota list # 查看 RPM/TPM 限额(加 --model 过滤) -bl quota check # 当前用量 vs 限流阈值(加 --model/--period) -bl quota request --model qwen3.6-plus --tpm 6000000 # 申请临时 TPM 提额 -bl quota history # 查看提额历史记录 - -# Token Plan 团队版管理(需 AK/SK,见下方认证说明) -bl token-plan list-seats # 查看订阅席位明细 -bl token-plan add-member --account-name dev --org-id org_xxx -bl token-plan assign-seats --workspace-id ws_xxx --seat-type standard --account-id acc_xxx -bl token-plan create-key --account-id acc_xxx --workspace-id ws_xxx -``` +| 场景 | 可以这样对 Agent 说 | +| ---------------- | ----------------------------------------------------------------------- | +| Managed Agent | “帮我创建一个能够生成短片分镜和视频的 Managed Agent。” | +| 图片和视频生成 | “生成一张穿着太空服的猫站在火星上的图片,再把它制作成一段视频。” | +| 用量与额度 | “查看最近的模型用量、免费额度和限流情况。” | +| 模型选型 | “推荐一个适合图片理解和智能客服的模型。” | +| 了解 Bailian CLI | “介绍一下 Bailian CLI 能帮我完成哪些任务,并根据我的需求推荐使用方式。” | > 更多案例与使用场景:[阿里云百炼 CLI 官方主页](https://bailian.console.aliyun.com/cli?source_channel=cli_github&) ## 认证方式 -### DashScope API Key +### API Key 大部分命令均需要 API Key。前往 [DashScope 控制台](https://bailian.console.aliyun.com/cn-beijing/?source_channel=key_github&tab=app#/api-key) 获取。 ```bash -# 方式一:环境变量 -export DASHSCOPE_API_KEY=sk-xxxxx - -# 方式二:登录命令(持久化到 ~/.bailian/config.json) bl auth login --api-key sk-xxxxx - -# 方式三:命令行参数 -bl text chat --api-key sk-xxxxx --message "你好" ``` -### Token Plan API Key - -前往 [Token Plan 订阅详情](https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview) 获取或复制 API Key。 -CLI 已内置 Token Plan 的默认 Base URL;登录命令会先测试 Key,通过后才保存并激活 `token-plan` 配置。 +Token Plan 的 API Key 前往 [Token Plan 订阅详情](https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview) 获取或复制。 ```bash bl auth login --config token-plan --api-key sk-sp-xxxxx @@ -184,26 +122,20 @@ bl auth login --config token-plan --api-key sk-sp-xxxxx ### 控制台登录(OAuth) -控制台能力命令(`model list`、`app list`、`usage summary/free/stats`、`workspace list`、`quota list/request/check/history`)需要使用此登录方式。打开浏览器跳转百炼控制台完成登录。 +控制台能力命令(模型列表、应用列表、MCP 列表、工作空间、用量查询、限流提额、控制台直调)需要使用此登录方式。打开浏览器跳转百炼控制台完成登录。 ```bash bl auth login --console ``` -### 阿里云 OpenAPI AK/SK(仅 Token Plan) +### 阿里云 OpenAPI AK/SK -`token-plan` 命令组需要阿里云 AccessKey。前往 [RAM 控制台](https://ram.console.aliyun.com/manage/ak) 获取。 +Token Plan 的席位与成员管理需要阿里云 AccessKey。前往 [RAM 控制台](https://ram.console.aliyun.com/manage/ak) 获取。 > 建议:创建 RAM 子账号并授予最小权限,避免使用主账号 AK/SK。 ```bash -# 方式一:登录命令(持久化到 ~/.bailian/config.json) bl auth login --open-api --access-key-id LTAI5t... --access-key-secret ... - -# 方式二:环境变量 -export ALIBABA_CLOUD_ACCESS_KEY_ID=LTAI5t... -export ALIBABA_CLOUD_ACCESS_KEY_SECRET=... -export BAILIAN_WORKSPACE_ID=ws-... ``` ## 配置 @@ -212,20 +144,31 @@ export BAILIAN_WORKSPACE_ID=ws-... # 查看当前配置 bl config show -# 设置默认值 -bl config set --key base_url --value https://dashscope-us.aliyuncs.com -bl config set --key default_text_model --value qwen-turbo -bl config set --key timeout --value 600 +# 查看全部配置档 +bl config list -# 自更新到最新版本 -bl update - -# 安装指定版本 -bl update --to 0.1.14 +# 切换配置档 +bl config use --name token-plan ``` 配置文件位置:`~/.bailian/config.json` +## 更新 + +```bash +bl update +``` + +升级 CLI 至最新版本,并同步更新已安装的 Agent Skills。每个版本的变更详情记录在 [CHANGELOG.zh.md](https://github.com/modelstudioai/cli/blob/main/CHANGELOG.zh.md)。 + +## 参与贡献 + +欢迎提 Issue、Feature Request 和 PR。开发环境搭建、仓库结构、新增/修改命令的工作流请见 [CONTRIBUTING.zh.md](https://github.com/modelstudioai/cli/blob/main/CONTRIBUTING.zh.md)。 + +欢迎扫码加入阿里云百炼 CLI 钉钉用户交流群,获取使用答疑、问题排查、Bug 反馈和使用经验交流支持。 + +阿里云百炼 CLI 钉钉用户交流群 + ## 相关链接 | 资源 | 地址 | @@ -237,11 +180,3 @@ bl update --to 0.1.14 | 获取 API Key | https://bailian.console.aliyun.com/cn-beijing/?source_channel=key_github&tab=app#/api-key | | 获取 Token Plan API Key | https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview | | 获取 AccessKey | https://ram.console.aliyun.com/manage/ak | - -## 更新日志 - -每个版本的变更详情记录在 [CHANGELOG.zh.md](https://github.com/modelstudioai/cli/blob/main/CHANGELOG.zh.md)。 - -## 参与贡献 - -欢迎提 Issue、Feature Request 和 PR。开发环境搭建、仓库结构、新增/修改命令的工作流请见 [CONTRIBUTING.zh.md](https://github.com/modelstudioai/cli/blob/main/CONTRIBUTING.zh.md)。 diff --git a/packages/cli/README.md b/packages/cli/README.md index bced4e78..dc019efb 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -13,8 +13,9 @@ --- -_Chat with Qwen, generate images & videos, understand images, call agents,_ -_manage memory, search the web — all from your terminal._ +_Chat with Qwen, generate and edit images and videos, understand images, synthesize_ +_and recognize speech, call apps, manage memory, retrieve knowledge, search the web —_ +_every AI capability, one command away._ _Built for AI Agents. Every command works as a structured tool call._ @@ -22,28 +23,16 @@ _Built for AI Agents. Every command works as a structured tool call._ ## Features -Equip your AI Agent out-of-the-box with these capabilities, composable across complex tasks: +- **Model generation** — Full-modality generation across text, image, video, and speech, with editing and reference-based generation +- **Asset understanding** — Parse and ask questions about images, documents, audio, and long videos +- **App orchestration** — Call Managed Agents, agents, and workflows published on Aliyun Model Studio, wired to knowledge bases, memory, web search, and MCP tools +- **Training & deployment** — Validate and upload datasets, fine-tune models, deploy dedicated models as endpoints +- **Account operations** — Login, UI-based configuration, model marketplace, usage and quota, rate-limit increases, team seat management +- **Plan onboarding** — Connect subscription plans such as Token Plan to the CLI and common coding agents in one step -- **Text chat** — Qwen3.8-max: major gains in agentic coding, frontend coding, and vibe coding -- **Multimodal (Omni)** — Full omni-modal support across text + image + audio + video -- **Image generation & editing** — Qwen-Image 3.0: pro text rendering, photorealism, strong semantic adherence, multi-image composition -- **Video generation & editing** — happyhorse-1.1 series: text-/image-/reference-to-video and natural-language video editing (up to 9-image reference) -- **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 -- **Image & video understanding** — Qwen-VL: long-form video analysis, chart/document parsing, visual reasoning, multilingual OCR -- **Coding agent setup** — Configure Claude Code, Qwen Code, OpenCode, OpenClaw, Hermes Agent, or Codex to use DashScope with `bl config agent` +> **Note:** App orchestration, training & deployment, account operations, and plan onboarding are currently available only to China site (aliyun.com) account holders and are not yet supported for international / global site accounts. -> **Note:** The features below are currently available only to China site (aliyun.com) account holders and are not yet supported for international / global site accounts. - -- **Knowledge base & memory** — Multimodal RAG retrieval and cross-session memory for personalized, coherent dialogue -- **App calls** — Invoke agents and workflows already published on Aliyun Model Studio -- **MCP integration** — Orchestrate Bailian MCP servers: list services, inspect tools, and invoke any tool directly from the terminal -- **Web search** — Real-time internet retrieval for up-to-date, accurate answers -- **Model recommendation** — Describe your scenario and get best-fit model suggestions; supports scoped search, model comparison, and alternative discovery -- **Fine-tuning & deployment** — Upload datasets, create text/audio/image fine-tune jobs (`finetune text|audio|image create`; text covers SFT/LoRA/DPO/CPT), probe job status non-blockingly (`finetune watch`), query per-model training capability (`finetune capability`), and deploy trained models as endpoints (`deploy text|audio|image create`) -- **Console capabilities** — Browse the model marketplace (`model list`) and Bailian apps (`app list`), review a unified usage view (`usage summary`), check free-tier quota (`usage free`), view model usage statistics (`usage stats`), manage workspaces (`workspace list`), and manage rate limits (`quota list/request/check/history`) -- **Local file auto-upload** — Every URL parameter accepts a local path; uploaded to free temp storage with 48-hour validity - -## Showcase: One-Sentence Cinematic Video +## Showcase 1: A Cinematic Short Film from One Sentence

@@ -56,129 +45,77 @@ Equip your AI Agent out-of-the-box with these capabilities, composable across co 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: - **[Qwen Code](https://github.com/QwenLM/qwen-code)** — the agentic coding model that interprets the user's intent and drives the workflow -- **[Aliyun Model Studio CLI](https://bailian.console.aliyun.com/cli?source_channel=cli_github&)** — invokes **HappyHorse 1.1**, Aliyun Model Studio's text-/image-/reference-to-video generation model +- **[Aliyun Model Studio CLI](https://github.com/modelstudioai/cli/)** — invokes **HappyHorse 1.1**, Aliyun Model Studio's text-/image-/reference-to-video generation model - **[spark-video Skill](https://github.com/JohnKeating1997/spark-video)** — handles scene decomposition, storyboarding, shot continuity, and final stitching ### The single prompt > _"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."_ -> -> _(Original: "帮我生成一段日系影视风格,高中女生的青涩初恋故事,剧情高甜,让人看了想谈恋爱,2分钟左右的视频,尺寸是16:9")_ - -### How it works - -1. **Qwen Code** parses the request, plans the narrative beats, and decides which tools to call. -2. The **spark-video Skill** breaks the story into shots, writes per-shot prompts, and enforces visual continuity (characters, lighting, palette, lens language). -3. **`bl video generate`** dispatches each shot to **HappyHorse 1.1** in parallel. -4. The skill stitches all clips back together into a single 16:9 / ~2-min deliverable. - -No timeline scrubbing. No frame-by-frame editing. Just one sentence → one video. - -## Installation -```bash -# Recommended — no Node required -curl -fsSL https://bailian.aliyun.com/cli/install.sh | bash +## Showcase 2: A Short-Film Director Managed Agent from One Sentence -# Windows (PowerShell) -irm https://bailian.aliyun.com/cli/install.ps1 | iex +

+ + Click to play the demo video + +

-# Node users / developers (Node.js >= 18.17) -npm install -g bailian-cli +

👆 Click the cover to play the full demo

-# Agent skills -npx skills add modelstudioai/cli --all -g -``` +One sentence builds a reusable cloud-side short-film director for storyboarding, storyboard image generation, and video creation: -> Binary install does not require Node.js. `npm install -g` remains fully supported. +- **[Qwen Code](https://github.com/QwenLM/qwen-code)** — understands the requirement and generates the agent configuration +- **[Aliyun Model Studio CLI](https://github.com/modelstudioai/cli/)** — validates the configuration, previews the changes, and completes the deployment +- **[Managed Agent](https://bailian.console.aliyun.com/cn-beijing/?tab=managed-agents#/managed-agents/quick-start)** — runs the director role along with its skills and tools in the cloud -## Quick Start - -```bash -# Authenticate, recommended -bl auth login --console +### The single prompt -# Or authenticate with an API key -bl auth login --api-key sk-xxxxx +> _"Build me a Managed Agent app that can produce short films — a director expert that generates videos and can also design the matching storyboards."_ -# Or use Token Plan (Base URL built in; the key is tested during login) -bl auth login --config token-plan --api-key sk-sp-xxxxx +## Installation -# Configure a coding agent to use DashScope -bl config agent --agent codex --base-url https://dashscope.aliyuncs.com/compatible-mode/v1 --api-key sk-xxxxx --model qwen3-coder-plus +**Agent install (recommended)** -# Chat with Qwen -bl text chat --message "What is DashScope?" +Send the following to your Agent — it will detect your environment, then install and verify the CLI for you: -# Multimodal chat (text + image + audio + video) -bl omni --message "Describe this image" --image ./photo.jpg +```text +Please read https://bailian.aliyun.com/cli/install.md and install the Aliyun Model Studio CLI for me +``` -# Generate an image -bl image generate --prompt "A cat in a spacesuit" --out-dir ./images/ +**Manual install (npm)** -# Generate a video from local image -bl video generate --image ./cat.png --prompt "Make the cat move" --download cat.mp4 +```bash +npm install -g bailian-cli +npx skills add modelstudioai/cli --all -g +``` -# Model recommendation — find the best model for your use case -bl advisor recommend --message "I need a visual-understanding chatbot" +> Requires Node.js >= 18.17. -# Compare specific models -bl advisor recommend --message "qwen-max vs deepseek-v3 for code generation" +## Quick Start -# Browser login (required for console capability commands) -bl auth login --console +Once installed, just describe your task to your AI Agent — no need to assemble commands by hand. -# Fine-tune & deploy — a one-shot train-to-serve workflow -bl dataset upload --file ./train.jsonl # Upload a .jsonl dataset (validated first) -bl finetune text create --model qwen3-8b --datasets ./train.jsonl --training-type sft-lora # Local paths auto-upload -bl finetune watch --job-id ft-xxx --output json # Non-blocking probe (running/succeeded return 0; failed/canceled report an error) -bl finetune capability --model qwen3-8b # Which training types a model supports -bl deploy text create --model qwen3-8b --name my-svc --plan mu # Deploy the trained model as an endpoint - -# Browse models / apps / free-tier quota / usage statistics / workspaces -bl model list # Browse model families and pricing -bl app list -bl usage summary # Unified view: free-tier quota + recent usage overview -bl usage free # Free-tier quota across models (add --model/--expiring/--sort) -bl usage stats --workspace-id # Model usage statistics (add --model for per-model) -bl workspace list # List all workspaces - -# Rate limit management (list / check / request / history) -bl quota list # View RPM/TPM limits (add --model to filter) -bl quota check # Current usage vs rate limits (add --model/--period) -bl quota request --model qwen3.6-plus --tpm 6000000 # Request a temporary TPM increase -bl quota history # View quota-change history - -# Token Plan team management (requires AK/SK, see auth below) -bl token-plan list-seats # View subscription seat details -bl token-plan add-member --account-name dev --org-id org_xxx -bl token-plan assign-seats --workspace-id ws_xxx --seat-type standard --account-id acc_xxx -bl token-plan create-key --account-id acc_xxx --workspace-id ws_xxx -``` +| Scenario | What to say to your Agent | +| ------------------------ | --------------------------------------------------------------------------------- | +| Managed Agent | "Create a Managed Agent that can generate short-film storyboards and videos." | +| Image & video generation | "Generate an image of a cat in a spacesuit on Mars, then turn it into a video." | +| Usage & quota | "Show my recent model usage, free-tier quota, and rate limits." | +| Model selection | "Recommend a model for image understanding and customer support." | +| About Bailian CLI | "Tell me what Bailian CLI can do for me, and suggest how to use it for my needs." | > More examples and scenarios: [Aliyun Model Studio CLI Site](https://bailian.console.aliyun.com/cli?source_channel=cli_github&) ## Authentication -### DashScope API Key +### API Key Required for most commands. Get your key from the [DashScope Console](https://bailian.console.aliyun.com/cn-beijing/?source_channel=key_github&tab=app#/api-key). ```bash -# Option 1: Environment variable -export DASHSCOPE_API_KEY=sk-xxxxx - -# Option 2: Login command (persisted to ~/.bailian/config.json) bl auth login --api-key sk-xxxxx - -# Option 3: Per-command flag -bl text chat --api-key sk-xxxxx --message "Hello" ``` -### Token Plan API Key - -Get or copy the API key from the [Token Plan subscription overview](https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview). -The CLI has the default Token Plan Base URL built in. Login tests the key first, then saves and activates the `token-plan` config only when validation succeeds. +Get or copy your Token Plan API key from the [Token Plan subscription overview](https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview). ```bash bl auth login --config token-plan --api-key sk-sp-xxxxx @@ -186,26 +123,20 @@ bl auth login --config token-plan --api-key sk-sp-xxxxx ### Console Login (OAuth) -Required for console capability commands (`model list`, `app list`, `usage summary/free/stats`, `workspace list`, `quota list/request/check/history`). Opens the Bailian console in your browser to sign in. +Required for console capability commands (model list, app list, MCP list, workspace, usage queries, rate-limit increases, direct console calls). Opens the Bailian console in your browser to sign in. ```bash bl auth login --console ``` -### Alibaba Cloud OpenAPI AK/SK (Token Plan only) +### Alibaba Cloud OpenAPI AK/SK -Required for the `token-plan` command group. Get your AccessKey from [RAM Console](https://ram.console.aliyun.com/manage/ak). +Token Plan seat and member management requires an Alibaba Cloud AccessKey. Get yours from the [RAM Console](https://ram.console.aliyun.com/manage/ak). > Recommended: create a RAM sub-account with minimum privileges instead of using the root account's AK/SK. ```bash -# Option 1: Login command (persisted to ~/.bailian/config.json) bl auth login --open-api --access-key-id LTAI5t... --access-key-secret ... - -# Option 2: Environment variables -export ALIBABA_CLOUD_ACCESS_KEY_ID=LTAI5t... -export ALIBABA_CLOUD_ACCESS_KEY_SECRET=... -export BAILIAN_WORKSPACE_ID=ws-... ``` ## Configuration @@ -214,18 +145,31 @@ export BAILIAN_WORKSPACE_ID=ws-... # View current config bl config show -# Set defaults -bl config set --key base_url --value https://dashscope-us.aliyuncs.com -bl config set --key default_text_model --value qwen-turbo -bl config set --key timeout --value 600 +# List all config profiles +bl config list -# Self-update to latest or a specific version -bl update -bl update --to 0.1.14 +# Switch config profile +bl config use --name token-plan ``` Config file location: `~/.bailian/config.json` +## Update + +```bash +bl update +``` + +Upgrades the CLI to the latest version and refreshes the installed Agent Skills. Release notes for every version live in [CHANGELOG.md](https://github.com/modelstudioai/cli/blob/main/CHANGELOG.md). + +## Contributing + +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. + +Scan the QR code to join the Aliyun Model Studio CLI DingTalk user group for usage help, troubleshooting, bug reports, and tips from other users. + +Aliyun Model Studio CLI DingTalk user group + ## Links | Resource | URL | @@ -237,11 +181,3 @@ Config file location: `~/.bailian/config.json` | Get API Key | https://bailian.console.aliyun.com/cn-beijing/?source_channel=key_github&tab=app#/api-key | | Get Token Plan API Key | https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview | | Get AccessKey | https://ram.console.aliyun.com/manage/ak | - -## Changelog - -Release notes for every version live in [CHANGELOG.md](https://github.com/modelstudioai/cli/blob/main/CHANGELOG.md). - -## Contributing - -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. diff --git a/packages/cli/README.zh.md b/packages/cli/README.zh.md index d09397c3..aa00be96 100644 --- a/packages/cli/README.zh.md +++ b/packages/cli/README.zh.md @@ -22,28 +22,16 @@ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_ ## 功能特性 -让您的 AI Agent 开箱即具备以下能力,并可在复杂任务中自动组合调用: +- **模型生成** — 文本、图像、视频、语音全模态生成,支持编辑与参考生成 +- **素材理解** — 图像、文档、音频、长视频的解析与问答 +- **应用编排** — 调用百炼已发布的 Managed Agent、智能体和工作流,接入知识库、记忆库、联网搜索与 MCP 工具 +- **模型训推** — 数据集校验上传、模型精调、专属模型部署上线 +- **账号运维** — 授权登录、界面化配置、模型市场、用量与额度、限流提额、团队席位管理 +- **套餐接入** — 支持 Token Plan 等订阅计划一键接到 CLI 和常见 Coding Agent -- **文本对话** — Qwen3.8-max:Agentic coding、前端编程、Vibe coding 等能力显著增强 -- **全模态对话** — 文本 + 图像 + 音频 + 视频全模态支持 -- **图像生成与编辑** — Qwen-Image 3.0:专业文字渲染、真实质感、强语义遵循、多图合成 -- **视频生成与编辑** — happyhorse-1.1 系列,支持文生 / 图生 / 参考生(最多 9 张图参考)/ 自然语言视频编辑 -- **语音合成与识别** — CosyVoice 实时流式合成,5-20s 样本即可克隆;FunAudio-ASR 覆盖 30 种语种,含汉语七大方言与 20+ 口音官话 -- **图像与视频理解** — Qwen-VL:长视频解析、复杂图表与文档识别、视觉推理、多语种 OCR -- **Coding Agent 配置** — 使用 `bl config agent` 将 Claude Code、Qwen Code、OpenCode、OpenClaw、Hermes Agent 或 Codex 配置为使用 DashScope +> **注意:** 应用编排、模型训推、账号运维和套餐接入目前仅支持中国站(aliyun.com)账号,暂不支持国际站 / 全球站账号。 -> **注意:** 以下功能目前仅对中国站(aliyun.com)账号开放,国际站 / 全球站账号暂不支持。 - -- **知识库与记忆库** — 多模态 RAG 检索 + 跨会话记忆,提供个性化连贯对话体验 -- **应用调用** — 调用已发布在阿里云百炼平台上的智能体与工作流应用 -- **MCP 集成** — 统一调度百炼 MCP 服务:列出服务、查看工具、直接在终端调用任意工具 -- **联网搜索** — 实时互联网信息检索,提升回答准确性及时效性 -- **模型推荐** — 描述你的场景,智能推荐最适合的模型;支持限定范围搜索、模型对比和替代发现 -- **微调与部署** — 上传数据集、创建文本/音频/图像调优任务(`finetune text|audio|image create`;文本涵盖 SFT/LoRA/DPO/CPT)、非阻塞探测任务状态(`finetune watch`)、按模型查训练能力(`finetune capability`),并把训练好的模型部署为推理服务(`deploy text|audio|image create`) -- **控制台能力** — 浏览模型市场(`model list`)和百炼应用(`app list`),查看统一用量视图(`usage summary`),查询模型免费额度(`usage free`),查看模型用量统计(`usage stats`),管理业务空间(`workspace list`),管理限流与提额(`quota list/request/check/history`) -- **本地文件自动上传** — 所有 URL 参数同时支持本地路径,免费临时存储 48 小时 - -## 示例:一句话生成一部电影短片 +## 示例 1:一句话生成一部电影短片

@@ -53,130 +41,80 @@ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_

👆 点击封面播放完整 2 分钟演示

-一部完整的 **2 分钟、16:9 电影感短片** —— 由一句自然语言端到端生成,**全程零手动剪辑**。这个示例展示了 AI Agent 如何把三个基础能力编排成一条多步创作流水线: +一部完整的 **2 分钟、16:9 电影感短片** —— 由一句自然语言端到端生成,**全程零手动剪辑**。这个示例展示了 AI Agent 如何把三个基础能力编排成一条多步创作流水线: -- **[Qwen Code](https://github.com/QwenLM/qwen-code)** —— Agentic coding 模型,解析用户意图、驱动整个工作流 -- **[阿里云百炼 CLI](https://github.com/modelstudioai/cli/)** —— 调用 **HappyHorse 1.1**,百炼的文生/图生/参考生视频模型 +- **[Qwen Code](https://github.com/QwenLM/qwen-code)** —— Agentic coding 模型,解析用户意图、驱动整个工作流 +- **[阿里云百炼 CLI](https://github.com/modelstudioai/cli/)** —— 调用 **HappyHorse 1.1**,百炼的文生/图生/参考生视频模型 - **[spark-video Skill](https://github.com/JohnKeating1997/spark-video)** —— 负责场景拆分、分镜设计、镜头连贯性和最终拼接 ### 唯一的提示词 -> _"帮我生成一段日系影视风格,高中女生的青涩初恋故事,剧情高甜,让人看了想谈恋爱,2 分钟左右的视频,尺寸是 16:9"_ - -### 工作流程 - -1. **Qwen Code** 解析需求、规划叙事节奏,决定要调用哪些工具。 -2. **spark-video Skill** 把故事拆成镜头、为每个镜头写提示词,并保证视觉连贯性(角色、光线、色调、镜头语言)。 -3. **`bl video generate`** 把每个镜头并行下发给 **HappyHorse 1.1**。 -4. Skill 把所有片段拼成最终的 16:9 / 约 2 分钟成片。 - -没有时间线拖拽,没有逐帧剪辑。一句话 → 一部短片。 - -## 安装 +> _“帮我生成一段日系影视风格,高中女生的青涩初恋故事,剧情高甜,让人看了想谈恋爱,2 分钟左右的视频,尺寸是 16:9。”_ -```bash -# 推荐 — 无需本机 Node.js -curl -fsSL https://bailian.aliyun.com/cli/install.sh | bash +## 示例 2:一句话构建短片导演 Managed Agent -# Windows(PowerShell) -irm https://bailian.aliyun.com/cli/install.ps1 | iex +

+ + 点击播放演示视频 + +

-# Node 用户 / 开发者(需要 Node.js >= 18.17) -npm install -g bailian-cli +

👆 点击封面播放完整演示

-# Agent skills -npx skills add modelstudioai/cli --all -g -``` +一句话构建一个可复用的云端短片导演,用于分镜设计、分镜图生成和视频创作: -> 二进制安装不依赖 Node.js。`npm install -g` 长期保留。 +- **[Qwen Code](https://github.com/QwenLM/qwen-code)** —— 理解需求并生成 Agent 配置 +- **[阿里云百炼 CLI](https://github.com/modelstudioai/cli/)** —— 校验配置、预览变更并完成部署 +- **[Managed Agent](https://bailian.console.aliyun.com/cn-beijing/?tab=managed-agents#/managed-agents/quick-start)** —— 在云端运行导演角色及其 Skill 和工具 -## 快速开始 - -```bash -# 认证(推荐浏览器登录) -bl auth login --console +### 唯一的提示词 -# 或使用 API key 认证 -bl auth login --api-key sk-xxxxx +> _“帮我构建一个 managedagent 应用,能够实现短片拍摄,导演专家生成视频,然后也能进行设计对应的分镜图。”_ -# 或使用 Token Plan(已内置 Base URL,登录时自动测试 Key) -bl auth login --config token-plan --api-key sk-sp-xxxxx +## 安装 -# 配置 Coding Agent 使用 DashScope -bl config agent --agent codex --base-url https://dashscope.aliyuncs.com/compatible-mode/v1 --api-key sk-xxxxx --model qwen3-coder-plus +**Agent 安装(推荐)** -# 和通义千问对话 -bl text chat --message "你好,介绍一下阿里云百炼平台" +把下面这句话发给你的 Agent,它会自行判断环境并完成安装与校验: -# 多模态对话(文本 + 图片 + 音频 + 视频) -bl omni --message "描述这张图片" --image ./photo.jpg +```text +请阅读:https://bailian.aliyun.com/cli/install.md 并按照说明为我安装阿里云百炼 CLI +``` -# 生成图片 -bl image generate --prompt "一只穿太空服的猫在火星上" --out-dir ./images/ +**手动安装(npm)** -# 图生视频(本地文件自动上传) -bl video generate --image ./cat.png --prompt "让画面中的猫动起来" --download cat.mp4 +```bash +npm install -g bailian-cli +npx skills add modelstudioai/cli --all -g +``` -# 模型推荐 — 根据场景推荐最适合的模型 -bl advisor recommend --message "我要做一个能理解图片的客服机器人" +> 需要预先安装 Node.js >= 18.17。 -# 对比特定模型 -bl advisor recommend --message "qwen-max 和 deepseek-v3 哪个更适合做代码生成" +## 快速开始 -# 浏览器登录(控制台能力相关命令需要) -bl auth login --console +安装完成后,直接在 AI Agent 中描述你的任务,无需手动拼接命令。 -# 微调与部署 — 从训练到服务的一站式流程 -bl dataset upload --file ./train.jsonl # 上传 .jsonl 数据集(先校验) -bl finetune text create --model qwen3-8b --datasets ./train.jsonl --training-type sft-lora # 本地路径自动上传 -bl finetune watch --job-id ft-xxx --output json # 非阻塞探测(运行中/成功返回 0;失败/取消报错) -bl finetune capability --model qwen3-8b # 查询模型支持哪些训练方式 -bl deploy text create --model qwen3-8b --name my-svc --plan mu # 把训练好的模型部署为推理服务 - -# 浏览模型 / 应用 / 免费额度 / 用量统计 / 业务空间 -bl model list # 浏览模型系列与价格信息 -bl app list -bl usage summary # 统一视图:免费额度 + 近期用量概览 -bl usage free # 各模型免费额度(可加 --model/--expiring/--sort) -bl usage stats --workspace-id # 模型用量统计(加 --model 查单模型) -bl workspace list # 列出所有业务空间 - -# 限流管理与提额(list / check / request / history) -bl quota list # 查看 RPM/TPM 限额(加 --model 过滤) -bl quota check # 当前用量 vs 限流阈值(加 --model/--period) -bl quota request --model qwen3.6-plus --tpm 6000000 # 申请临时 TPM 提额 -bl quota history # 查看提额历史记录 - -# Token Plan 团队版管理(需 AK/SK,见下方认证说明) -bl token-plan list-seats # 查看订阅席位明细 -bl token-plan add-member --account-name dev --org-id org_xxx -bl token-plan assign-seats --workspace-id ws_xxx --seat-type standard --account-id acc_xxx -bl token-plan create-key --account-id acc_xxx --workspace-id ws_xxx -``` +| 场景 | 可以这样对 Agent 说 | +| ---------------- | ----------------------------------------------------------------------- | +| Managed Agent | “帮我创建一个能够生成短片分镜和视频的 Managed Agent。” | +| 图片和视频生成 | “生成一张穿着太空服的猫站在火星上的图片,再把它制作成一段视频。” | +| 用量与额度 | “查看最近的模型用量、免费额度和限流情况。” | +| 模型选型 | “推荐一个适合图片理解和智能客服的模型。” | +| 了解 Bailian CLI | “介绍一下 Bailian CLI 能帮我完成哪些任务,并根据我的需求推荐使用方式。” | > 更多案例与使用场景:[阿里云百炼 CLI 官方主页](https://bailian.console.aliyun.com/cli?source_channel=cli_github&) ## 认证方式 -### DashScope API Key +### API Key 大部分命令均需要 API Key。前往 [DashScope 控制台](https://bailian.console.aliyun.com/cn-beijing/?source_channel=key_github&tab=app#/api-key) 获取。 ```bash -# 方式一:环境变量 -export DASHSCOPE_API_KEY=sk-xxxxx - -# 方式二:登录命令(持久化到 ~/.bailian/config.json) bl auth login --api-key sk-xxxxx - -# 方式三:命令行参数 -bl text chat --api-key sk-xxxxx --message "你好" ``` -### Token Plan API Key - -前往 [Token Plan 订阅详情](https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview) 获取或复制 API Key。 -CLI 已内置 Token Plan 的默认 Base URL;登录命令会先测试 Key,通过后才保存并激活 `token-plan` 配置。 +Token Plan 的 API Key 前往 [Token Plan 订阅详情](https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview) 获取或复制。 ```bash bl auth login --config token-plan --api-key sk-sp-xxxxx @@ -184,26 +122,20 @@ bl auth login --config token-plan --api-key sk-sp-xxxxx ### 控制台登录(OAuth) -控制台能力命令(`model list`、`app list`、`usage summary/free/stats`、`workspace list`、`quota list/request/check/history`)需要使用此登录方式。打开浏览器跳转百炼控制台完成登录。 +控制台能力命令(模型列表、应用列表、MCP 列表、工作空间、用量查询、限流提额、控制台直调)需要使用此登录方式。打开浏览器跳转百炼控制台完成登录。 ```bash bl auth login --console ``` -### 阿里云 OpenAPI AK/SK(仅 Token Plan) +### 阿里云 OpenAPI AK/SK -`token-plan` 命令组需要阿里云 AccessKey。前往 [RAM 控制台](https://ram.console.aliyun.com/manage/ak) 获取。 +Token Plan 的席位与成员管理需要阿里云 AccessKey。前往 [RAM 控制台](https://ram.console.aliyun.com/manage/ak) 获取。 > 建议:创建 RAM 子账号并授予最小权限,避免使用主账号 AK/SK。 ```bash -# 方式一:登录命令(持久化到 ~/.bailian/config.json) bl auth login --open-api --access-key-id LTAI5t... --access-key-secret ... - -# 方式二:环境变量 -export ALIBABA_CLOUD_ACCESS_KEY_ID=LTAI5t... -export ALIBABA_CLOUD_ACCESS_KEY_SECRET=... -export BAILIAN_WORKSPACE_ID=ws-... ``` ## 配置 @@ -212,20 +144,31 @@ export BAILIAN_WORKSPACE_ID=ws-... # 查看当前配置 bl config show -# 设置默认值 -bl config set --key base_url --value https://dashscope-us.aliyuncs.com -bl config set --key default_text_model --value qwen-turbo -bl config set --key timeout --value 600 +# 查看全部配置档 +bl config list -# 自更新到最新版本 -bl update - -# 安装指定版本 -bl update --to 0.1.14 +# 切换配置档 +bl config use --name token-plan ``` 配置文件位置:`~/.bailian/config.json` +## 更新 + +```bash +bl update +``` + +升级 CLI 至最新版本,并同步更新已安装的 Agent Skills。每个版本的变更详情记录在 [CHANGELOG.zh.md](https://github.com/modelstudioai/cli/blob/main/CHANGELOG.zh.md)。 + +## 参与贡献 + +欢迎提 Issue、Feature Request 和 PR。开发环境搭建、仓库结构、新增/修改命令的工作流请见 [CONTRIBUTING.zh.md](https://github.com/modelstudioai/cli/blob/main/CONTRIBUTING.zh.md)。 + +欢迎扫码加入阿里云百炼 CLI 钉钉用户交流群,获取使用答疑、问题排查、Bug 反馈和使用经验交流支持。 + +阿里云百炼 CLI 钉钉用户交流群 + ## 相关链接 | 资源 | 地址 | @@ -237,11 +180,3 @@ bl update --to 0.1.14 | 获取 API Key | https://bailian.console.aliyun.com/cn-beijing/?source_channel=key_github&tab=app#/api-key | | 获取 Token Plan API Key | https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview | | 获取 AccessKey | https://ram.console.aliyun.com/manage/ak | - -## 更新日志 - -每个版本的变更详情记录在 [CHANGELOG.zh.md](https://github.com/modelstudioai/cli/blob/main/CHANGELOG.zh.md)。 - -## 参与贡献 - -欢迎提 Issue、Feature Request 和 PR。开发环境搭建、仓库结构、新增/修改命令的工作流请见 [CONTRIBUTING.zh.md](https://github.com/modelstudioai/cli/blob/main/CONTRIBUTING.zh.md)。