Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions graphify/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ def _run_cli() -> None:
print(" --top N how many to show (default 10)")
print(" --graph <path> path to graph.json (default graphify-out/graph.json)")
print(" --json emit JSON instead of text")
print(" prs PR dashboard: CI state, review status, worktree mapping")
print(" save-result save a Q&A result to graphify-out/memory/ for graph feedback loop")
print(" --question Q the question asked")
print(" --answer A the answer to save")
Expand Down Expand Up @@ -617,13 +618,25 @@ def _run_cli() -> None:
print(" --cargo extract crate→crate deps from Cargo.toml")
print(" --global also merge the resulting graph into the global graph")
print(" --as <tag> repo tag for --global (default: target directory name)")
print(" provider [list|show|add|remove] manage custom LLM providers")
print(" global add <graph.json> add/update a project graph in the global graph (~/.graphify/global-graph.json)")
print(" --as <tag> repo tag (default: parent directory name)")
print(" global remove <tag> remove a repo's nodes from the global graph")
print(" global list list repos in the global graph")
print(" global path print path to the global graph file")
print(" benchmark [graph.json] measure token reduction vs naive full-corpus approach")
print(" export html emit interactive graph.html [--graph PATH] [--labels PATH] [--node-limit N] [--no-viz]")
print(" export callflow-html emit Mermaid-based architecture/call-flow HTML")
print(" [GRAPH|DIR] [--graph PATH] [--labels PATH] [--report PATH] [--sections PATH] [--output HTML]")
print(" [--lang auto|zh-CN|en] [--max-sections N] [--diagram-scale N]")
print(" export obsidian emit Obsidian vault notes + canvas [--graph PATH] [--labels PATH] [--dir PATH]")
print(" export wiki emit wiki markdown articles [--graph PATH] [--labels PATH]")
print(" export svg emit graph.svg [--graph PATH] [--labels PATH]")
print(" export graphml emit GraphML [--graph PATH]")
print(" export neo4j emit Cypher or push to Neo4j [--graph PATH] [--push URI] [--user U] [--password P]")
print(" (or set NEO4J_PASSWORD instead of --password to keep it off argv)")
print(" export falkordb emit Cypher or push to FalkorDB [--graph PATH] [--push URI] [--user U] [--password P]")
print(" (or set FALKORDB_PASSWORD instead of --password to keep it off argv)")
print(" hook install install post-commit/post-checkout git hooks (all platforms)")
print(" hook uninstall remove git hooks")
print(" hook status check if git hooks are installed")
Expand Down
41 changes: 41 additions & 0 deletions tests/test_cli_help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""`graphify --help` must list user-facing commands that dispatch_command implements.

#3140: the top-level listing in graphify/__main__.py is hand-maintained and
drifted from dispatch_command() — prs, provider, and 7 of 8 export formats
never appeared. Precedent: #2071 / PR #2075 (one usage line + stdout assert).
"""
from __future__ import annotations

import subprocess
import sys

PYTHON = sys.executable


def test_help_lists_prs_provider_and_export_formats():
"""#3140: `graphify --help` must advertise prs, provider, and all export formats."""
r = subprocess.run(
[PYTHON, "-m", "graphify", "--help"],
capture_output=True,
text=True,
)
Comment on lines +17 to +21
assert r.returncode == 0, f"--help should exit 0: {r.stderr}"
out = r.stdout
assert " prs" in out, "`graphify --help` must list prs (#3140)"
assert "provider" in out, "`graphify --help` must list provider (#3140)"
for fmt in (
"html",
"callflow-html",
"obsidian",
"wiki",
"svg",
"graphml",
"neo4j",
"falkordb",
):
assert f"export {fmt}" in out, (
f"`graphify --help` must list export {fmt} (#3140)"
)
# Silent hook internals — deliberately excluded from user-facing help.
assert "hook-check" not in out
assert "hook-guard" not in out
Loading