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

Function _cursor_install

graphify/install.py:1624–1638  ·  view source on GitHub ↗

Write .cursor/rules/graphify.mdc with alwaysApply: true.

(project_dir: Path)

Source from the content-addressed store, hash-verified

1622- After modifying code files, run `graphify update .` to keep the graph current (AST-only, no API cost)
1623"""
1624def _cursor_install(project_dir: Path) -> None:
1625 """Write .cursor/rules/graphify.mdc with alwaysApply: true."""
1626 rule_path = (project_dir or Path(".")) / _CURSOR_RULE_PATH
1627 rule_path.parent.mkdir(parents=True, exist_ok=True)
1628 if rule_path.exists() and rule_path.read_text(encoding="utf-8") == _CURSOR_RULE:
1629 print(f"graphify rule at {rule_path} already configured (no change)")
1630 return
1631 # File is wholly graphify-owned. Overwrite on upgrade so older
1632 # report-first wording does not silently linger (issue #580).
1633 action = "updated" if rule_path.exists() else "written"
1634 rule_path.write_text(_CURSOR_RULE, encoding="utf-8")
1635 print(f"graphify rule {action} at {rule_path.resolve()}")
1636 print()
1637 print("Cursor will now always include the knowledge graph context.")
1638 print("Run /graphify . first to build the graph if you haven't already.")
1639def _cursor_uninstall(project_dir: Path) -> None:
1640 """Remove .cursor/rules/graphify.mdc."""
1641 rule_path = (project_dir or Path(".")) / _CURSOR_RULE_PATH

Callers 6

installFunction · 0.85
_project_installFunction · 0.85
dispatch_install_cliFunction · 0.85

Calls 1

resolveMethod · 0.45