Remove graphify PreToolUse hook from .codebuddy/settings.json.
(project_dir: Path)
| 2704 | _write_settings_with_backup(settings_path, settings) |
| 2705 | print(f" .codebuddy/settings.json -> PreToolUse hooks registered") |
| 2706 | def _uninstall_codebuddy_hook(project_dir: Path) -> None: |
| 2707 | """Remove graphify PreToolUse hook from .codebuddy/settings.json.""" |
| 2708 | settings_path = project_dir / ".codebuddy" / "settings.json" |
| 2709 | if not settings_path.exists(): |
| 2710 | return |
| 2711 | try: |
| 2712 | settings = json.loads(settings_path.read_text(encoding="utf-8")) |
| 2713 | except json.JSONDecodeError: |
| 2714 | return |
| 2715 | pre_tool = settings.get("hooks", {}).get("PreToolUse", []) |
| 2716 | if not isinstance(pre_tool, list): |
| 2717 | return |
| 2718 | filtered = _strip_graphify_hooks(pre_tool) |
| 2719 | if filtered == pre_tool: |
| 2720 | return |
| 2721 | settings["hooks"]["PreToolUse"] = filtered |
| 2722 | _write_settings_with_backup(settings_path, settings) |
| 2723 | print(f" .codebuddy/settings.json -> PreToolUse hook removed") |
| 2724 | def codebuddy_uninstall(project_dir: Path | None = None, *, project: bool = False, remove_user_skill: bool | None = None) -> None: |
| 2725 | """Remove the graphify skill tree (SKILL.md + references/) and the CODEBUDDY.md section. |
| 2726 |
no test coverage detected