MCPcopy Index your code
hub / github.com/usestrix/strix / run_cli

Function run_cli

strix/interface/cli.py:38–216  ·  view source on GitHub ↗
(args: Any)

Source from the content-addressed store, hash-verified

36
37
38async def run_cli(args: Any) -> None: # noqa: PLR0915
39 console = Console()
40
41 start_text = Text()
42 start_text.append("Penetration test initiated", style="bold #22c55e")
43
44 target_text = Text()
45 target_text.append("Target", style="dim")
46 target_text.append(" ")
47 if len(args.targets_info) == 1:
48 target_text.append(args.targets_info[0]["original"], style="bold white")
49 else:
50 target_text.append(f"{len(args.targets_info)} targets", style="bold white")
51 for target_info in args.targets_info:
52 target_text.append("\n ")
53 target_text.append(target_info["original"], style="white")
54
55 results_text = Text()
56 results_text.append("Output", style="dim")
57 results_text.append(" ")
58 results_text.append(f"strix_runs/{args.run_name}", style="#60a5fa")
59
60 note_text = Text()
61 note_text.append("\n\n", style="dim")
62 note_text.append("Vulnerabilities will be displayed in real-time.", style="dim")
63
64 startup_panel = Panel(
65 Text.assemble(
66 start_text,
67 "\n\n",
68 target_text,
69 "\n",
70 results_text,
71 note_text,
72 ),
73 title="[bold white]STRIX",
74 title_align="left",
75 border_style="#22c55e",
76 padding=(1, 2),
77 )
78
79 console.print("\n")
80 console.print(startup_panel)
81 console.print()
82
83 scan_mode = getattr(args, "scan_mode", "deep")
84
85 scan_config: dict[str, Any] = {
86 "scan_id": args.run_name,
87 "targets": args.targets_info,
88 "user_instructions": args.instruction or "",
89 "run_name": args.run_name,
90 "diff_scope": getattr(args, "diff_scope", {"active": False}),
91 "scan_mode": scan_mode,
92 "non_interactive": bool(getattr(args, "non_interactive", False)),
93 "local_sources": getattr(args, "local_sources", None) or [],
94 "scope_mode": getattr(args, "scope_mode", "auto"),
95 "diff_base": getattr(args, "diff_base", None),

Callers 1

mainFunction · 0.90

Calls 10

hydrate_from_run_dirMethod · 0.95
set_scan_configMethod · 0.95
save_run_dataMethod · 0.95
ReportStateClass · 0.90
set_global_report_stateFunction · 0.90
run_strix_scanFunction · 0.90
create_live_statusFunction · 0.85
_resolve_sandbox_imageFunction · 0.85
cleanupMethod · 0.80
registerMethod · 0.45

Tested by

no test coverage detected