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

Function dispatch_install_cli

graphify/install.py:2795–3085  ·  view source on GitHub ↗

Handle `graphify ` dispatch (install/uninstall + every per-platform install target). Returns True if cmd was an install command and was handled, False otherwise so the caller can continue its own dispatch. Moved verbatim from __main__.main().

(cmd: str)

Source from the content-addressed store, hash-verified

2793
2794
2795def dispatch_install_cli(cmd: str) -> bool:
2796 """Handle `graphify <install-command>` dispatch (install/uninstall + every
2797 per-platform install target). Returns True if cmd was an install command and
2798 was handled, False otherwise so the caller can continue its own dispatch.
2799 Moved verbatim from __main__.main().
2800 """
2801 if cmd not in _CLI_INSTALL_COMMANDS:
2802 return False
2803 if cmd == "install":
2804 # Default to windows platform on Windows, claude elsewhere
2805 default_platform = "windows" if platform.system() == "Windows" else "claude"
2806 selected_platform: str | None = None
2807 project_scope = False
2808 strict = False
2809 args = sys.argv[2:]
2810 i = 0
2811 while i < len(args):
2812 arg = args[i]
2813 if arg in ("-h", "--help"):
2814 _print_install_usage()
2815 return True
2816 if arg == "--project":
2817 project_scope = True
2818 i += 1
2819 elif arg == "--strict":
2820 strict = True
2821 i += 1
2822 elif arg.startswith("--platform="):
2823 candidate = arg.split("=", 1)[1]
2824 if selected_platform and selected_platform != candidate:
2825 print("error: specify install platform only once", file=sys.stderr)
2826 sys.exit(1)
2827 selected_platform = candidate
2828 i += 1
2829 elif arg == "--platform":
2830 if i + 1 >= len(args):
2831 print("error: --platform requires a value", file=sys.stderr)
2832 sys.exit(1)
2833 candidate = args[i + 1]
2834 if selected_platform and selected_platform != candidate:
2835 print("error: specify install platform only once", file=sys.stderr)
2836 sys.exit(1)
2837 selected_platform = candidate
2838 i += 2
2839 elif arg.startswith("-"):
2840 print(f"error: unknown install option '{arg}'", file=sys.stderr)
2841 sys.exit(1)
2842 else:
2843 if selected_platform and selected_platform != arg:
2844 print("error: specify install platform only once", file=sys.stderr)
2845 sys.exit(1)
2846 selected_platform = arg
2847 i += 1
2848 chosen_platform = selected_platform or default_platform
2849 if project_scope:
2850 _project_install(chosen_platform, Path("."), strict=strict)
2851 else:
2852 if strict:

Calls 15

_print_install_usageFunction · 0.85
_project_installFunction · 0.85
_project_uninstallFunction · 0.85
_project_uninstall_allFunction · 0.85
uninstall_allFunction · 0.85
claude_installFunction · 0.85
claude_uninstallFunction · 0.85
codebuddy_installFunction · 0.85
codebuddy_uninstallFunction · 0.85
gemini_installFunction · 0.85
gemini_uninstallFunction · 0.85
_cursor_installFunction · 0.85