addArgument( 'package', InputArgument::REQUIRED, 'The package to install (name or path)', suggestedValues: function (CompletionInput $input) { $packages = []; foreach (PackageLoader::getPackages(['target', 'virtual-target']) as $name => $_) { $packages[] = $name; } $val = $input->getCompletionValue(); return array_filter($packages, fn ($name) => str_starts_with($name, $val)); } ); $this->getDefinition()->addOptions(DownloaderOptions::getConsoleOptions('dl')); } public function handle(): int { ApplicationContext::set('elephant', true); $installer = new PackageInstaller([...$this->input->getOptions(), 'dl-prefer-binary' => true], true); $installer->addInstallPackage($this->input->getArgument('package')); $installer->run(true); return static::SUCCESS; } }