Skip to content

故障排查

常见问题和解决方案


🔍 诊断步骤

1. 检查版本

bash
taskflow --version

2. 检查健康状态

bash
taskflow health

3. 查看日志

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 --version

Q: 权限错误

A: 确保有执行权限:

bash
# Linux/macOS
chmod +x $(which taskflow)

# Windows (管理员运行)

配置问题

Q: MCP 工具不显示

A: 检查配置文件:

  1. 验证 JSON 格式
  2. 检查命令路径是否正确
  3. 重启 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/file

Q: 内存不足

A: 增加内存限制:

bash
docker run --memory=1g agions/taskflow-ai:latest

工具问题

Q: 文件系统工具失败

A: 检查:

  1. 路径是否存在
  2. 文件权限
  3. 路径是否在工作目录内

Q: Shell 命令被拒绝

A: 检查命令是否在白名单中:

bash
taskflow config show --section security

Q: Git 操作失败

A: 检查:

  1. Git 是否已安装
  2. 是否在 Git 仓库中
  3. 远程配置是否正确

🔧 调试技巧

启用详细日志

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讨论交流

🔗 相关链接


遇到问题随时问我

Released under the MIT License.