MCPcopy
hub / github.com/ModelEngine-Group/nexent / main

Function main

deploy/docker/assets/scripts/sync_skill_directory.py:522–674  ·  view source on GitHub ↗

Main function.

()

Source from the content-addressed store, hash-verified

520
521
522def main():
523 """Main function."""
524 parser = argparse.ArgumentParser(
525 description='Migrate skills directory for v2.2.0 upgrade (run on host)'
526 )
527 parser.add_argument(
528 '--dry-run',
529 action='store_true',
530 help='Show what would be migrated without making changes'
531 )
532 parser.add_argument(
533 '--verbose',
534 action='store_true',
535 help='Enable verbose debug output'
536 )
537 parser.add_argument(
538 '--legacy-dir',
539 type=str,
540 default=None,
541 help='Override legacy skills directory path (host path)'
542 )
543 parser.add_argument(
544 '--target-dir',
545 type=str,
546 default=None,
547 help='Override target skills directory path (host path)'
548 )
549 parser.add_argument(
550 '--skip-db',
551 action='store_true',
552 help='Skip database connection and use existing tenant directories'
553 )
554 args = parser.parse_args()
555
556 if args.verbose:
557 logging.getLogger().setLevel(logging.DEBUG)
558
559 logger.info("=" * 60)
560 logger.info("Skills Directory Migration Script (v2.2.0)")
561 logger.info("=" * 60)
562
563 if args.dry_run:
564 logger.info("Mode: DRY-RUN (no changes will be made)")
565
566 # Step 1: Load environment from .env file
567 logger.info("\n[Step 1/6] Loading environment variables...")
568 load_environment_from_host()
569
570 # Get ROOT_DIR
571 root_dir = get_root_dir()
572 if root_dir:
573 logger.info(f" ROOT_DIR: {root_dir}")
574 else:
575 logger.warning(" ROOT_DIR not set, using current directory")
576
577 # Determine host paths
578 skills_base = str(Path(root_dir) / "skills") if root_dir else "skills"
579

Callers 1

Calls 11

get_root_dirFunction · 0.85
check_container_runningFunction · 0.85
migrate_skillsFunction · 0.85
errorMethod · 0.80
print_resultsFunction · 0.70
joinMethod · 0.45

Tested by

no test coverage detected