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.
Even if pnpm / yarn is installed, use npm to install
After installation, two commands are added to your PATH:
Run
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:
This installs every
You must authenticate before calling any API. Choose one of the methods below based on your environment.
The login command already tests usability, so you only need to confirm the configuration status:
No repeated model-call test is needed. If login fails, use the
To clear local credentials and sign out, run:
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 withnpm -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)
bailian-cli — do not use pnpm / yarn to install the CLI.bl (short alias) and bailian (full name). Verify:
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:
bailian-* Skill in the registry (plus the shared bailian-protocol) in one go, and is the officially recommended install path. For more granular, on-demand installs (e.g. only one Skill), fall back to:
Configure authentication
You must authenticate before calling any API. Choose one of the methods below based on your environment.
- Console login (recommended)
- Standard API Key
- Token Plan
- AK/SK access token
- Environment variable
Best for interactive local installs — no need to copy an API Key manually. This command opens a browser to complete Alibaba Cloud console login and authorization:This also unlocks console capabilities such as
app list and usage free, and automatically configures the credentials needed for API Key calls.Verify
The login command already tests usability, so you only need to confirm the configuration status:
hint or message in the output to troubleshoot (network, invalid Key, base_url, etc.).
Log out
To clear local credentials and sign out, run:
Troubleshooting
bl: command not found
bl: command not found
The global bin directory is not on your PATH. Run
npm config get prefix and add its bin subdirectory to PATH, then retry.engines error during install
engines error during install
Node.js version too low. Upgrade to ≥ 18.17.0 and reinstall.
401 / authentication failure
401 / authentication failure
Not logged in or invalid API Key. Re-run the login command for your Key type (standard API Key or Token Plan).
Corporate network can't reach npm
Corporate network can't reach npm
Configure a mirror or proxy, then reinstall.
Only pnpm available, no npm
Only pnpm available, no npm
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.