Skip to main content

Installation & Authentication

Install the Bailian CLI and Skills, configure authentication, and verify.

This page covers how to install the Bailian CLI, install the companion Skills, and configure authentication.

Prerequisites

  • Network access (either the npm registry or bailian.aliyun.com, depending on the install method you choose below).
  • For the npm method: Node.js >= 18.17.0 (verify with node -v) and npm (verify with npm -v). If you don't have Node.js, or your version is too old, use the binary install script below instead — no Node.js required.

Install the CLI

  • npm (existing Node.js)
  • Binary script (no Node.js required)
npm install -g bailian-cli
Even if pnpm / yarn is installed, use npm to install bailian-cli — do not use pnpm / yarn to install the CLI.
After installation, two commands are added to your PATH: bl (short alias) and bailian (full name). Verify:
bl --version
which bl   # use "where bl" on Windows
Run bl update at any time to check for and install the latest CLI version.
If you see command not found, check that the global bin directory is on your PATH: for the npm install, run npm config get prefix and add its bin subdirectory to PATH; for the binary install, add the path printed by the install script.

Install Skills

Once the CLI is verified, install the companion Skills so your Agent gains the full range of Bailian capabilities. The recommended, one-shot method is the CLI's built-in bootstrap command:
bl skill init
This installs every bailian-* Skill in the registry (plus the shared bailian-protocol) in one go, and is the officially recommended install path. If bl skill init is unavailable, use the skills tool instead (it requires Git on the machine; the latest skills package requires Node.js >= 22.20, so pin skills@1.5.18 on Node.js 18):
npx skills@1.5.18 add modelstudioai/cli --skill '*' -g
To install a single Skill, replace --skill '*' with its name; --list shows all Skills in the repository.

Configure authentication

You must authenticate before calling any API. Choose one of the methods below based on your environment.
  • Standard API Key
  • Token Plan
  • AK/SK access token
  • Environment variable
Standard API Keys and Token Plan subscription keys differ as follows:
AspectStandard API KeyToken Plan API Key
BillingPay-as-you-go (includes new-user free quota)Deducts from your Token Plan subscription quota
ScopeModel service callsCalls to models supported by Token Plan
Typical useNo subscription, or pay-as-you-goToken Plan subscribers consuming plan quota first
Setupbl auth login --api-key <Key>bl auth login --config token-plan --api-key <sk-sp-Key>

Verify

The login command already tests usability, so you only need to confirm the configuration status:
bl auth status --output json
No repeated model-call test is needed. If login fails, use the hint or message in the output to troubleshoot (network, invalid Key, base_url, etc.).
When reporting auth status, use only masked fields. Never echo a full API Key, and do not write real Keys into repositories, logs, or the public parts of chat records.

Log out

To clear local credentials and sign out, run:
bl auth logout

Troubleshooting

The global bin directory is not on your PATH. Run npm config get prefix and add its bin subdirectory to PATH, then retry.
Node.js version too low. Upgrade to >= 18.17.0 and reinstall.
Not logged in or invalid API Key. Re-run the login command for your Key type (standard API Key or Token Plan).
The active credential is a standard API Key (the default profile). Token Plan requires your subscription API Key signed in to the token-plan profile; run bl auth status --output json to see which credential is active.
Sign in with your subscription API Key: bl auth login --config token-plan --api-key <sk-sp-Key>. If the profile already exists, switch to it with bl config use --name token-plan.
No. Model-call commands work; console features (such as app list, usage free, workspace) require console login (bl auth login --console), and Token Plan seat management additionally needs Alibaba Cloud OpenAPI AK/SK credentials. See Configure authentication for the comparison.
Run bl auth status --output json to inspect the active credential (masked), bl config list to list all profiles, and bl config use --name <profile> to switch the active profile.
Configure a mirror or proxy, then reinstall.
Use the binary install script instead (no Node.js/npm required): curl -fsSL https://bailian.aliyun.com/cli/install.sh | bash. Alternatively, install or repair npm first, then use npm install -g bailian-cli — but do not use pnpm / yarn to install the CLI.
Capabilities
Changelog