安装指南
详细的安装步骤和部署方式
📋 系统要求
| 要求 | 版本 |
|---|---|
| Node.js | ≥ 18.0.0 |
| npm | ≥ 9.0.0 |
| 操作系统 | macOS / Windows / Linux |
| 内存 | ≥ 512 MB |
| 磁盘 | ≥ 100 MB |
🚀 安装方式
方式一:NPM 全局安装(推荐)
bash
# 安装
npm install -g taskflow-ai
# 验证
taskflow --version
# 查看帮助
taskflow --help优点:
- ✅ 简单快速
- ✅ 自动更新
- ✅ 所有项目通用
缺点:
- ⚠️ 需要 Node.js 环境
方式二:Docker 部署
bash
# 拉取镜像
docker pull agions/taskflow-ai:latest
# 运行
docker run --rm -i agions/taskflow-ai:latest mcp startDocker Compose:
yaml
version: '3.8'
services:
taskflow:
image: agions/taskflow-ai:latest
volumes:
- ./project:/workspace
working_dir: /workspace
stdin_open: true
tty: false优点:
- ✅ 环境隔离
- ✅ 版本固定
- ✅ 易于部署
缺点:
- ⚠️ 需要 Docker
- ⚠️ 启动稍慢
方式三:源码安装
bash
# 克隆仓库
git clone https://github.com/Agions/taskflow-ai.git
cd taskflow-ai
# 安装依赖
npm install
# 构建
npm run build
# 全局链接
npm link优点:
- ✅ 最新特性
- ✅ 可定制
- ✅ 便于开发
缺点:
- ⚠️ 需要构建
- ⚠️ 需要维护
🔧 配置选项
环境变量
| 变量 | 说明 | 默认值 |
|---|---|---|
TASKFLOW_LOG_LEVEL | 日志级别 | info |
TASKFLOW_WORK_DIR | 工作目录 | 当前目录 |
TASKFLOW_TIMEOUT | 操作超时 (秒) | 30 |
TASKFLOW_MAX_MEMORY | 最大内存 (MB) | 512 |
配置文件
bash
# 生成配置文件
taskflow config init
# 编辑配置
taskflow config edit配置文件示例:
yaml
# ~/.taskflow/config.yaml
workDir: /path/to/your/project
logLevel: info
timeout: 30
security:
allowedCommands:
- ls
- cat
- git
- npm
blockedPaths:
- /etc
- /root
- ~/.ssh📦 验证安装
检查版本
bash
taskflow --version
# 输出: taskflow-ai v5.0.3检查工具列表
bash
taskflow mcp list输出示例:
Available MCP Tools:
✓ taskflow_filesystem_listDirectory
✓ taskflow_filesystem_readFile
✓ taskflow_filesystem_writeFile
✓ taskflow_shell_exec
✓ taskflow_git_status
✓ taskflow_code_execute
✓ taskflow_http_request
✓ taskflow_database_query
✓ taskflow_vector_search
✓ taskflow_memory_get
✓ taskflow_memory_set
✓ taskflow_notification_send
✓ taskflow_builtin_health运行健康检查
bash
taskflow health输出示例:
✓ Node.js: v18.19.0
✓ npm: v9.6.7
✓ Git: v2.43.0
✓ Memory: 256MB / 512MB
✓ Disk: 50GB available🐛 常见问题
Q: 安装后找不到 taskflow 命令
A: 检查 Node.js 全局模块路径:
bash
# 查看全局模块路径
npm root -g
# 添加到 PATH
export PATH=$(npm root -g)/../bin:$PATH
# 或者使用 npx
npx taskflow-ai --versionQ: Docker 容器启动失败
A: 检查 Docker 版本和权限:
bash
# 检查 Docker 版本
docker --version # 需要 ≥ 20.0
# 检查权限
docker run --rm hello-worldQ: 权限错误
A: 确保有执行权限:
bash
# Linux/macOS
chmod +x $(which taskflow)
# Windows (管理员运行)📚 下一步
- 快速入门 - 开始使用
- 配置说明 - 高级配置选项
- Claude Desktop 集成 - 配置 Claude
安装遇到问题随时问我