MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _uninstall_codebuddy_hook

Function _uninstall_codebuddy_hook

graphify/install.py:2706–2723  ·  view source on GitHub ↗

Remove graphify PreToolUse hook from .codebuddy/settings.json.

(project_dir: Path)

Source from the content-addressed store, hash-verified

2704 _write_settings_with_backup(settings_path, settings)
2705 print(f" .codebuddy/settings.json -> PreToolUse hooks registered")
2706def _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")
2724def 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

Callers 1

codebuddy_uninstallFunction · 0.85

Calls 3

_strip_graphify_hooksFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected