INNER CODE UNIT · Python
cli_main
invergent-ai/surogate · surogate/cli/main.py:213
def cli_main():
"""Main CLI entry point for installed 'surogate' command."""
args = parse_args()
system_info = get_system_info()
print_system_diagnostics(system_info)
# Run the command module in-process (avoids a second Python startup).
# Rewrite sys.argv so the module's __main__ block sees only its own args.
module_name = COMMAND_MAPPING[args.command]
sys.argv = [module_name] + sys.argv[2:]
runpy.run_module(module_name, run_name="__main__", alter_sys=True)
if __name__ == "__main__":
cli_main()