"""Command line interface for the PAM deploy agent.""" from __future__ import annotations import argparse import json from .agent import PamDeployAgent from .params_loader import load_params_file def main() -> None: parser = argparse.ArgumentParser(prog="pam-deploy-agent") sub = parser.add_subparsers(dest="command", required=True) preview = sub.add_parser("preview") preview.add_argument("--config", required=True) preview.add_argument("--strategy", default="hybrid_node_mcp", choices=["hybrid_node_mcp", "script_only", "fake"]) run = sub.add_parser("run-global") run.add_argument("--config", required=True) run.add_argument("--strategy", default="fake", choices=["hybrid_node_mcp", "script_only", "fake"]) run.add_argument("--confirm", action="store_true") args = parser.parse_args() params = load_params_file(args.config) agent = PamDeployAgent() if args.command == "preview": print(agent.preview(params, args.strategy)) return if not args.confirm: raise SystemExit("Refusing to execute actions without --confirm.") state = agent.create_state(params=params, execution_strategy=args.strategy) state = agent.run_global_flow(state) print(json.dumps({"events": state.events}, ensure_ascii=False, indent=2)) if __name__ == "__main__": main()