mirror of
https://github.com/modelstudioai/cli.git
synced 2026-09-14 19:49:23 +08:00
3988e701e1
- 新增 `bl config agent --key` / `--region`,支持控制台编码 API Key 本地解码和区域派生 Token Plan 地址 - 新增 `bl config agent --context-window`,设置 OpenClaw 配置的上下文窗口大小,默认 256000 - 新增 `bl config agent --wire-api`,支持选择 Codex 配置的通信协议,兼容旧版 chat 协议并提示警告 - 变更 Codex 默认写入通信协议为 `responses`,适配新版 Codex 不再支持旧 chat 模式 - 变更 Qwen Code 代理配置改用 `DASHSCOPE_API_KEY` 环境变量替代 `BAILIAN_CLI_API_KEY` - 修复各 agent 配置格式不匹配问题,支持 JSONC 格式和官方结构,完善模型白名单与计费元数据 - 修复配置写入逻辑,合并保持用户自定义配置,避免覆盖及重复条目,优化显示名保留 - 更新所有相关包版本号至 1.11.0,包含 bailian-cli、commands、core、kscli、runtime - 更新 bailian-cli 技能元数据版本号至 1.11.0
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 >= 18.17.
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.