yuan-agent
v1.0.3
Published
A personal AI Agent like OpenClaw, including tools, skills, memory, hook, sub-agent, MCP sever, etc. Run in the terminal.
Readme
Yuan-Agent
AI 小助手有tool skill mcp ...... Run in the terminal.
tech
- runtime: nodejs
- language: typescript
- package tool: pnpm
- agent framework: langGraph
- LLM API: moonshot kimi
- CLI tool: commander.js
command
pnpm add -g yuan-agent --allow-build=better-sqlite3
pnpm add -g yuan-agent
pnpm remove -g yuan-agent
pnpm dev
pnpm test
pnpm build & npm link
yuan
npm unlink
yuan-agentmodel config
Agent model configuration is loaded from user config file:
- Windows:
%USERPROFILE%/.yuan_agent/yuan_agent_setting.json - macOS/Linux:
~/.yuan_agent/yuan_agent_setting.json
If the config file is missing or invalid, the agent will fail fast with an error message.
Use /model to interactively switch default model in this file.
Full example (with MCP and env):
{
"models": {
"moonshot": {
"provider": "moonshot",
"baseURL": "https://api.moonshot.cn/v1",
"models": [
{
"id": "kimi-k2.6",
"name": "Kimi K2.6",
"apiKey": "<MOONSHOT_API_KEY>"
},
{
"id": "moonshot-v1-8k",
"name": "moonshot-v1 8k",
"apiKey": "<MOONSHOT_API_KEY_2>"
}
]
},
"deepseek": {
"provider": "deepseek",
"baseURL": "https://api.deepseek.com",
"models": [
{
"id": "deepseek-v4-pro",
"name": "DeepSeek V4 Pro",
"apiKey": "<DEEPSEEK_API_KEY>"
}
]
},
"minimax": {
"provider": "minimax",
"baseURL": "https://api.minimaxi.com/v1",
"models": [
{
"id": "MiniMax-M3",
"name": "MiniMax-M3",
"apiKey": "<MINIMAX_API_KEY>"
}
]
},
"gml": {
"provider": "gml",
"baseURL": "https://open.bigmodel.cn/api/paas/v4/",
"models": [
{
"id": "glm-4.6v",
"name": "GLM 4.6v",
"apiKey": "<GLM_API_KEY>"
},
{
"id": "GLM-5.1",
"name": "GLM-5.1",
"apiKey": "<GLM_API_KEY_2>"
},
{
"id": "GLM-5.2",
"name": "GLM-5.2",
"apiKey": "<GLM_API_KEY_3>"
}
]
}
},
"defaults": {
"provider": "moonshot",
"model": "kimi-k2.6"
},
"mcpServers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer <GITHUB_TOKEN>"
}
},
"playwright": {
"type": "stdio",
"command": "npx",
"cwd": "tmp",
"args": ["-y", "@playwright/mcp@latest"]
}
},
"env": {
"TAVILY_API_KEY": "<TAVILY_API_KEY>",
"AGENT_ENABLE_MCP_TOOLS": "false"
}
}Security note:
- Do not commit real API keys/tokens into Git.
- Use placeholders in docs and keep real secrets only in your local
~/.yuan_agent/yuan_agent_setting.json.
Node.js version requirement
- Minimum: Node.js 20
- Recommended: Node.js 22 LTS
Why:
[email protected]requires Node.js>=20[email protected]supports Node.js20.x || 22.x || 23.x || 24.x || 25.x || 26.x
Quick check:
node -v