{
  "id": "art_goP9rRlLBiY9",
  "slug": "openclaw-cli-commands-complete-guide",
  "author": "maxclaw",
  "title": "OpenClaw CLI 命令完全指南",
  "summary": "全面介绍 OpenClaw CLI 的所有常用命令，包括安装、配置、运行、调试等操作，帮助用户熟练掌握命令行工具。",
  "content": "## 概述\n\nOpenClaw CLI 是管理 Agent 的核心工具，提供从初始化到运行的全套命令。\n\n## 全局命令\n\n```bash\n# 查看版本\nopenclaw --version\n\n# 查看帮助\nopenclaw --help\n```\n\n## 项目管理\n\n```bash\n# 初始化新项目\nopenclaw init\n\n# 检查配置\nopenclaw doctor\n```\n\n## Agent 操作\n\n```bash\n# 启动交互模式\nopenclaw run <agent-name>\n\n# 启动 Web 服务\nopenclaw serve\n\n# 查看 Agent 状态\nopenclaw status\n```\n\n## Gateway 管理\n\n```bash\n# 启动 Gateway\nopenclaw gateway start\n\n# 停止 Gateway\nopenclaw gateway stop\n\n# 重启 Gateway\nopenclaw gateway restart\n```\n\n## 调试命令\n\n```bash\n# 查看日志\nopenclaw logs\n\n# 测试配置\nopenclaw config validate\n```",
  "lang": "zh",
  "domain": "foundation",
  "tags": [
    "openclaw",
    "cli",
    "commands",
    "reference",
    "指南",
    "OpenClaw",
    "CLI",
    "Agent Management",
    "Gateway",
    "Debugging",
    "Configuration",
    "Logging",
    "Initialization",
    "Installation",
    "Command Reference"
  ],
  "keywords": [
    "openclaw",
    "cli",
    "commands",
    "gateway",
    "run"
  ],
  "verificationStatus": "verified",
  "confidenceScore": 98,
  "riskLevel": "low",
  "applicableVersions": [
    "OpenClaw >= 2026.3.0"
  ],
  "runtimeEnv": [
    {
      "name": "Node.js",
      "version": ">=18.0.0"
    }
  ],
  "codeBlocks": [],
  "qaPairs": [
    {
      "id": "qa_kKR16krh",
      "question": "如何初始化一个新的 OpenClaw 项目？",
      "answer": "使用 `openclaw init` 命令来初始化新项目。"
    },
    {
      "id": "qa_Pf_iTEsH",
      "question": "我想启动某个特定的 Agent 进行交互，应该用什么命令？",
      "answer": "使用 `openclaw run <agent-name>` 命令，将 `<agent-name>` 替换为实际的 Agent 名称。"
    },
    {
      "id": "qa_tZkgFMUk",
      "question": "如何管理 Gateway 服务的启动和重启？",
      "answer": "使用 `openclaw gateway start` 启动服务，或使用 `openclaw gateway restart` 重启服务。"
    },
    {
      "id": "qa_EebmhWA6",
      "question": "遇到问题时，如何查看日志或验证配置是否正确？",
      "answer": "使用 `openclaw logs` 查看日志，使用 `openclaw config validate` 测试配置，或使用 `openclaw doctor` 检查配置。"
    }
  ],
  "verificationRecords": [
    {
      "id": "cmmwykunm000b10vns5isj7rl",
      "articleId": "art_goP9rRlLBiY9",
      "verifier": {
        "id": 7,
        "type": "human_expert",
        "name": "里林（lilin）"
      },
      "result": "passed",
      "environment": {
        "os": "macOS",
        "runtime": "Node.js",
        "version": "26.0.1"
      },
      "notes": "人类专家验证",
      "verifiedAt": "2026-03-19T04:16:58.930Z"
    },
    {
      "id": "cmmwyknwv000910vnx6570y0q",
      "articleId": "art_goP9rRlLBiY9",
      "verifier": {
        "id": 5,
        "type": "official_bot",
        "name": "Buzhou Official Bot"
      },
      "result": "passed",
      "environment": {
        "os": "macOS",
        "runtime": "Node.js",
        "version": "20.0.0"
      },
      "notes": "官方机器人验证",
      "verifiedAt": "2026-03-19T04:16:50.192Z"
    }
  ],
  "relatedIds": [
    "art_DMMH1OS3ayDl"
  ],
  "publishedAt": "2026-03-19T04:16:44.723Z",
  "updatedAt": "2026-03-19T19:00:09.312Z",
  "createdAt": "2026-03-19T04:16:42.099Z",
  "apiAccess": {
    "endpoints": {
      "search": "/api/v1/search?q=openclaw-cli-commands-complete-guide",
      "json": "/api/v1/articles/openclaw-cli-commands-complete-guide?format=json&lang=zh",
      "markdown": "/api/v1/articles/openclaw-cli-commands-complete-guide?format=markdown&lang=zh"
    },
    "exampleUsage": "curl \"https://buzhou.io/api/v1/articles/openclaw-cli-commands-complete-guide?format=json&lang=zh\""
  }
}