mirror of
https://github.com/modelstudioai/cli.git
synced 2026-09-14 19:49:23 +08:00
ca69316446
- 在 CLI 命令中添加 knowledgeSearch 和 knowledgeChat 两个新命令 - 新增 knowledge 搜索命令,支持多模态图像检索及对话历史上下文传递 - 新增 knowledge 问答命令,支持多轮消息流式回答及多模态输入 - 在核心客户端库(core)中添加对应的 API 端点和类型定义 - 知识库检索接口 retrieve 标注为弃用,推荐使用 search 命令替代 - 更新 kscli 主程序入口,接入新命令并兼容旧命令 - 补充 e2e 测试覆盖 knowledge search 和 knowledge chat 的各类边界与流程 - 更新文档及命令示例,实现使用说明同步最新功能 - 增加测试配置,改善 E2E 测试环境与超时设置
3.2 KiB
3.2 KiB
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
# Search a knowledge base
kscli search \
--query "What is Model Studio?" \
--agent-id <your-agent-id> \
--workspace-id <your-workspace-id>
# Chat with a knowledge base
kscli chat \
--message "What is RAG?" \
--agent-id <your-agent-id> \
--workspace-id <your-workspace-id>
Commands
| Command | Description |
|---|---|
search |
Semantic search across knowledge bases (RAG) |
chat |
Knowledge-base Q&A with streaming (RAG) |
retrieve |
Query a knowledge base (deprecated, use search) |
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 search --api-key sk-xxxxx --query "..." --agent-id <id> --workspace-id <id>
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.