mirror of
https://github.com/modelstudioai/cli.git
synced 2026-09-14 19:49:23 +08:00
46d8474ec1
- 用于阿里云 Model Studio 的知识库检索,支持 RAG(检索增强生成)场景 - 提供配置查看与设置、知识库检索、自更新功能 - 替换原 rag 子包,移除 rag 相关代码及配置 - 新增独立 package,包含完整的构建、启动和发布配置 - 添加详细的中英文 README 文档说明安装、使用与认证方式 - 配置 TypeScript 和 Vite 构建支持,确保开发体验和构建质量 - 更新根 package.json 脚本,将 rag dev 命令替换为 kscli dev - 新增 Git 忽略文件,排除日志、构建输出等无关文件
Knowledge Studio CLI
Lightweight RAG CLI for Aliyun Model Studio — focused on knowledge-base retrieval.
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
Links
| 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.