**The official command-line interface for Aliyun Model Studio (DashScope) AI Platform**
[](https://www.npmjs.com/package/bailian-cli)
[](https://nodejs.org)
[](https://www.typescriptlang.org)
[](LICENSE)
[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)
---
_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._
👆 Click the cover to play the full 2-minute demo
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://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."_ ## Showcase 2: A Short-Film Director Managed Agent from One Sentence👆 Click the cover to play the full demo
One sentence builds a reusable cloud-side short-film director for storyboarding, storyboard image generation, and video creation: - **[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/?spm=a2ty07.github&tab=managed-agents#/managed-agents/quick-start)** — runs the director role along with its skills and tools in the cloud ### The single prompt > _"Build me a Managed Agent app that can produce short films — a director expert that generates videos and can also design the matching storyboards."_ ## Installation **Agent install (recommended)** Send the following to your Agent — it will detect your environment, then install and verify the CLI for you: ```text Please read https://bailian.aliyun.com/cli/install.md and install the Aliyun Model Studio CLI for me ``` **Install with NPM** ```bash npm install -g bailian-cli bl skill init ``` > Requires Node.js >= 18.17. **Install on macOS/Linux** ```bash curl -fsSL https://bailian.aliyun.com/cli/install.sh | bash ``` > No Node.js required. The installer automatically installs Bailian Skills. **Install on Windows** ```powershell irm https://bailian.aliyun.com/cli/install.ps1 | iex ``` > No Node.js required. The installer automatically installs Bailian Skills. ## Quick Start Once installed, just describe your task to your AI Agent — no need to assemble commands by hand. | 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." | | Speech recognition | "Transcribe this audio; if proper nouns are wrong, add hot words and try again." | | Usage & quota | "Show my recent model usage, free-tier quota, and rate limits." | | Monitoring & alerts | "Show my model call stats, failures and logs, and create an alert rule." | | Throughput reservations | "List my throughput reservations and capacity instances, then scale, renew or release capacity and wait for the operation to finish." | | Model selection | "Recommend a model for image understanding and customer support." | | Decision model | "Use the Bailian decision model to route this ticket and assess whether it needs escalation." | | 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?spm=a2ty07.github) ## Authentication ### Console Login (OAuth, Recommended) Required for console capability commands (model list, app 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. ```bash bl auth login --console ``` Use `--console-site international` for the international console. The CLI always prints the login URL. To choose a browser yourself, keep the command running and open the URL on the **same machine**: ```bash bl auth login --console --no-browser --console-site international ``` 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. 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: ```bash bl auth login --console --token-stdin --console-site international --console-region ap-southeast-1 < /path/to/console-token.txt ``` 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
## Links
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).
| Resource | URL |
| :--------------------------- | :-------------------------------------------------------------------------------------------------- |
| Aliyun Model Studio CLI Site | https://bailian.console.aliyun.com/cli?spm=a2ty07.github |
| DashScope API Docs | https://help.aliyun.com/zh/model-studio/ |
| Qwen Model List | https://help.aliyun.com/zh/model-studio/getting-started/models |
| Aliyun Model Studio Console | https://bailian.console.aliyun.com/?spm=a2ty07.github |
| Get API Key | https://bailian.console.aliyun.com/cn-beijing/?spm=a2ty07.github&tab=app#/api-key |
| Get Token Plan API Key | https://bailian.console.aliyun.com/cn-beijing?spm=a2ty07.github&tab=plan#/efm/subscription/overview |
| Get AccessKey | https://ram.console.aliyun.com/manage/ak |