| Crates.io | alou |
| lib.rs | alou |
| version | 0.1.6 |
| created_at | 2025-09-12 14:59:29.968993+00 |
| updated_at | 2025-10-21 05:36:42.779678+00 |
| description | 智能自动化工作流系统 - 基于Rust和Model Context Protocol (MCP)的智能体 |
| homepage | |
| repository | https://github.com/logos-42/alou-rust |
| max_upload_size | |
| id | 1835915 |
| size | 890,763 |
这是Alou3项目的Rust语言重新实现版本,提供更快的运行速度和更好的性能。该项目是一个在终端运行的AI智能体,支持MCP工具集成和DeepSeek API。
git clone <repository-url>
cd alou3-rust
cargo build --release
创建 .env 文件或设置环境变量:
# 必需
export DEEPSEEK_API_KEY=your_deepseek_api_key_here
# 可选
export DEEPSEEK_API_ENDPOINT=https://api.deepseek.com/v1
export ALOU_DEBUG=false
export ALOU_WORKSPACE_DIRS=/path/to/workspace1,/path/to/workspace2
# 启动交互式聊天模式
cargo run
# 执行单个命令
cargo run -- exec "读取文件 /path/to/file.txt"
# 列出可用工具
cargo run -- tools
# 测试MCP连接
cargo run -- test
# 初始化配置
cargo run -- init
# 启用调试模式
cargo run -- --debug
# 启用详细输出
cargo run -- --verbose
# 指定工作目录
cargo run -- --workdir /path/to/project
# 指定配置文件
cargo run -- --config /path/to/config.json
在聊天模式下,您可以使用以下命令:
help 或 h - 显示帮助信息tools 或 t - 列出所有可用工具clear 或 c - 清屏exit、quit 或 q - 退出程序项目使用 mcp.json 文件配置MCP服务器:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["@modelcontextprotocol/server-filesystem", "/Users"],
"timeout": 30000,
"trust": true
},
"memory": {
"command": "npx",
"args": ["@modelcontextprotocol/server-memory"],
"timeout": 30000,
"trust": true
}
}
}
| 变量名 | 必需 | 默认值 | 描述 |
|---|---|---|---|
DEEPSEEK_API_KEY |
是 | - | DeepSeek API密钥 |
DEEPSEEK_API_ENDPOINT |
否 | https://api.deepseek.com/v1 |
DeepSeek API端点 |
ALOU_DEBUG |
否 | false |
启用调试模式 |
ALOU_WORKSPACE_DIRS |
否 | 当前目录 | 工作区目录列表 |
alou3-rust/
├── src/
│ ├── main.rs # 主入口文件
│ ├── lib.rs # 库入口文件
│ ├── types.rs # 类型定义
│ ├── tools.rs # 工具trait和实现
│ ├── workspace_context.rs # 工作区上下文
│ ├── mcp_config.rs # MCP配置管理
│ ├── mcp_tool.rs # MCP工具实现
│ ├── mcp_client.rs # MCP客户端
│ ├── tool_registry.rs # 工具注册表
│ ├── deepseek_client.rs # DeepSeek客户端
│ └── agent.rs # 智能体实现
├── Cargo.toml # 项目配置
└── README.md # 项目说明
通过MCP协议集成的工具:
# 发布版本(推荐)
cargo build --release
# 启用所有优化
RUSTFLAGS="-C target-cpu=native" cargo build --release
--release 标志运行# 运行所有测试
cargo test
# 运行特定测试
cargo test test_name
# 运行集成测试
cargo test --test integration_tests
# 运行基准测试
cargo bench
# 性能分析
cargo install cargo-flamegraph
cargo flamegraph --bin alou3-rust
API密钥错误
错误: DeepSeek API key is required
解决: 设置 DEEPSEEK_API_KEY 环境变量
MCP服务器连接失败
错误: Error connecting to MCP server 'filesystem'
解决: 检查MCP服务器是否正确安装和配置
工具发现失败
错误: No tools found
解决: 检查mcp.json配置文件
启用调试模式获取详细日志:
cargo run -- --debug --verbose
欢迎贡献代码!请遵循以下步骤:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)本项目采用 Apache-2.0 许可证。详见 LICENSE 文件。
如果您遇到问题或有建议,请:
注意: 这是Alou3项目的Rust重新实现版本,专注于性能和稳定性。如果您需要更多功能,请参考原TypeScript版本。