故障排查
常见问题和解决方案
🔍 诊断步骤
1. 检查版本
bash
taskflow --version2. 检查健康状态
bash
taskflow health3. 查看日志
bash
# 查看最近日志
taskflow logs --tail 100
# 查看错误日志
taskflow logs --level error📋 常见问题
安装问题
Q: 安装后找不到 taskflow 命令
A: 检查 Node.js 全局模块路径:
bash
# 查看全局模块路径
npm root -g
# 添加到 PATH
export PATH=$(npm root -g)/../bin:$PATH
# 或使用 npx
npx taskflow-ai --versionQ: 权限错误
A: 确保有执行权限:
bash
# Linux/macOS
chmod +x $(which taskflow)
# Windows (管理员运行)配置问题
Q: MCP 工具不显示
A: 检查配置文件:
- 验证 JSON 格式
- 检查命令路径是否正确
- 重启 AI 编辑器
Q: 配置无效
A: 验证配置:
bash
# 验证配置文件
taskflow config validate
# 查看当前配置
taskflow config show运行时问题
Q: 命令超时
A: 增加超时时间:
json
{
"mcpServers": {
"taskflow": {
"command": "npx",
"args": ["-y", "taskflow-ai"],
"env": {
"TASKFLOW_TIMEOUT": "60"
}
}
}
}Q: 权限错误
A: 检查文件权限:
bash
ls -la /path/to/file
chmod 644 /path/to/fileQ: 内存不足
A: 增加内存限制:
bash
docker run --memory=1g agions/taskflow-ai:latest工具问题
Q: 文件系统工具失败
A: 检查:
- 路径是否存在
- 文件权限
- 路径是否在工作目录内
Q: Shell 命令被拒绝
A: 检查命令是否在白名单中:
bash
taskflow config show --section securityQ: Git 操作失败
A: 检查:
- Git 是否已安装
- 是否在 Git 仓库中
- 远程配置是否正确
🔧 调试技巧
启用详细日志
json
{
"mcpServers": {
"taskflow": {
"command": "npx",
"args": ["-y", "taskflow-ai"],
"env": {
"TASKFLOW_LOG_LEVEL": "debug"
}
}
}
}测试工具
bash
# 测试文件系统
taskflow mcp call taskflow_filesystem_listDirectory '{"path": "."}'
# 测试 Shell
taskflow mcp call taskflow_shell_exec '{"command": "ls"}'
# 测试 Git
taskflow mcp call taskflow_git_status '{}'查看工具列表
bash
taskflow mcp list📞 获取帮助
| 渠道 | 说明 |
|---|---|
| 📖 文档 | 完整文档 |
| 💬 GitHub Issues | 提交问题 |
| 📧 Discussions | 讨论交流 |
🔗 相关链接
遇到问题随时问我