Bailian CLI command reference for auth configuration, profile management, model marketplace, file upload, and general tools.
Manage CLI authentication, switch profiles, browse the model marketplace, upload files, and use general tools from the terminal.
Authenticate with API key, console browser login, or OpenAPI AK/SK (credentials can coexist). No authentication required.
Usage
Example: Authenticate via browser login for console
Show current authentication state. No authentication required.
Usage
This command only supports global flags.
Example: Show authentication status with JSON output
Clear stored credentials; full logout also clears the model Base URL. No authentication required.
Usage
Example: Clear console access_token only
Generate a CLI access token using OpenAPI AK/SK. No authentication required.
Usage
Example: Generate CLI access token with AK/SK and optional STS token
Set a config value. No authentication required.
Usage
Example: Set configuration key language to zh-CN
Display current configuration. No authentication required.
Usage
This command only supports global flags.
Example: Show current configuration in JSON output
List config profiles and show the active profile. No authentication required.
Usage
This command only supports global flags.
Example: List config profiles with active profile in JSON output
Set the active config profile. No authentication required.
Usage
Example: Set active config profile to token-plan
Open a local web UI to manage config profiles. No authentication required.
Usage
Example: Open config management web UI on port 8787
Configure a coding agent to use DashScope API. No authentication required.
Usage
Example: Configure coding agent to use DashScope API with specified settings
Upload a local file to DashScope temporary storage (48h). Requires API Key authentication.
Usage
Example: Upload photo.jpg to DashScope storage bound to qwen3-vl-plus model
Browse model families or show detailed model info in the Bailian model marketplace. No authentication required.
Usage
Example: List models provided by alibaba
Recommend the best models for your use case (intent analysis → candidate recall → LLM ranking). Requires API Key authentication.
Usage
Example: Recommend best models for visual-understanding chatbot requirement
Run a pipeline workflow definition. No authentication required.
Usage
Example: Run pipeline workflow from workflow.yaml with input {'brief':'hello'}
Validate a pipeline definition without executing. No authentication required.
Usage
Example: Validate pipeline definition from file
Install or upgrade an allowlisted Command Pack. No authentication required.
Usage
Example: Install allowlisted Command Pack package
List installed Command Packs and their load status. No authentication required.
Usage
This command only supports global flags.
Example: List installed Command Packs with JSON output
Remove an installed Command Pack. No authentication required.
Usage
Example: Remove installed Command Pack by name
Link an allowlisted local Command Pack for development. No authentication required.
Usage
Example: Link local Command Pack for development
Initialize Bailian workspace and activate postpaid services. No authentication required.
Usage
Example: Initialize workspace with access keys
List all workspaces.
Usage
Example: List workspaces with limit
Call a Bailian console API via the CLI gateway.
Usage
Example: Call Bailian console API with data
Update the CLI to the latest or a specified version. No authentication required.
Usage
Example: Update CLI to specific version
Authentication
bl auth login
Authenticate with API key, console browser login, or OpenAPI AK/SK (credentials can coexist). No authentication required.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--api-key <key> | string | no | Model API key to validate and store |
--base-url <url> | string | no | Model API base URL to validate and store with --api-key |
--console | switch | no | Sign in via browser (China by default; use --console-site international for the international site). Creates an ordinary API key if needed; subscription plans require --api-key |
--no-browser | switch | no | With --console, print the login URL without opening a browser |
--token-stdin | switch | no | With --console, read and validate one console access token from stdin; requires --console-region, and does not open a browser or local server |
--console-region <region> | string | no | Console gateway region, e.g. cn-beijing or ap-southeast-1 |
--console-site <site> | string | no | Console site: domestic, international |
--open-api | switch | no | Store Alibaba Cloud OpenAPI AK/SK credentials |
--access-key-id <id> | string | no | Alibaba Cloud Access Key ID to store |
--access-key-secret <secret> | string | no | Alibaba Cloud Access Key Secret to store |
- When a browser cannot be opened, use
bl auth login --console --no-browserto print the login URL, or import an access token from stdin with--token-stdin.
bl auth status
Show current authentication state. No authentication required.
Usage
bl auth logout
Clear stored credentials; full logout also clears the model Base URL. No authentication required.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--console | switch | no | Only clear the console access_token, keep api_key intact |
--open-api | switch | no | Only clear OpenAPI AK/SK/STS credentials, keep other credentials intact |
bl auth generate-access-token
Generate a CLI access token using OpenAPI AK/SK. No authentication required.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--access-key-id <id> | string | yes | Alibaba Cloud Access Key ID |
--access-key-secret <secret> | string | yes | Alibaba Cloud Access Key Secret |
--security-token <token> | string | no | Alibaba Cloud STS Security Token to store (optional) |
Configuration
bl config set
Set a config value. No authentication required.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--key <key> | string | yes | Config key (language, base_url, output, output_dir, timeout, watermark, api_key, api_key_capabilities, access_token, access_key_id, access_key_secret, security_token, default_*_model, workspace_id) |
--value <value> | string | yes | Value to set |
bl config show
Display current configuration. No authentication required.
Usage
bl config list
List config profiles and show the active profile. No authentication required.
Usage
bl config use
Set the active config profile. No authentication required.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--name <name> | string | yes | Existing profile name, or default |
bl config ui
Open a local web UI to manage config profiles. No authentication required.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--port <port> | number | no | Port to listen on (default: random free port) |
--no-open | switch | no | Do not open the browser automatically |
bl config agent
Configure a coding agent to use DashScope API. No authentication required.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--agent <name> | string | yes | Target agent: claude-code, qwen-code, opencode, openclaw, hermes, codex, pi |
--base-url <url> | string | no | API base URL |
--region <region> | string | no | Model Studio region (e.g. cn-beijing, ap-southeast-1); converted into --base-url. Token Plan only |
--api-key <key> | string | no | API key |
--key <encoded> | string | no | Obfuscated API key from the web console (starts with "o1_"); decoded into --api-key |
--model <model> | string | yes | Default model name |
--context-window <tokens> | number | no | OpenClaw only: model context window in tokens (default: 256000) |
--wire-api <api> | string | no | Codex only: wire protocol (default: responses). "chat" only works with legacy Codex <= 0.80.0 |
General tools
bl file upload
Upload a local file to DashScope temporary storage (48h). Requires API Key authentication.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--file <path> | string | yes | Local file to upload (image, video, audio) |
--model <model> | string | yes | Target model name (file is bound to this model) |
bl model list
Browse model families or show detailed model info in the Bailian model marketplace. No authentication required.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--model <model> | string | no | Show full details of a specific model family (switches to detail mode) |
--page <n> | number | no | Page number (default: 1) |
--page-size <n> | number | no | Results per page (default: 10) |
--provider <p> | array | no | Filter by provider (repeatable, e.g. --provider alibaba --provider deepseek) |
--capability <c> | array | no | Filter by capability code (TG, Reasoning, VU, IG, VG, TTS, ASR, …) |
--feature <f> | array | no | Filter by feature (function-calling, web-search, structured-outputs, …) |
--context-window <w> | array | no | Filter by context window range bucket |
--input-modality <m> | array | no | Require an input modality (repeatable: Text, Image, Video, Audio) |
--output-modality <m> | array | no | Require an output modality (repeatable: Text, Image, Video, Audio) |
--include-deprecated | switch | no | Include models that are already offline (hidden by default) |
--enrich | switch | no | Also fetch input parameter schema (predictConfig) for trunk models (detail mode only) |
- Both the catalog and --enrich parameter-schema endpoints are public — no console login needed.
- Browse mode hides models that are already offline; use --include-deprecated to include them. Detail mode (--model) always lists every version and flags its status instead.
bl advisor recommend
Recommend the best models for your use case (intent analysis → candidate recall → LLM ranking). Requires API Key authentication.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--message <text> | string | yes | Describe your requirements |
bl pipeline run
Run a pipeline workflow definition. No authentication required.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--file <path> | string | yes | Pipeline definition file (YAML/JSON) |
--input <json> | string | no | Runtime input as inline JSON |
--input-file <path> | string | no | Runtime input from a JSON file |
--concurrency <n> | number | no | Max parallel steps (default: 1) |
--events <format> | string | no | Emit lifecycle events: jsonl |
--step-timeout <seconds> | number | no | Default step timeout in seconds |
bl pipeline validate
Validate a pipeline definition without executing. No authentication required.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--file <path> | string | yes | Pipeline definition file (YAML/JSON) |
bl plugin install
Install or upgrade an allowlisted Command Pack. No authentication required.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--package <name[@version]> | string | yes | Allowlisted Command Pack package and optional version or tag |
bl plugin list
List installed Command Packs and their load status. No authentication required.
Usage
bl plugin remove
Remove an installed Command Pack. No authentication required.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--name <package> | string | yes | Allowlisted Command Pack package name |
bl plugin link
Link an allowlisted local Command Pack for development. No authentication required.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--path <directory> | string | yes | Local Command Pack package directory |
bl workspace init
Initialize Bailian workspace and activate postpaid services. No authentication required.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--access-key-id <id> | string | no | Alibaba Cloud Access Key ID |
--access-key-secret <secret> | string | no | Alibaba Cloud Access Key Secret |
--security-token <token> | string | no | Alibaba Cloud STS Security Token (optional) |
bl workspace list
List all workspaces.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--list <n> | string | no | Limit number of results |
bl console call
Call a Bailian console API via the CLI gateway.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--api <api> | string | yes | API name (e.g. zeldaEasy.broadscope-bailian.memory-library.getLibraries) |
--data <json> | string | yes | Request data as JSON string |
bl update
Update the CLI to the latest or a specified version. No authentication required.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--to <version> | string | no | Install this exact version instead of the latest |
bl updateexits with a non-zero status when an upgrade fails or the latest version cannot be determined, so scripts and agents can detect the failure.
bl --help to view all command groups.