yunxing-agent
v1.1.0
Published
云星Agent - Node.js 智能Agent框架
Maintainers
Readme
Yunxing Agent (云星Agent)
☁️ 智能 Agent 框架 - Node.js AI Agent Framework
Author: Chinaks_cm | [email protected]
Features | 特性
- 🌐 Multi-LLM Support | 多LLM支持: OpenAI, Claude, Baidu Qianfan, Alibaba Bailian, Ollama, Custom API
- 🔒 Flexible Security | 灵活安全: Multiple file access restriction modes, C drive hard block
- 🔧 Rich Tools | 丰富工具: File operations, command execution, web requests
- 🔌 MCP Protocol | MCP协议: Support for connecting external services
- 🎨 Dual Interface | 双界面: Web UI + CLI
Installation | 安装
# Method 1: Install via npm then init (Recommended)
npm install yunxing-agent
npx create-yunxing-agent
# Method 2: Create new project directly
npm create yunxing-agent
# Method 3: Local install then use
npm install
npm run createQuick Start | 快速开始
Interactive Setup | 交互式初始化
Use npx create-yunxing-agent to configure API provider and settings during installation:
npx create-yunxing-agentThe setup wizard will guide you through:
- Select Provider - OpenAI/Claude/Baidu Qianfan/Alibaba Bailian/Ollama/Custom API
- Enter API Key - Based on selected provider
- Configure Model - Some providers require model name
- Security Mode - Choose file access restriction level
Non-Interactive Setup | 非交互式初始化
For automated scripts:
# Basic usage
npx create-yunxing-agent --non-interactive --provider openai --api-key your-key
# Full parameters
npx create-yunxing-agent --non-interactive \
--provider qianfan \
--api-key your-api-key \
--model ernie-4.0-8k \
--security-mode customParameter Reference | 参数说明:
| Parameter | 说明 | Required |
|-----------|------|----------|
| --provider, -p | Provider name | Yes |
| --api-key, -k | API key | When needed |
| --model, -m | Model name | No |
| --base-url, -b | API address | openapi/ollama |
| --security-mode, -s | Security mode | No |
| --specified-dir, -d | Specified directory | specified mode |
| --non-interactive, -y | Non-interactive mode | No |
Start Web Server | 启动 Web 服务
yunxing-agent serveThen visit http://localhost:3000
CLI Mode | CLI 模式
yunxing-agent chatConfiguration | 配置
Auto Generation | 自动生成
Using npx create-yunxing-agent will automatically generate config.json.
Manual Creation | 手动创建
Create config.json:
{
"llm": {
"provider": "openai",
"maxMessages": 100,
"maxTokens": 4000
},
"providers": {
"openai": {
"apiKey": "your-api-key",
"model": "gpt-4",
"baseUrl": null
},
"anthropic": {
"apiKey": "your-api-key",
"model": "claude-3-5-sonnet-20240620",
"baseUrl": null
},
"qianfan": {
"apiKey": "your-api-key",
"model": "ernie-4.0-8k",
"baseUrl": null
},
"ollama": {
"apiKey": "",
"model": "llama3",
"baseUrl": "http://localhost:11434"
},
"openapi": {
"apiKey": "your-api-key",
"model": "your-model",
"baseUrl": "https://your-api.com/v1"
}
},
"security": {
"mode": "custom",
"specifiedDir": null
},
"server": {
"port": 3000,
"host": "localhost"
}
}Config Reference | 配置说明:
| Field | 说明 | Default |
|-------|------|---------|
| llm.provider | Default provider | openai |
| llm.maxMessages | Max message history | 100 |
| llm.maxTokens | Max tokens | 4000 |
| providers.*.apiKey | API key | - |
| providers.*.model | Model name | - |
| providers.*.baseUrl | API address | auto |
| security.mode | Security mode | custom |
| security.specifiedDir | Specified directory | null |
LLM Provider
| Provider | Description | 中文 |
|----------|-------------|------|
| openai | OpenAI GPT | OpenAI GPT |
| anthropic | Anthropic Claude | Anthropic Claude |
| qianfan | Baidu Qianfan ERNIE | 百度千帆 ERNIE |
| bailian | Alibaba Bailian Qwen | 阿里百炼 Qwen |
| ollama | Local Ollama | 本地 Ollama |
| openapi | Custom OpenAI Compatible API | 自定义 OpenAI 兼容 API |
Switch Provider:
yunxing-agent set-provider ollamaSecurity Mode | 安全模式
| Mode | Description | 中文 |
|------|-------------|------|
| custom | Access any directory except C drive (default) | 除C盘外可访问任意目录 |
| agent_dir | Only access installation directory | 仅可访问安装目录 |
| specified | Only access configured directory | 仅可访问配置的目录 |
| no_c_drive | Only block C drive access | 仅禁止访问C盘 |
Note: C drive is blocked in all modes.
Built-in Tools | 内置工具
read_file- Read filewrite_file- Write filelist_directory- List directorysearch_files- Search filesexecute_command- Execute commandweb_request- HTTP request
MCP Protocol | MCP 协议
MCP service address: http://localhost:3001/mcp
API Endpoints | API 接口
| Endpoint | Method | Description | 说明 |
|----------|--------|-------------|------|
| /api/chat | POST | Streaming chat | 流式聊天 |
| /api/chat/sync | POST | Sync chat | 同步聊天 |
| /api/provider | GET/POST | Provider management | Provider管理 |
| /api/tools | GET | Tool list | 工具列表 |
| /api/security | GET/POST | Security config | 安全配置 |
| /api/history | GET | Chat history | 对话历史 |
Development | 开发
# Install dependencies
npm install
# Development mode
npm run chat
# Start server
npm startLicense
MIT
