Files
若麒 b1a0c0005d chore(release): align knowledge-studio-cli to 1.5.0
kscli joins the family lockstep version so the --knowledge stable publish
passes (validate.mjs asserts every package in ALL_PACKAGES matches
bailian-cli-core). Was 0.0.1, which blocked publish-stable --knowledge.
2026-07-01 16:06:20 +08:00
..

Knowledge Studio CLI

Lightweight RAG CLI for Aliyun Model Studio — focused on knowledge-base retrieval.

npm version Node.js TypeScript License

Knowledge Studio Console · 中文文档 · API Documentation

What is this?

kscli is a standalone CLI for knowledge-base retrieval on Aliyun Model Studio (DashScope), purpose-built for RAG (Retrieval-Augmented Generation) workflows.

Installation

npm install -g knowledge-studio-cli

Requires Node.js >= 22.12.

Quick Start

# Retrieve from a knowledge base
kscli retrieve \
  --index-id <your-index-id> \
  --query "What is Model Studio?"

Commands

Command Description
retrieve Query a knowledge base (RAG)
config show Display current configuration
config set Set a configuration value
update Self-update to the latest version

Authentication

A DashScope API Key is recommended. Get yours from the DashScope Console.

# Option 1: Environment variable
export DASHSCOPE_API_KEY=sk-xxxxx

# Option 2: Persist to config (~/.bailian/config.json)
kscli config set --key api_key --value sk-xxxxx

# Option 3: Per-command flag
kscli retrieve --api-key sk-xxxxx --index-id <id> --query "..."

Configuration

# View current config
kscli config show

# Set defaults
kscli config set --key base_url --value https://dashscope-us.aliyuncs.com
kscli config set --key timeout --value 600

# Self-update
kscli update

Config file location: ~/.bailian/config.json

Resource URL
Knowledge Studio Console https://rag.console.aliyun.com/
DashScope API Docs https://help.aliyun.com/zh/model-studio/
Get API Key https://bailian.console.aliyun.com/?tab=app#/api-key

Contributing

Bug reports, feature requests, and PRs are welcome. See CONTRIBUTING.md for developer setup and contribution workflow.

License

Apache 2.0