Extract common init/require commands functionality into PackageDiscoveryTrait Extract some helper methods into BaseCommand for better types