from django.core.management.base import BaseCommand

from apps.modules.services import sync_registry


class Command(BaseCommand):
    help = "Mirror the code registry (modules, dependencies, permissions) into the database."

    def handle(self, *args, **opts):
        result = sync_registry()
        self.stdout.write(self.style.SUCCESS(f"Registry synced: {result}"))
