Main CLI entry point.
()
| 349 | |
| 350 | |
| 351 | def main() -> None: |
| 352 | """Main CLI entry point.""" |
| 353 | ap = argparse.ArgumentParser( |
| 354 | prog="code-review-graph", |
| 355 | description="Persistent incremental knowledge graph for code reviews", |
| 356 | ) |
| 357 | ap.add_argument("-v", "--version", action="store_true", help="Show version and exit") |
| 358 | sub = ap.add_subparsers(dest="command") |
| 359 | |
| 360 | # install (primary) + init (alias) |
| 361 | install_cmd = sub.add_parser("install", help="Register MCP server with AI coding platforms") |
| 362 | install_cmd.add_argument("--repo", default=None, help="Repository root (auto-detected)") |
| 363 | install_cmd.add_argument( |
| 364 | "--dry-run", |
| 365 | action="store_true", |
| 366 | help="Show what would be done without writing files", |
| 367 | ) |
| 368 | install_cmd.add_argument( |
| 369 | "--no-skills", |
| 370 | action="store_true", |
| 371 | help="Skip generating platform-native skill files", |
| 372 | ) |
| 373 | install_cmd.add_argument( |
| 374 | "--no-hooks", |
| 375 | action="store_true", |
| 376 | help="Skip installing platform-native hooks", |
| 377 | ) |
| 378 | install_cmd.add_argument( |
| 379 | "--no-instructions", |
| 380 | action="store_true", |
| 381 | help="Skip injecting graph instructions into CLAUDE.md / AGENTS.md / etc.", |
| 382 | ) |
| 383 | install_cmd.add_argument( |
| 384 | "-y", |
| 385 | "--yes", |
| 386 | action="store_true", |
| 387 | help="Auto-confirm instruction injection without an interactive prompt", |
| 388 | ) |
| 389 | # Legacy flags (kept for backwards compat, now no-ops since all is default) |
| 390 | install_cmd.add_argument("--skills", action="store_true", help=argparse.SUPPRESS) |
| 391 | install_cmd.add_argument("--hooks", action="store_true", help=argparse.SUPPRESS) |
| 392 | install_cmd.add_argument( |
| 393 | "--all", action="store_true", dest="install_all", help=argparse.SUPPRESS |
| 394 | ) |
| 395 | install_cmd.add_argument( |
| 396 | "--platform", |
| 397 | choices=_PLATFORM_CHOICES, |
| 398 | default="all", |
| 399 | help="Target platform for MCP config (default: all detected)", |
| 400 | ) |
| 401 | |
| 402 | init_cmd = sub.add_parser("init", help="Alias for install") |
| 403 | init_cmd.add_argument("--repo", default=None, help="Repository root (auto-detected)") |
| 404 | init_cmd.add_argument( |
| 405 | "--dry-run", |
| 406 | action="store_true", |
| 407 | help="Show what would be done without writing files", |
| 408 | ) |
nothing calls this directly
no test coverage detected