MCPcopy Create free account
hub / github.com/NVIDIA/SkillSpector / _main_impl

Function _main_impl

contrib/multilingual/batch_scan.py:192–464  ·  view source on GitHub ↗

Body of main(), wrapped by deepseek_compat context manager.

()

Source from the content-addressed store, hash-verified

190
191
192def _main_impl() -> None:
193 """Body of main(), wrapped by deepseek_compat context manager."""
194 # -- Windows Unicode support ---------------------------------------------
195 if sys.platform == "win32":
196 sys.stdout.reconfigure(encoding="utf-8", errors="replace") # type: ignore[attr-defined]
197
198 # -- Rich detection -------------------------------------------------------
199 try:
200 from rich.console import Console
201 except ImportError:
202 Console = None # type: ignore[assignment] # noqa: N806
203
204 c = Console() if Console is not None else None
205
206 def _print(*args: object, **kwargs: object) -> None:
207 """Print through Rich when available, falling back to plain text."""
208 if c:
209 c.print(*args, **{k: v for k, v in kwargs.items() if k != "file"})
210 else:
211 msg = " ".join(str(a) for a in args)
212 file = kwargs.get("file")
213 if file:
214 print(msg, file=file) # type: ignore[arg-type]
215 else:
216 print(msg)
217
218 # -- CLI arguments -------------------------------------------------------
219 parser = argparse.ArgumentParser(
220 description="Batch-scan a directory of AI agent skills with SkillSpector.",
221 )
222 parser.add_argument(
223 "input_dir",
224 type=Path,
225 help="Directory containing skill subdirectories (each with a SKILL.md).",
226 )
227 parser.add_argument(
228 "-f",
229 "--format",
230 choices=("terminal", "json", "markdown"),
231 default="terminal",
232 help="Output format (default: terminal).",
233 )
234 parser.add_argument(
235 "-o",
236 "--output",
237 type=Path,
238 default=None,
239 help="Write report to FILE (default: stdout).",
240 )
241 parser.add_argument(
242 "--no-llm",
243 action="store_true",
244 default=False,
245 help="Skip LLM analysis — static patterns only.",
246 )
247 parser.add_argument(
248 "--workers",
249 type=int,

Callers 1

mainFunction · 0.85

Calls 8

set_levelFunction · 0.90
_printFunction · 0.85
discover_skillsFunction · 0.85
set_api_poolFunction · 0.85
_resolve_languageFunction · 0.85
resolveMethod · 0.80
snapshotMethod · 0.80

Tested by

no test coverage detected