Skip to content
Back to search

cli

Official Model Studio CLI(阿里云百炼 CLI)built for AI Agent frameworks, exposing models, search, multimodal, and workflow capabilities as structured tool calls.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/modelstudioai/cli with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/modelstudioai/cli'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/modelstudioai--cli/badge.svg)](/listings/modelstudioai--cli)

HTML

<a href="/listings/modelstudioai--cli"><img src="/api/listings/modelstudioai--cli/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

**Agent install (recommended)**

Send the following to your Agent — it will detect your environment, then install and verify the CLI for you:

Please read https://bailian.aliyun.com/cli/install.md and install the Aliyun Model Studio CLI for me

**Install with NPM**

npm install -g bailian-cli
bl skill init

> Requires Node.js >= 18.17.

**Install on macOS/Linux**

curl -fsSL https://bailian.aliyun.com/cli/install.sh | bash

> No Node.js required. The installer automatically installs Bailian Skills.

**Install on Windows**

irm https://bailian.aliyun.com/cli/install.ps1 | iex

> No Node.js required. The installer automatically installs Bailian Skills.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 285 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <div align="center">
  2. <img src="https://raw.githubusercontent.com/modelstudioai/cli/main/assets/banner.jpg" alt="Aliyun Model Studio CLI" />
  3. **The official command-line interface for Aliyun Model Studio (DashScope) AI Platform**
  4. [![npm version](https://img.shields.io/npm/v/bailian-cli?color=0969da&label=npm)](https://www.npmjs.com/package/bailian-cli)
  5. [![Node.js](https://img.shields.io/badge/node-%3E%3D18.17-brightgreen)](https://nodejs.org)
  6. [![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178c6)](https://www.typescriptlang.org)
  7. [![License](https://img.shields.io/badge/license-Apache%202.0-blue)](LICENSE)
  8. [Aliyun Model Studio CLI Site](https://bailian.console.aliyun.com/cli?spm=a2ty07.github) · [中文文档](https://github.com/modelstudioai/cli/blob/main/README.zh.md) · [API Documentation](https://help.aliyun.com/zh/model-studio/) · [Get API Key](https://bailian.console.aliyun.com/cn-beijing/?spm=a2ty07.github&tab=app#/api-key)
  9. ---
  10. _Chat with Qwen, generate and edit images and videos, understand images, synthesize_
  11. _and recognize speech, call apps, manage memory, retrieve knowledge, search the web —_
  12. _every AI capability, one command away._
  13. _Built for AI Agents. Every command works as a structured tool call._
  14. </div>
  15. ## Features
  16. - **Model generation** — Full-modality generation across text, image, video, and speech, with editing and reference-based generation
  17. - **Asset understanding** — Parse and ask questions about images, documents, audio, and long videos
  18. - **App orchestration** — Call Managed Agents, agents, and workflows published on Aliyun Model Studio, wired to knowledge bases, memory, web search, and MCP tools; create, update, publish, copy, and delete agents/workflows, and edit workflow canvases from the CLI
  19. - **Native MCP setup** — Register Bailian MCP servers in Codex, Claude Code, Cursor, Qoder, Qoder Work, QwenWork (千问办公), Qwen Code, Gemini CLI, or Pi
  20. - **Training & deployment** — Validate and upload datasets, fine-tune models, deploy dedicated models as endpoints
  21. - **Batch inference** — Prepare CSV/JSONL, create and follow asynchronous Chat/Embedding tasks, download original results/errors with optional CSV, or send one synchronous Batch Chat request
  22. - **Account operations** — Login, UI-based configuration, model marketplace, usage and quota, rate-limit increases, team seat management
  23. - **Plan onboarding** — Connect subscription plans such as Token Plan to the CLI and common coding agents in one step
  24. > **Note:** App orchestration, native MCP setup, 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.
  25. ## Showcase 1: A Cinematic Short Film from One Sentence
  26. <p align="center">
  27. <a href="https://cloud.video.taobao.com/vod/dS2F4huqbw5Nfe5L3wwb3grz2q2DNYD3retq8dU-iHo.mp4">
  28. <img src="https://raw.githubusercontent.com/modelstudioai/cli/main/assets/showcase-short-film.jpg" alt="Click to play the demo video" width="720" />
  29. </a>
  30. </p>
  31. <p align="center"><i>👆 Click the cover to play the full 2-minute demo</i></p>
  32. 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:
  33. - **[Qwen Code](https://github.com/QwenLM/qwen-code)** — the agentic coding model that interprets the user's intent and drives the workflow
  34. - **[Aliyun Model Studio CLI](https://github.com/modelstudioai/cli/)** — invokes **HappyHorse 1.1**, Aliyun Model Studio's text-/image-/reference-to-video generation model
  35. - **[spark-video Skill](https://github.com/JohnKeating1997/spark-video)** — handles scene decomposition, storyboarding, shot continuity, and final stitching
  36. ### The single prompt
  37. > _"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."_
  38. ## Showcase 2: A Short-Film Director Managed Agent from One Sentence
  39. <p align="center">
  40. <a href="https://cloud.video.taobao.com/vod/2v0GYLbJSQb2saj4iopTJDW3iRIHsintYlK-wTKbhqE.mp4">
  41. <img src="https://raw.githubusercontent.com/modelstudioai/cli/main/assets/showcase-managed-agent.jpg" alt="Click to play the demo video" width="720" />
  42. </a>
  43. </p>
  44. <p align="center"><i>👆 Click the cover to play the full demo</i></p>
  45. One sentence builds a reusable cloud-side short-film director for storyboarding, storyboard image generation, and video creation:
  46. - **[Qwen Code](https://github.com/QwenLM/qwen-code)** — understands the requirement and generates the agent configuration
  47. - **[Aliyun Model Studio CLI](https://github.com/modelstudioai/cli/)** — validates the configuration, previews the changes, and completes the deployment
  48. - **[Managed Agent](https://bailian.console.aliyun.com/cn-beijing/?spm=a2ty07.github&tab=managed-agents#/managed-agents/quick-start)** — runs the director role along with its skills and tools in the cloud
  49. ### The single prompt
  50. > _"Build me a Managed Agent app that can produce short films — a director expert that generates videos and can also design the matching storyboards."_
  51. ## Installation
  52. **Agent install (recommended)**
  53. Send the following to your Agent — it will detect your environment, then install and verify the CLI for you:
  54. ```text
  55. Please read https://bailian.aliyun.com/cli/install.md and install the Aliyun Model Studio CLI for me
  56. ```
  57. **Install with NPM**
  58. ```bash
  59. npm install -g bailian-cli
  60. bl skill init
  61. ```
  62. > Requires Node.js >= 18.17.
  63. **Install on macOS/Linux**
  64. ```bash
  65. curl -fsSL https://bailian.aliyun.com/cli/install.sh | bash
  66. ```
  67. > No Node.js required. The installer automatically installs Bailian Skills.
  68. **Install on Windows**
  69. ```powershell
  70. irm https://bailian.aliyun.com/cli/install.ps1 | iex
  71. ```
  72. > No Node.js required. The installer automatically installs Bailian Skills.
  73. ## Quick Start
  74. Once installed, just describe your task to your AI Agent — no need to assemble commands by hand.
  75. | Scenario | What to say to your Agent |
  76. | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
  77. | Managed Agent | "Create a Managed Agent that can generate short-film storyboards and videos." |
  78. | Image & video generation | "Generate an image of a cat in a spacesuit on Mars, then turn it into a video." |
  79. | Speech recognition | "Transcribe this audio; if proper nouns are wrong, add hot words and try again." |
  80. | Usage & quota | "Show my recent model usage, free-tier quota, and rate limits." |
  81. | Monitoring & alerts | "Show my model call stats, failures and logs, and create an alert rule." |
  82. | Throughput reservations | "List my throughput reservations and capacity instances, then scale, renew or release capacity and wait for the operation to finish." |
  83. | Model selection | "Recommend a model for image understanding and customer support." |
  84. | Decision model | "Use the Bailian decision model to route this ticket and assess whether it needs escalation." |
  85. | About Bailian CLI | "Tell me what Bailian CLI can do for me, and suggest how to use it for my needs." |
  86. > More examples and scenarios: [Aliyun Model Studio CLI Site](https://bailian.console.aliyun.com/cli?spm=a2ty07.github)
  87. ### Try a knowledge base
  88. With a valid API key and workspace, preview initialization first:
  89. ```bash
  90. bl knowledge init --workspace-id <workspace-id> --dry-run
  91. ```
  92. Knowledge bases accrue running-time charges from creation, even without queries. The one-time Standard Edition 720-hour allowance is shared across knowledge bases and expires 30 days after activation for new users. Model calls cost extra; your remaining allowance is unknown. Review the plan and [billing rules](https://help.aliyun.com/zh/model-studio/billing-for-knowledge-base), then add `--yes` to the same command **after confirming the operation**, removing `--dry-run` to execute.
  93. Keep the returned IDs and recovery record. Closing the CLI or a later failure does not stop billing; follow the reported cleanup actions to delete unused knowledge bases. See the [Knowledge Studio quick start](packages/kscli/README.md#quick-start) for retrieval and cleanup. The `bailian-knowledge` Skill is available through `bl skill init`.
  94. ### Console dataset and deployment queries
  95. ```bash
  96. bl dataset groups --page 1 --page-size 10 --output json
  97. bl dataset version --dataset-group-id <group-id> --output json
  98. bl dataset version --dataset-id <version-id> --include-status --output json
  99. bl file url --file-key <console-file-key> --output json
  100. bl deploy instances --page 1 --page-size 10 --output json
  101. ```
  102. Use `dataset groups` (`--name` optionally filters on the server) to obtain `records[].datasetGroupId`, then `dataset version --dataset-group-id <group-id>` to get `{result:[...]}` with `result[].datasetId` and its optional `fileId`. Use `dataset version --dataset-id <version-id>` for details; `--include-status` is available only in detail mode. Exactly one of `--dataset-group-id` and `--dataset-id` is required; they cannot be combined. `fileId` is not `datasetId` and must not be passed as a version ID. Groups fetch one page with one embedded version preview per group; `version --dataset-group-id` does not promise exhaustive results or expose pagination. The API Key / `file_id` semantics of `dataset list` are unchanged.
  103. These read-only commands use Console authentication. An optional `--workspace-id` resolves the workspace's Console identity before querying; resolution failure stops the request. `dataset version --dataset-id` keeps metadata and version/task state separate and does not infer validation success or training readiness. `file url` only resolves a download address. `deploy instances` returns one page of independent services (`records` is the list, `items` the total), not capacity instances. The API-key `dataset get --file-id` and `deploy list` commands are unchanged. Add `--dry-run` to preview without business requests; framework update checks/telemetry follow their settings.
  104. ### RAG audio and video
  105. `bl knowledge doc import --index-id <id> --doc-id <fileId>` imports an existing file into a knowledge base; `doc list --details` shows per-file processing settings. Media support includes parser options, streaming uploads, and media references in search/chunk output. Chat JSON separates the final answer from phases, tools, docs, usage, and raw events; quiet mode hides progress and informational messages while preserving the final result, including every JSON field. See the [command guide](docs/knowledge/knowledge-cli-guide.md).
  106. ## ParseX
  107. Parse documents or audio/video and extract structured fields through the workspace-scoped ParseX API:
  108. ```bash
  109. bl parsex parse submit --workspace-id <workspace-id> --file-url "https://example.com/document.pdf" --file-name document.pdf --output-file-format markdown --output json
  110. bl parsex parse result --workspace-id <workspace-id> --biz-id <parse-biz-id> --follow --output json
  111. bl parsex extract submit --workspace-id <workspace-id> --parsed-file-biz-id <parse-biz-id> --schema-file schema.json --output json
  112. bl parsex extract result --workspace-id <workspace-id> --biz-id <extract-biz-id> --follow --output json
  113. ```
  114. Use an ordinary API key and a workspace with ParseX access. Submission returns `data.biz_id` immediately; `result --follow` waits for completion. `schema.json` contains a JSON Schema object, for example `{"type":"object","properties":{"title":{"type":"string"}}}`. Inputs are accessible HTTP(S) URLs; extraction also accepts a retained document parsing task. See the [ParseX command guide](docs/parsex.md) for processing options, result slices, OSS credentials, dry-run and polling behavior.
  115. ## Batch Inference
  116. ```bash
  117. bl batch convert --help
  118. bl batch convert --file input.csv --output-file input.jsonl --model qwen-plus
  119. bl batch create --file input.jsonl --dry-run
  120. bl batch create --file input.jsonl
  121. bl batch get --batch-id <id> --follow
  122. bl batch download --batch-id <id> --csv
  123. bl text chat --batch --model qwen-plus --message "Hello" --timeout 3600
  124. ```
  125. `--help` includes CSV, JSONL and result data examples. `convert` is local and needs no key; inference/task commands use a model API key. File inference uses asynchronous tasks via `create → get → download`: `create` uploads/submits and returns a task ID without waiting for completion. Query with `get` and download results after completion. Conversion/download files are atomically published per file and never silently overwritten. Use `--force` to recover partial downloads. JSONL is the authoritative result, while CSV is a lossy display; import IDs as text to preserve leading zeros. Ctrl-C stops local polling, not the remote task.
  126. `text chat --batch` sends one synchronous request and waits for its response; it does not create an asynchronous task ID. Use `--message` or `--messages-file`, which contains one request's conversation context, not independent file requests. The total request timeout defaults to 300 seconds (`--timeout`: 60–3600 seconds). Timeout/Ctrl-C/disconnection do not guarantee server cancellation.
  127. Synchronous Batch Chat is non-streaming; explicit realtime/international/Token Plan endpoints are rejected. An explicit realtime profile requires `--base-url https://batch.dashscope.aliyuncs.com`. Batch availability and limits depend on the service/model. Dry-run avoids business requests and output/directory writes; framework update checks/telemetry follow their settings.
  128. ## Authentication
  129. ### Console Login (OAuth, Recommended)
  130. Required for console capability commands (model list, flow-agent list, MCP list, workspace, usage queries, rate-limit increases, direct console calls). It can create an ordinary API key when needed. Token Plan and other subscription plans cannot use `--console`; use the API Key login below.
  131. ```bash
  132. bl auth login --console
  133. ```
  134. Use `--console-site international` for the international console.
  135. The CLI always prints the login URL. To choose a browser yourself, keep the command running and open the URL on the **same machine**:
  136. ```bash
  137. bl auth login --console --no-browser --console-site international
  138. ```
  139. If the browser blocks the local callback, check the console site's local-network permission or try Firefox. The PNA compatibility header does not bypass Chrome's local-network permission or Safari's mixed-content restrictions. No callback within 15 minutes is a failure (exit code 5), not a successful login.
  140. If you already have a valid console access token, import it via stdin without a browser or local callback server. Specify the token's actual region and site; for example, in a POSIX shell:
  141. ```bash
  142. bl auth login --console --token-stdin --console-site international --console-region ap-southeast-1 < /path/to/console-token.txt
  143. ```
  144. Input must be one raw token (up to 64 KiB), not JSON or `Bearer ...`; interactive terminal input is rejected to avoid echoing secrets. Use a protected file or trusted pipe, never put the token in command arguments or shell history, and remove temporary secret files after use. The CLI validates the token before saving; failure leaves existing credentials and the active Profile unchanged. Add `--config <name>` to save and activate a specific Profile on success. This imports only the console session, not a model API key.
  145. ### API Key
  146. To use an existing ordinary API key or a Token Plan subscription key, run the same command:
  147. ```bash
  148. bl auth login --api-key <API_KEY>
  149. ```
  150. Get an ordinary key from the [DashScope Console](https://bailian.console.aliyun.com/cn-beijing/?spm=a2ty07.github&tab=app#/api-key), or a Token Plan key from the [subscription overview](https://bailian.console.aliyun.com/cn-beijing?spm=a2ty07.github&tab=plan#/efm/subscription/overview).
  151. ### Alibaba Cloud OpenAPI AK/SK
  152. Token Plan seat and member management requires an Alibaba Cloud AccessKey. Get yours from the [RAM Console](https://ram.console.aliyun.com/manage/ak).
  153. > Recommended: create a RAM sub-account with minimum privileges instead of using the root account's AK/SK.
  154. ```bash
  155. bl auth login --open-api --access-key-id LTAI5t... --access-key-secret ...
  156. ```
  157. ## Configuration
  158. ```bash
  159. # View current config
  160. bl config show
  161. # List all config profiles
  162. bl config list
  163. # Switch config profile
  164. bl config use --name token-plan
  165. # Switch the CLI interface to Chinese
  166. bl config set --key language --value zh-CN
  167. ```
  168. Config file location: `~/.bailian/config.json`
  169. ## Update
  170. ```bash
  171. bl update
  172. ```
  173. 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).
  174. ## Contributing
  175. 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.
  176. 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.
  177. <img src="https://raw.githubusercontent.com/modelstudioai/cli/main/assets/dingtalk-group.png" alt="Aliyun Model Studio CLI DingTalk user group" width="240" />
  178. ## Links
  179. Memory documentation (Chinese): [capability matrix](https://github.com/modelstudioai/cli/blob/main/docs/memory/cli-matrix.md) · [command guide](https://github.com/modelstudioai/cli/blob/main/docs/memory/memory-cli-guide.md).
  180. | Resource | URL |
  181. | :--------------------------- | :-------------------------------------------------------------------------------------------------- |
  182. | Aliyun Model Studio CLI Site | https://bailian.console.aliyun.com/cli?spm=a2ty07.github |
  183. | DashScope API Docs | https://help.aliyun.com/zh/model-studio/ |
  184. | Qwen Model List | https://help.aliyun.com/zh/model-studio/getting-started/models |
  185. | Aliyun Model Studio Console | https://bailian.console.aliyun.com/?spm=a2ty07.github |
  186. | Get API Key | https://bailian.console.aliyun.com/cn-beijing/?spm=a2ty07.github&tab=app#/api-key |
  187. | Get Token Plan API Key | https://bailian.console.aliyun.com/cn-beijing?spm=a2ty07.github&tab=plan#/efm/subscription/overview |
  188. | Get AccessKey | https://ram.console.aliyun.com/manage/ak |

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.