Skip to main content

Configuration & Tools

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.
Append --help to any command for full parameter details, e.g. bl config show --help. Every parameter that accepts a file URL also accepts a local path — the CLI auto-uploads it to temporary storage (valid for 48 hours), so you never need to host files as URLs yourself. Command details on this page are verified against bl 2.5.1. Global flags can precede the full command path, for example bl --config token-plan auth status; command-specific and credential flags must still follow the command path.

Authentication

bl auth login

Authenticate with API key, console browser login, or OpenAPI AK/SK (credentials can coexist). No authentication required. Usage
bl auth login --api-key <key> | --console [--no-browser | --token-stdin --console-region <region>] | --open-api --access-key-id <id> --access-key-secret <secret>
ParameterTypeRequiredDescription
--api-key <key>stringnoModel API key to validate and store
--base-url <url>stringnoModel API base URL to validate and store with --api-key
--consoleswitchnoSign 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-browserswitchnoWith --console, print the login URL without opening a browser
--token-stdinswitchnoWith --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>stringnoConsole gateway region, e.g. cn-beijing or ap-southeast-1
--console-site <site>stringnoConsole site: domestic, international
--open-apiswitchnoStore Alibaba Cloud OpenAPI AK/SK credentials
--access-key-id <id>stringnoAlibaba Cloud Access Key ID to store
--access-key-secret <secret>stringnoAlibaba Cloud Access Key Secret to store
Example: Authenticate via browser login for console
bl auth login --console
  • When a browser cannot be opened, use bl auth login --console --no-browser to 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 status
This command only supports global flags. Example: Show authentication status with JSON output
bl auth status --output json

bl auth logout

Clear stored credentials; full logout also clears the model Base URL. No authentication required. Usage
bl auth logout [--console | --open-api] [--dry-run]
ParameterTypeRequiredDescription
--consoleswitchnoOnly clear the console access_token, keep api_key intact
--open-apiswitchnoOnly clear OpenAPI AK/SK/STS credentials, keep other credentials intact
Example: Clear console access_token only
bl auth logout --console

bl auth generate-access-token

Generate a CLI access token using OpenAPI AK/SK. No authentication required. Usage
bl auth generate-access-token --access-key-id <id> --access-key-secret <secret> --security-token <token>
ParameterTypeRequiredDescription
--access-key-id <id>stringyesAlibaba Cloud Access Key ID
--access-key-secret <secret>stringyesAlibaba Cloud Access Key Secret
--security-token <token>stringnoAlibaba Cloud STS Security Token to store (optional)
Example: Generate CLI access token with AK/SK and optional STS token
bl auth generate-access-token --access-key-id LTAIxxxxx --access-key-secret xxxxx --security-token <token>

Configuration

bl config set

Set a config value. No authentication required. Usage
bl config set --key <key> --value <value>
ParameterTypeRequiredDescription
--key <key>stringyesConfig 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>stringyesValue to set
Example: Set configuration key language to zh-CN
bl config set --key language --value zh-CN

bl config show

Display current configuration. No authentication required. Usage
bl config show
This command only supports global flags. Example: Show current configuration in JSON output
bl config show --output json

bl config list

List config profiles and show the active profile. No authentication required. Usage
bl config list
This command only supports global flags. Example: List config profiles with active profile in JSON output
bl config list --output json

bl config use

Set the active config profile. No authentication required. Usage
bl config use --name <name>
ParameterTypeRequiredDescription
--name <name>stringyesExisting profile name, or default
Example: Set active config profile to token-plan
bl config use --name token-plan

bl config ui

Open a local web UI to manage config profiles. No authentication required. Usage
bl config ui [--port <port>] [--no-open]
ParameterTypeRequiredDescription
--port <port>numbernoPort to listen on (default: random free port)
--no-openswitchnoDo not open the browser automatically
Example: Open config management web UI on port 8787
bl config ui --port 8787

bl config agent

Configure a coding agent to use DashScope API. No authentication required. Usage
bl config agent --agent <name> (--base-url <url> | --region <region>) (--api-key <key> | --key <encoded>) --model <model>
ParameterTypeRequiredDescription
--agent <name>stringyesTarget agent: claude-code, qwen-code, opencode, openclaw, hermes, codex, pi
--base-url <url>stringnoAPI base URL
--region <region>stringnoModel Studio region (e.g. cn-beijing, ap-southeast-1); converted into --base-url. Token Plan only
--api-key <key>stringnoAPI key
--key <encoded>stringnoObfuscated API key from the web console (starts with "o1_"); decoded into --api-key
--model <model>stringyesDefault model name
--context-window <tokens>numbernoOpenClaw only: model context window in tokens (default: 256000)
--wire-api <api>stringnoCodex only: wire protocol (default: responses). "chat" only works with legacy Codex <= 0.80.0
Example: Configure coding agent to use DashScope API with specified settings
bl config agent --agent claude-code --base-url https://dashscope.aliyuncs.com/apps/anthropic --api-key sk-xxxxx --model qwen3-max

General tools

bl file upload

Upload a local file to DashScope temporary storage (48h). Requires API Key authentication. Usage
bl file upload --file <path> --model <model>
ParameterTypeRequiredDescription
--file <path>stringyesLocal file to upload (image, video, audio)
--model <model>stringyesTarget model name (file is bound to this model)
Example: Upload photo.jpg to DashScope storage bound to qwen3-vl-plus model
bl file upload --file photo.jpg --model qwen3-vl-plus

