diff --git a/shepherd/agent/core.py b/shepherd/agent/core.py index 698919b..f871b57 100644 --- a/shepherd/agent/core.py +++ b/shepherd/agent/core.py @@ -350,3 +350,25 @@ def load_config_layer_and_plugins(confman: ConfigManager, config_source): # Validate all plugin configs confman.validate_bundles() + + +""" +Shim to allow the Agent to restart itself without involving the actual CLI +""" +if __name__ == '__main__': + import argparse + + parser = argparse.ArgumentParser(description="Shepherd core restart shim. For general use," + " use the main Shepherd CLI instead.") + + parser.add_argument('default_config_path', type=str) + parser.add_argument('use_custom_config', type=bool) + parser.add_argument('control_enabled', type=bool) + parser.add_argument('new_device_mode', type=bool) + + args = parser.parse_args() + + agent = Agent() + agent.load(args.default_config_path, args.use_custom_config, + args.control_enabled, args.new_device_mode) + agent.start()