Search and query knowledge bases directly from the terminal with the Bailian CLI.
The Bailian CLI (
Append
bailian-cli) wraps knowledge-base search and Q&A into commands you can drive from the terminal or an Agent.
Knowledge-base CLI capabilities are currently available only to China site (aliyun.com) accounts.
Commands
| Capability | Command | Notes | Common options |
|---|---|---|---|
| Semantic search | bl knowledge search | Calls a published retrieval service to run semantic search | --query query text, --agent-id retrieval service ID |
| RAG Q&A | bl knowledge chat | Calls a published Q&A service for RAG Q&A with streaming output | --message message text, --agent-id Q&A service ID |
To initialize a knowledge base or sync a local directory, use bl knowledge init, bl knowledge doc sync, or bl knowledge doc import; see the Knowledge (formerly RAG) command reference for full parameters. |
Example
--help to any command for full parameter details. Installation commands and usage examples are available on the console's Service Channels page.
bl knowledge retrieve (direct retrieval by knowledge base ID) was removed in Bailian CLI 2.5.0. Use bl knowledge search with the --agent-id of a published retrieval service instead; see the Knowledge (formerly RAG) command reference.