bl model list

Browse model families or show detailed model info in the Bailian model marketplace. No authentication required. Usage
bl model list [--model <model>] [--page <n>] [--page-size <n>] [--provider <p>] [--capability <c>] [--feature <f>] [--input-modality <m>] [--output-modality <m>] [--include-deprecated] [--enrich]
ParameterTypeRequiredDescription
--model <model>stringnoShow full details of a specific model family (switches to detail mode)
--page <n>numbernoPage number (default: 1)
--page-size <n>numbernoResults per page (default: 10)
--provider <p>arraynoFilter by provider (repeatable, e.g. --provider alibaba --provider deepseek)
--capability <c>arraynoFilter by capability code (TG, Reasoning, VU, IG, VG, TTS, ASR, …)
--feature <f>arraynoFilter by feature (function-calling, web-search, structured-outputs, …)
--context-window <w>arraynoFilter by context window range bucket
--input-modality <m>arraynoRequire an input modality (repeatable: Text, Image, Video, Audio)
--output-modality <m>arraynoRequire an output modality (repeatable: Text, Image, Video, Audio)
--include-deprecatedswitchnoInclude models that are already offline (hidden by default)
--enrichswitchnoAlso fetch input parameter schema (predictConfig) for trunk models (detail mode only)
Example: List models provided by alibaba
bl model list --provider alibaba
  • 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
bl advisor recommend --message <text> [flags]
ParameterTypeRequiredDescription
--message <text>stringyesDescribe your requirements
Example: Recommend best models for visual-understanding chatbot requirement
bl advisor recommend --message "I need a visual-understanding chatbot"

bl pipeline run

Run a pipeline workflow definition. No authentication required. Usage
bl pipeline run --file <path> [flags]
ParameterTypeRequiredDescription
--file <path>stringyesPipeline definition file (YAML/JSON)
--input <json>stringnoRuntime input as inline JSON
--input-file <path>stringnoRuntime input from a JSON file
--concurrency <n>numbernoMax parallel steps (default: 1)
--events <format>stringnoEmit lifecycle events: jsonl
--step-timeout <seconds>numbernoDefault step timeout in seconds
Example: Run pipeline workflow from workflow.yaml with input {'brief':'hello'}
bl pipeline run --file workflow.yaml --input '{"brief":"hello"}'

bl pipeline validate

Validate a pipeline definition without executing. No authentication required. Usage
bl pipeline validate --file <path>
ParameterTypeRequiredDescription
--file <path>stringyesPipeline definition file (YAML/JSON)
Example: Validate pipeline definition from file
bl pipeline validate --file workflow.yaml

bl plugin install

Install or upgrade an allowlisted Command Pack. No authentication required. Usage
bl plugin install --package <name[@version]>
ParameterTypeRequiredDescription
--package <name[@version]>stringyesAllowlisted Command Pack package and optional version or tag
Example: Install allowlisted Command Pack package
bl plugin install --package @ali/bailian-plugin-agent

bl plugin list

List installed Command Packs and their load status. No authentication required. Usage
bl plugin list
This command only supports global flags. Example: List installed Command Packs with JSON output
bl plugin list --output json

bl plugin remove

Remove an installed Command Pack. No authentication required. Usage
bl plugin remove --name <package>
ParameterTypeRequiredDescription
--name <package>stringyesAllowlisted Command Pack package name
Example: Remove installed Command Pack by name
bl plugin remove --name @ali/bailian-plugin-agent
Link an allowlisted local Command Pack for development. No authentication required. Usage
bl plugin link --path <directory>
ParameterTypeRequiredDescription
--path <directory>stringyesLocal Command Pack package directory
Example: Link local Command Pack for development
bl plugin link --path ../bailian-plugin-agent

bl workspace init

Initialize Bailian workspace and activate postpaid services. No authentication required. Usage
bl workspace init --access-key-id <id> --access-key-secret <secret> [--security-token <token>]
ParameterTypeRequiredDescription
--access-key-id <id>stringnoAlibaba Cloud Access Key ID
--access-key-secret <secret>stringnoAlibaba Cloud Access Key Secret
--security-token <token>stringnoAlibaba Cloud STS Security Token (optional)
Example: Initialize workspace with access keys
bl workspace init --access-key-id LTAIxxxxx --access-key-secret xxxxx

bl workspace list

List all workspaces. Usage
bl workspace list [flags]
ParameterTypeRequiredDescription
--list <n>stringnoLimit number of results
Example: List workspaces with limit
bl workspace list --list 5

bl console call

Call a Bailian console API via the CLI gateway. Usage
bl console call --api <api> --data <json> [flags]
ParameterTypeRequiredDescription
--api <api>stringyesAPI name (e.g. zeldaEasy.broadscope-bailian.memory-library.getLibraries)
--data <json>stringyesRequest data as JSON string
Example: Call Bailian console API with data
bl console call --api zeldaEasy.bailian-commerce.freeTrial.queryFreeTierQuota --data '{"queryFreeTierQuotaRequest":{"models":["qwen3-max"]}}'

bl update

Update the CLI to the latest or a specified version. No authentication required. Usage
bl update [--to <version>]
ParameterTypeRequiredDescription
--to <version>stringnoInstall this exact version instead of the latest
Example: Update CLI to specific version
bl update --to 0.1.14
  • bl update exits with a non-zero status when an upgrade fails or the latest version cannot be determined, so scripts and agents can detect the failure.
Run bl --help to view all command groups.