From 55964bc0b1c7f06a047fe2d7b82f542913e3cb0c Mon Sep 17 00:00:00 2001 From: Safi Date: Fri, 10 Apr 2026 01:28:19 +0100 Subject: [PATCH] fix gemini install missing skill file copy (0.3.27) --- CHANGELOG.md | 4 ++++ graphify/__main__.py | 26 ++++++++++++++++++++++++-- pyproject.toml | 2 +- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index afa67ce2..166955e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ Full release notes with details on each version: [GitHub Releases](https://github.com/safishamsi/graphify/releases) +## 0.3.27 (2026-04-10) + +- Fix: graphify install --platform gemini now also copies the skill file to ~/.gemini/skills/graphify/SKILL.md so the /graphify trigger works in Gemini CLI (#174) + ## 0.3.26 (2026-04-10) - Fix: MCP server no longer uses a circular path validation when loading a graph outside cwd — now validates the path exists and ends in `.json` instead of checking containment within its own parent directory (security fix) diff --git a/graphify/__main__.py b/graphify/__main__.py index 56a2ae64..6a86661d 100644 --- a/graphify/__main__.py +++ b/graphify/__main__.py @@ -205,7 +205,15 @@ _GEMINI_HOOK = { def gemini_install(project_dir: Path | None = None) -> None: - """Write the graphify section to GEMINI.md and install BeforeTool hook.""" + """Copy skill file to ~/.gemini/skills/graphify/, write GEMINI.md section, and install BeforeTool hook.""" + # Copy skill file to ~/.gemini/skills/graphify/SKILL.md + skill_src = Path(__file__).parent / "skill.md" + skill_dst = Path.home() / ".gemini" / "skills" / "graphify" / "SKILL.md" + skill_dst.parent.mkdir(parents=True, exist_ok=True) + shutil.copy(skill_src, skill_dst) + (skill_dst.parent / ".graphify_version").write_text(__version__, encoding="utf-8") + print(f" skill installed -> {skill_dst}") + target = (project_dir or Path(".")) / "GEMINI.md" if target.exists(): @@ -259,7 +267,21 @@ def _uninstall_gemini_hook(project_dir: Path) -> None: def gemini_uninstall(project_dir: Path | None = None) -> None: - """Remove the graphify section from GEMINI.md and uninstall hook.""" + """Remove the graphify section from GEMINI.md, uninstall hook, and remove skill file.""" + # Remove skill file + skill_dst = Path.home() / ".gemini" / "skills" / "graphify" / "SKILL.md" + if skill_dst.exists(): + skill_dst.unlink() + print(f" skill removed -> {skill_dst}") + version_file = skill_dst.parent / ".graphify_version" + if version_file.exists(): + version_file.unlink() + for d in (skill_dst.parent, skill_dst.parent.parent): + try: + d.rmdir() + except OSError: + break + target = (project_dir or Path(".")) / "GEMINI.md" if not target.exists(): print("No GEMINI.md found in current directory - nothing to do") diff --git a/pyproject.toml b/pyproject.toml index 71e90a15..eac661e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "graphifyy" -version = "0.3.26" +version = "0.3.27" description = "AI coding assistant skill (Claude Code, Codex, OpenCode, Cursor, OpenClaw, Factory Droid, Trae) - turn any folder of code, docs, papers, or images into a queryable knowledge graph" readme = "README.md" license = { file = "LICENSE" }