diff --git a/graphify/__main__.py b/graphify/__main__.py index 155501a98..24e8d9d6a 100644 --- a/graphify/__main__.py +++ b/graphify/__main__.py @@ -565,6 +565,7 @@ def _run_cli() -> None: print(" --top N how many to show (default 10)") print(" --graph 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") @@ -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 repo tag for --global (default: target directory name)") + print(" provider [list|show|add|remove] manage custom LLM providers") print(" global add add/update a project graph in the global graph (~/.graphify/global-graph.json)") print(" --as repo tag (default: parent directory name)") print(" global remove 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") diff --git a/tests/test_cli_help.py b/tests/test_cli_help.py new file mode 100644 index 000000000..49d73cdb1 --- /dev/null +++ b/tests/test_cli_help.py @@ -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, + ) + 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