/gov_uninstall
Purpose
Provide an official uninstall path for workspace governance artifacts created by bootstrap/migration. This command is for workspace cleanup + legacy restore, not plugin package removal.
Inputs
- Optional mode:
quick(recommended one-click chain)checkoruninstall- alias:
auto(same asquick)
Hard rules
- Explicit
/gov_uninstall uninstallMUST execute uninstall workflow; do not downgrade to read-only. - Uninstall must create workspace backup evidence under
archive/_gov_uninstall_backup_<ts>/before removals. - Legacy restore must prefer latest
archive/_bootstrap_backup_<ts>/when available. - Do not patch platform control-plane files (for example
~/.openclaw/openclaw.json) inside this command. - This command must never claim completion without a run report under
_runs/.
Deterministic runner (authoritative)
check:node {plugin_root}/tools/gov_uninstall_sync.mjs checkuninstall:node {plugin_root}/tools/gov_uninstall_sync.mjs uninstallquick/auto:- run
check - if status is
RESIDUAL, rununinstall - if status is
CLEAN, stop withCLEAN
- run
Expected behavior
checkmode:- detect governance residuals under workspace (
prompts/governance,skills/gov_*, governance_control/*, governance run files, governance BOOT markers) - report restore candidates from latest bootstrap backup
- detect Brain Docs autofix backup roots (
archive/_brain_docs_autofix_<ts>/) and restore candidates - return
CLEANorRESIDUAL
- detect governance residuals under workspace (
quick/automode:- execute
check -> uninstallautomatically when residual exists - keep backup-first safety and run-report evidence rules unchanged
- return
PASS/CLEAN/BLOCKEDwith explicit next steps
- execute
uninstallmode:- backup detected residual paths first
- remove detected governance residual paths
- restore legacy files from latest bootstrap backup when available
- restore Brain Docs from detected autofix backup plan (deterministic strategy reported in output)
- write run report
_runs/gov_uninstall_<ts>.md - return
PASSorBLOCKED
Output order
STATUSWHYNEXT STEP (Operator)COMMAND TO COPY
Operator notes
- Never uninstall plugin package first. Default to one-click
/gov_uninstall quick(or/gov_uninstall auto) for safe cleanup; use/gov_uninstall checkas optional strict verification before/after uninstall. - After workspace uninstall
PASS, disable or uninstall the plugin package with official OpenClaw commands. - If
warningsmention missing legacy backups, recovery files are still preserved in_gov_uninstall_backup_<ts>.