{
  "title": "`openclaw update`",
  "content": "Safely update OpenClaw and switch between stable/beta/dev channels.\n\nIf you installed via **npm/pnpm** (global install, no git metadata), updates happen via the package manager flow in [Updating](/install/updating).\n\n* `--no-restart`: skip restarting the Gateway service after a successful update.\n* `--channel <stable|beta|dev>`: set the update channel (git + npm; persisted in config).\n* `--tag <dist-tag|version>`: override the npm dist-tag or version for this update only.\n* `--json`: print machine-readable `UpdateRunResult` JSON.\n* `--timeout <seconds>`: per-step timeout (default is 1200s).\n\nNote: downgrades require confirmation because older versions can break configuration.\n\nShow the active update channel + git tag/branch/SHA (for source checkouts), plus update availability.\n\n* `--json`: print machine-readable status JSON.\n* `--timeout <seconds>`: timeout for checks (default is 3s).\n\nInteractive flow to pick an update channel and confirm whether to restart the Gateway\nafter updating (default is to restart). If you select `dev` without a git checkout, it\noffers to create one.\n\nWhen you switch channels explicitly (`--channel ...`), OpenClaw also keeps the\ninstall method aligned:\n\n* `dev` → ensures a git checkout (default: `~/openclaw`, override with `OPENCLAW_GIT_DIR`),\n  updates it, and installs the global CLI from that checkout.\n* `stable`/`beta` → installs from npm using the matching dist-tag.\n\n* `stable`: checkout the latest non-beta tag, then build + doctor.\n* `beta`: checkout the latest `-beta` tag, then build + doctor.\n* `dev`: checkout `main`, then fetch + rebase.\n\n1. Requires a clean worktree (no uncommitted changes).\n2. Switches to the selected channel (tag or branch).\n3. Fetches upstream (dev only).\n4. Dev only: preflight lint + TypeScript build in a temp worktree; if the tip fails, walks back up to 10 commits to find the newest clean build.\n5. Rebases onto the selected commit (dev only).\n6. Installs deps (pnpm preferred; npm fallback).\n7. Builds + builds the Control UI.\n8. Runs `openclaw doctor` as the final “safe update” check.\n9. Syncs plugins to the active channel (dev uses bundled extensions; stable/beta uses npm) and updates npm-installed plugins.\n\n## `--update` shorthand\n\n`openclaw --update` rewrites to `openclaw update` (useful for shells and launcher scripts).\n\n* `openclaw doctor` (offers to run update first on git checkouts)\n* [Development channels](/install/development-channels)\n* [Updating](/install/updating)\n* [CLI reference](/cli)",
  "code_samples": [
    {
      "code": "## Options\n\n* `--no-restart`: skip restarting the Gateway service after a successful update.\n* `--channel <stable|beta|dev>`: set the update channel (git + npm; persisted in config).\n* `--tag <dist-tag|version>`: override the npm dist-tag or version for this update only.\n* `--json`: print machine-readable `UpdateRunResult` JSON.\n* `--timeout <seconds>`: per-step timeout (default is 1200s).\n\nNote: downgrades require confirmation because older versions can break configuration.\n\n## `update status`\n\nShow the active update channel + git tag/branch/SHA (for source checkouts), plus update availability.",
      "language": "unknown"
    }
  ],
  "headings": [
    {
      "level": "h2",
      "text": "Usage",
      "id": "usage"
    },
    {
      "level": "h2",
      "text": "Options",
      "id": "options"
    },
    {
      "level": "h2",
      "text": "`update status`",
      "id": "`update-status`"
    },
    {
      "level": "h2",
      "text": "`update wizard`",
      "id": "`update-wizard`"
    },
    {
      "level": "h2",
      "text": "What it does",
      "id": "what-it-does"
    },
    {
      "level": "h2",
      "text": "Git checkout flow",
      "id": "git-checkout-flow"
    },
    {
      "level": "h2",
      "text": "`--update` shorthand",
      "id": "`--update`-shorthand"
    },
    {
      "level": "h2",
      "text": "See also",
      "id": "see-also"
    }
  ],
  "url": "llms-txt#`openclaw-update`",
  "links": []
}